예제 #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;
 }