/**
  * 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;
     }
     $this->addViolation($node);
 }
예제 #2
0
파일: Parser.php 프로젝트: flavius/phpmd
 /**
  * Collects the collected metrics for the given node and adds them to the
  * <b>$node</b>.
  *
  * @param \PHPMD\AbstractNode $node
  * @return void
  */
 private function collectMetrics(AbstractNode $node)
 {
     $metrics = array();
     $pdepend = $node->getNode();
     foreach ($this->analyzers as $analyzer) {
         $metrics = array_merge($metrics, $analyzer->getNodeMetrics($pdepend));
     }
     $node->setMetrics($metrics);
 }