protected function doCheckNodeImage(AbstractNode $node) { if ($this->isNameAllowedInContext($node)) { return; } if ($this->isUnusedForeachVariableAllowed($node)) { return; } $this->addViolation($node, array($node->getImage())); }