Psecio\Parse\Rule\PregReplaceWithEvalModifier::isValid PHP Method

isValid() public method

public isValid ( PhpParser\Node $node )
$node PhpParser\Node
    public function isValid(Node $node)
    {
        if ($this->isFunctionCall($node, 'preg_replace')) {
            $value = $this->getCalledFunctionArgument($node, 0)->value;
            if (property_exists($value, 'value') && preg_match("/e[a-zA-Z]*\$/", $value->value)) {
                return false;
            }
        }
        return true;
    }
PregReplaceWithEvalModifier