Esempio n. 1
0
 /**
  * Visits a code interface object.
  *
  * @param PHP_Depend_Code_Interface $interface The context code interface.
  *
  * @return void
  * @see PHP_Depend_VisitorI::visitInterface()
  */
 public function visitInterface(PHP_Depend_Code_Interface $interface)
 {
     if (!$interface->isUserDefined()) {
         return;
     }
     $doc = $this->abstractClasses->ownerDocument;
     $classXml = $doc->createElement('Class');
     $classXml->setAttribute('sourceFile', (string) $interface->getSourceFile());
     $classXml->appendChild($doc->createTextNode($interface->getName()));
     $this->abstractClasses->appendChild($classXml);
 }
Esempio n. 2
0
 /**
  * Visits a code interface object.
  *
  * @param PHP_Depend_Code_Interface $interface The context code interface.
  *
  * @return void
  * @see PHP_Depend_VisitorI::visitInterface()
  */
 public function visitInterface(PHP_Depend_Code_Interface $interface)
 {
     if (false === $interface->isUserDefined()) {
         return;
     }
     $this->fireStartInterface($interface);
     // Update global class count
     ++$this->_noi;
     // Update parent package
     $packageUUID = $interface->getPackage()->getUUID();
     ++$this->_nodeMetrics[$packageUUID][self::M_NUMBER_OF_INTERFACES];
     $this->_nodeMetrics[$interface->getUUID()] = array(self::M_NUMBER_OF_METHODS => 0);
     foreach ($interface->getMethods() as $method) {
         $method->accept($this);
     }
     $this->fireEndInterface($interface);
 }
Esempio n. 3
0
 /**
  * Visits an interface node.
  *
  * @param PHP_Depend_Code_Interface $node The current interface node.
  *
  * @return void
  * @see PHP_Depend_VisitorI::visitInterface()
  */
 public function visitInterface(PHP_Depend_Code_Interface $node)
 {
     if (!$node->isUserDefined()) {
         return;
     }
     $this->_apply(new PHP_PMD_Node_Interface($node));
     parent::visitInterface($node);
 }
Esempio n. 4
0
 /**
  * testIsUserDefinedReturnsTrueAfterSetUserDefinedCall
  *
  * @return void
  * @group pdepend
  * @group pdepend::code
  * @group unittest
  */
 public function testIsUserDefinedReturnsTrueAfterSetUserDefinedCall()
 {
     $interface = new PHP_Depend_Code_Interface(__CLASS__);
     $interface->setUserDefined();
     self::assertTrue($interface->isUserDefined());
 }