> */ public function getNodeTypes() : array { return [FuncCall::class]; } /** * @param FuncCall $node */ public function refactor(Node $node) : ?Node { if (!$this->isName($node, 'array_key_exists')) { return null; } if (!isset($node->args[1])) { return null; } if (!$node->args[1] instanceof Arg) { return null; } $firstArgStaticType = $this->getType($node->args[1]->value); if (!$firstArgStaticType instanceof ObjectType) { return null; } $node->name = new Name('property_exists'); $node->args = \array_reverse($node->args); return $node; } }