public function isFunctionCallByStaticName(Node $node, $checkedFunctionName) { $isFunctionCallByStaticName = $node instanceof Node\Expr\FuncCall && $node->name instanceof Node\Name; if (!$isFunctionCallByStaticName) { return $isFunctionCallByStaticName; } $calledFunctionName = strtolower($node->name->toString()); return is_array($checkedFunctionName) ? isset($checkedFunctionName[$calledFunctionName]) : $calledFunctionName === $checkedFunctionName; }
/** * {@inheritdoc} */ public function enterNode(Node $node) { if (!$this->functionAnalyzer->isFunctionCallByStaticName($node, $this->mktimeFamilyFunctions) || count($node->args) < 7) { return; } $this->addContextMessage(sprintf('Removed argument $is_dst used for function "%s"', $node->name->__toString()), $node); }