> */ public function getNodeTypes() : array { return [FuncCall::class]; } /** * @param FuncCall $node */ public function refactor(Node $node) : ?Node { if (!$this->isName($node, 'is_a')) { return null; } if ($node->isFirstClassCallable()) { return null; } if (isset($node->getArgs()[2])) { return null; } $firstArg = $node->getArgs()[0]; $firstArgumentStaticType = $this->getType($firstArg->value); if (!$firstArgumentStaticType->isString()->yes()) { return null; } $node->args[2] = new Arg($this->nodeFactory->createTrue()); return $node; } }