> */ public function getNodeTypes() : array { return [FuncCall::class]; } /** * @param FuncCall $node */ public function refactor(Node $node) : ?Node { if (!$this->isName($node, 'count')) { return null; } if ($node->isFirstClassCallable()) { return null; } $firstArg = $node->getArgs()[0]; if (!$firstArg->value instanceof FuncCall) { return null; } /** @var FuncCall $innerFuncCall */ $innerFuncCall = $firstArg->value; if (!$this->isName($innerFuncCall, 'func_get_args')) { return null; } return $this->nodeFactory->createFuncCall('func_num_args'); } }