public function leaveNode(Node $node)
{
if (!$node instanceof Node\Expr\MethodCall || !isset($node->var->name)) {
return;
}
$variable = $node->var->name;
$method = $node->name;
$normalized = sprintf('$%s->%s', $variable, $method);
if (!in_array($normalized, $this->blacklist)) {
return;
}
$this->addError(sprintf('Found blacklisted "%s" method call', $normalized), $node->getline(), ParseError::TYPE_ERROR);
}