> */ public function getNodeTypes() : array { return [FuncCall::class]; } /** * @param FuncCall $node */ public function refactor(Node $node) : ?Node { if (!$this->isNames($node, self::NEEDLE_STRING_SENSITIVE_FUNCTIONS)) { return null; } if (!isset($node->args[1])) { return null; } if (!$node->args[1] instanceof Arg) { return null; } // is argument string? $needleArgValue = $node->args[1]->value; $needleType = $this->getType($needleArgValue); if ($needleType->isString()->yes()) { return null; } if ($needleArgValue instanceof Encapsed) { return null; } $node->args[1]->value = new String_($node->args[1]->value); return $node; } }