/** * Implements DocBlox_Reflection_DocBlock_Tag_Interface * * @param SimpleXMLElement $xml Relative root of xml document */ public function __toXml(SimpleXMLElement $xml) { parent::__toXml($xml); foreach ($this->getTypes() as $type) { if ($type == '') { continue; } $type = trim($this->docblock->expandType($type)); // strip ampersands $name = str_replace('&', '', $type); $type_object = $xml->addChild('type', $name); // register whether this variable is by reference by checking the first and last character $type_object['by_reference'] = substr($type, 0, 1) === '&' || substr($type, -1) === '&' ? 'true' : 'false'; } $xml['type'] = $this->docblock->expandType($this->getType()); if (trim($this->getVariableName()) == '') { // TODO: get the name from the argument list } $xml['variable'] = $this->getVariableName(); }
/** * Implements DocBlox_Reflection_DocBlock_Tag_Interface * * @param SimpleXMLElement $xml Relative root of xml document */ public function __toXml(SimpleXMLElement $xml) { parent::__toXml($xml); $xml['link'] = $this->getLink(); }