/** * Sets the parent package for this function. * * @param PHP_Depend_Code_Package $package The parent package. * * @return void */ public function setPackage(PHP_Depend_Code_Package $package) { $this->packageName = $package->getName(); $this->package = $package; }
/** * Visits a package node. * * @param PHP_Depend_Code_Class $package The package class node. * * @return void * @see PHP_Depend_VisitorI::visitPackage() */ public function visitPackage(PHP_Depend_Code_Package $package) { $xml = end($this->_xmlStack); $doc = $xml->ownerDocument; $packageXml = $doc->createElement('package'); $packageXml->setAttribute('name', $package->getName()); $this->writeNodeMetrics($packageXml, $package); array_push($this->_xmlStack, $packageXml); foreach ($package->getTypes() as $type) { $type->accept($this); } foreach ($package->getFunctions() as $function) { $function->accept($this); } array_pop($this->_xmlStack); if ($packageXml->firstChild === null) { return; } $xml->appendChild($packageXml); }
/** * Visits a package node. * * @param PHP_Depend_Code_Class $package The package class node. * * @return void * @see PHP_Depend_VisitorI::visitPackage() */ public function visitPackage(PHP_Depend_Code_Package $package) { $this->visits[] = $package->getName(); parent::visitPackage($package); }
/** * Sets the parent package for this function. * * @param PHP_Depend_Code_Package $package The parent package. * * @return void */ public function setPackage(PHP_Depend_Code_Package $package = null) { if ($package === null) { $this->packageName = null; $this->_package = null; } else { $this->packageName = $package->getName(); $this->_package = $package; } }