> */ public function getNodeTypes() : array { return [FuncCall::class]; } /** * @param FuncCall $node */ public function refactor(Node $node) : ?Node { if (!$this->isName($node, 'mb_strrpos')) { return null; } if (!isset($node->args[2])) { return null; } if (isset($node->args[3])) { return null; } if (!$node->args[2] instanceof Arg) { return null; } $secondArgType = $this->getType($node->args[2]->value); if ($secondArgType->isInteger()->yes()) { return null; } $node->args[3] = $node->args[2]; $node->args[2] = new Arg(new LNumber(0)); return $node; } }