예제 #1
0
 /**
  * Visits a function node.
  *
  * @param PHP_Depend_Code_Function $function The current function node.
  *
  * @return void
  * @see PHP_Depend_VisitorI::visitFunction()
  */
 public function visitFunction(PHP_Depend_Code_Function $function)
 {
     $this->visits[] = $function->getName();
     parent::visitFunction($function);
 }
예제 #2
0
파일: Xml.php 프로젝트: Tjorriemorrie/app
 /**
  * Visits a function node.
  *
  * @param PHP_Depend_Code_Function $function The current function node.
  *
  * @return void
  * @see PHP_Depend_VisitorI::visitFunction()
  */
 public function visitFunction(PHP_Depend_Code_Function $function)
 {
     $xml = end($this->_xmlStack);
     $doc = $xml->ownerDocument;
     $functionXml = $doc->createElement('function');
     $functionXml->setAttribute('name', $function->getName());
     $this->writeNodeMetrics($functionXml, $function);
     $this->writeFileReference($functionXml, $function->getSourceFile());
     $xml->appendChild($functionXml);
 }
예제 #3
0
파일: Xml.php 프로젝트: kingsj/core
 /**
  * Visits a function node.
  *
  * @param PHP_Depend_Code_Function $function The current function node.
  *
  * @return void
  * @see PHP_Depend_VisitorI::visitFunction()
  */
 public function visitFunction(PHP_Depend_Code_Function $function)
 {
     // First visit function file
     $function->getSourceFile()->accept($this);
     $fileXml = end($this->_xmlStack);
     $document = $fileXml->ownerDocument;
     $functionXml = $document->createElement('function');
     $functionXml->setAttribute('name', $function->getName());
     $this->_appendMetrics($functionXml, $function);
     $fileXml->appendChild($functionXml);
     // Update file element @functions count
     $fileXml->setAttribute('functions', 1 + $fileXml->getAttribute('functions'));
     // Remove xml file element
     array_pop($this->_xmlStack);
 }
예제 #4
0
 /**
  * Tests the ctor and the {@link PHP_Depend_Code_Function::getName()} method.
  *
  * @return void
  */
 public function testCreateNewFunctionInstance()
 {
     $function = new PHP_Depend_Code_Function('func');
     $this->assertEquals('func', $function->getName());
 }