> */ public function getNodeTypes(): array { // what node types are we looking for? // pick from https://github.com/rectorphp/php-parser-nodes-docs/ return [FuncCall::class]; } /** * @param FuncCall $node */ public function refactor(Node $node): ?Node { $fct_name = $this->getName($node->name); if ($fct_name === null) { return null; } return $fct_name === 'htmlspecialchars' && !$node->isFirstClassCallable() ? new FuncCall(new Name('escape'), [$node->getArgs()[0]]) : null; } }