/**
  * Visits a code interface object.
  *
  * @param \PDepend\Source\AST\ASTInterface $interface
  * @return void
  */
 public function visitInterface(ASTInterface $interface)
 {
     if (!$interface->isUserDefined()) {
         return;
     }
     $doc = $this->abstractClasses->ownerDocument;
     $classXml = $doc->createElement('Class');
     $classXml->setAttribute('sourceFile', (string) $interface->getCompilationUnit());
     $classXml->appendChild($doc->createTextNode($interface->getName()));
     $this->abstractClasses->appendChild($classXml);
 }
 /**
  * Visits a code interface object.
  *
  * @param \PDepend\Source\AST\ASTInterface $interface
  * @return void
  */
 public function visitInterface(ASTInterface $interface)
 {
     if (false === $interface->isUserDefined()) {
         return;
     }
     $this->fireStartInterface($interface);
     // Update global class count
     ++$this->noi;
     $id = $interface->getNamespace()->getId();
     ++$this->nodeMetrics[$id][self::M_NUMBER_OF_INTERFACES];
     $this->nodeMetrics[$interface->getId()] = array(self::M_NUMBER_OF_METHODS => 0);
     foreach ($interface->getMethods() as $method) {
         $method->accept($this);
     }
     $this->fireEndInterface($interface);
 }
예제 #3
0
파일: Parser.php 프로젝트: flavius/phpmd
 /**
  * Visits an interface node.
  *
  * @param \PDepend\Source\AST\ASTInterface $node
  * @return void
  */
 public function visitInterface(ASTInterface $node)
 {
     if (!$node->isUserDefined()) {
         return;
     }
     $this->apply(new InterfaceNode($node));
     parent::visitInterface($node);
 }