> */ public function getNodeTypes() : array { return [FuncCall::class]; } /** * @param FuncCall $node */ public function refactor(Node $node) : ?Node { if (!$this->isName($node, 'intval')) { return null; } if (isset($node->args[1]) && $node->args[1] instanceof Arg) { $secondArgumentValue = $this->valueResolver->getValue($node->args[1]->value); // default value if ($secondArgumentValue !== 10) { return null; } } if ($node->isFirstClassCallable()) { return null; } if (!isset($node->getArgs()[0])) { return null; } return new Int_($node->getArgs()[0]->value); } }