예제 #1
0
 /**
  * Export the given property definition to the provided parent element.
  *
  * @param \DOMElement                        $parent   Element to augment.
  * @param \phpDocumentor\Reflection\ClassReflector\PropertyReflector $property Element to export.
  *
  * @return void
  */
 public function export(\DOMElement $parent, $property)
 {
     $child = new \DOMElement('property');
     $parent->appendChild($child);
     $child->setAttribute('final', $property->isFinal() ? 'true' : 'false');
     $child->setAttribute('static', $property->isStatic() ? 'true' : 'false');
     $child->setAttribute('visibility', $property->getVisibility());
     $object = new VariableExporter();
     $object->export($parent, $property, $child);
 }
 /**
  * Creates a Descriptor from the provided data.
  *
  * @param PropertyReflector $data
  *
  * @return PropertyDescriptor
  */
 public function create($data)
 {
     $propertyDescriptor = new PropertyDescriptor();
     $propertyDescriptor->setFullyQualifiedStructuralElementName($data->getName());
     $propertyDescriptor->setName($data->getShortName());
     $propertyDescriptor->setVisibility($data->getVisibility() ?: 'public');
     $propertyDescriptor->setStatic($data->isStatic());
     $propertyDescriptor->setDefault($data->getDefault());
     $this->assembleDocBlock($data->getDocBlock(), $propertyDescriptor);
     $propertyDescriptor->setLine($data->getLinenumber());
     return $propertyDescriptor;
 }
예제 #3
0
 /**
  * Export this variable definition to the given parent DOMElement.
  *
  * @param \DOMElement       $parent   Element to augment.
  * @param PropertyReflector $variable Element to log from.
  * @param \DOMElement       $child    if supplied this element will be
  *     augmented instead of freshly added.
  *
  * @return void
  */
 public function export(\DOMElement $parent, $variable, \DOMElement $child = null)
 {
     if (!$child) {
         $child = new \DOMElement('variable');
         $parent->appendChild($child);
     }
     $child->setAttribute('line', $variable->getLineNumber());
     $child->setAttribute('namespace', $variable->getNamespace() ? $variable->getNamespace() : $parent->getAttribute('namespace'));
     $child->appendChild(new \DOMElement('name', $variable->getName()));
     $child->appendChild(new \DOMElement('default'))->appendChild(new \DOMText($variable->getDefault()));
     $object = new DocBlockExporter();
     $object->export($child, $variable);
 }
예제 #4
0
 /**
  * Export this variable definition to the given parent DOMElement.
  *
  * @param \DOMElement       $parent   Element to augment.
  * @param PropertyReflector $variable Element to log from.
  * @param \DOMElement       $child    if supplied this element will be
  *     augmented instead of freshly added.
  *
  * @return void
  */
 public function export(\DOMElement $parent, $variable, \DOMElement $child = null)
 {
     if (!$child) {
         $child = new \DOMElement('variable');
         $parent->appendChild($child);
     }
     $child->setAttribute('line', $variable->getLineNumber());
     $child->setAttribute('namespace', $variable->getNamespace() ? $variable->getNamespace() : $parent->getAttribute('namespace'));
     $child->appendChild(new \DOMElement('name', $variable->getName()));
     $default = new \DOMElement('default');
     $child->appendChild($default);
     /** @var \DOMDocument $dom_document */
     $dom_document = $child->ownerDocument;
     $default->appendChild($dom_document->createCDATASection($variable->getDefault()));
     $object = new DocBlockExporter();
     $object->export($child, $variable);
 }