> */ public function getNodeTypes() : array { return [FuncCall::class]; } /** * @param FuncCall $node */ public function refactor(Node $node) : ?Node { if ($node->isFirstClassCallable()) { return null; } if ($this->isName($node, 'utf8_decode')) { $node->name = new Name('mb_convert_encoding'); $node->args[1] = new Arg(new String_('ISO-8859-1')); return $node; } if ($this->isName($node, 'utf8_encode')) { $node->name = new Name('mb_convert_encoding'); $node->args[1] = new Arg(new String_('UTF-8')); $node->args[2] = new Arg(new String_('ISO-8859-1')); return $node; } return null; } public function provideMinPhpVersion() : int { return PhpVersionFeature::DEPRECATE_UTF8_DECODE_ENCODE_FUNCTION; } }