/** * Is method has the same name as the enclosing class * (php4 style constructor). * * @param \PHPMD\AbstractNode $node * @return void */ public function apply(AbstractNode $node) { if ($node->getNode()->getParent() instanceof ASTTrait) { return; } if (strcasecmp($node->getName(), $node->getParentName()) !== 0) { return; } if ($node->getParentType() instanceof InterfaceNode) { return; } if ($node->getNamespaceName() !== '+global') { return; } $this->addViolation($node); }
/** * Returns the name of the package that contains this violation. * * @return string */ public function getNamespaceName() { return $this->node->getNamespaceName(); }