public function convert(\DOMElement $parent, ConstantDescriptor $constant)
    {
        $fullyQualifiedNamespaceName = $constant->getNamespace() instanceof NamespaceDescriptor
            ? $constant->getNamespace()->getFullyQualifiedStructuralElementName()
            : $parent->getAttribute('namespace');

        $child = new \DOMElement('constant');
        $parent->appendChild($child);

        $child->setAttribute('namespace', ltrim($fullyQualifiedNamespaceName, '\\'));
        $child->setAttribute('line', $constant->getLine());

        $child->appendChild(new \DOMElement('name', $constant->getName()));
        $child->appendChild(new \DOMElement('full_name', $constant->getFullyQualifiedStructuralElementName()));
        $child->appendChild(new \DOMElement('value'))->appendChild(new \DOMText($constant->getValue()));

        $this->docBlockConverter->convert($child, $constant);

        return $child;
    }
public function convert(\DOMElement $parent, ConstantDescriptor $constant)
    {
        $fullyQualifiedNamespaceName = $constant->getNamespace() instanceof NamespaceDescriptor
            ? $constant->getNamespace()->getFullyQualifiedStructuralElementName()
            : $parent->getAttribute('namespace');

        $child = new \DOMElement('constant');
        $parent->appendChild($child);

        $child->setAttribute('namespace', ltrim($fullyQualifiedNamespaceName, '\\'));
        $child->setAttribute('line', $constant->getLine());

        $child->appendChild(new \DOMElement('name', $constant->getName()));
        $child->appendChild(new \DOMElement('full_name', $constant->getFullyQualifiedStructuralElementName()));
        $child->appendChild(new \DOMElement('value'))->appendChild(new \DOMText($constant->getValue()));

        $this->docBlockConverter->convert($child, $constant);

        return $child;
    }
public function convert ( \ DOMElement $ parent , ConstantDescriptor $ constant ) { $ fullyQualifiedNamespaceName = $ constant -> getNamespace ( ) instanceof NamespaceDescriptor ? $ constant -> getNamespace ( ) -> getFullyQualifiedStructuralElementName ( ) : $ parent -> getAttribute ( 'namespace' ) ; $ child = new \ DOMElement ( 'constant' ) ; $ parent -> appendChild ( $ child ) ; $ child -> setAttribute ( 'namespace' , ltrim ( $ fullyQualifiedNamespaceName , '\\' ) ) ; $ child -> setAttribute ( 'line' , $ constant -> getLine ( ) ) ; $ child -> appendChild ( new \ DOMElement ( 'name' , $ constant -> getName ( ) ) ) ; $ child -> appendChild ( new \ DOMElement ( 'full_name' , $ constant -> getFullyQualifiedStructuralElementName ( ) ) ) ; $ child -> appendChild ( new \ DOMElement ( 'value' ) ) -> appendChild ( new \ DOMText ( $ constant -> getValue ( ) ) ) ; $ this -> docBlockConverter -> convert ( $ child , $ constant ) ; return $ child ; }
Export the given reflected constant definition to the provided parent element.

@param \DOMElement        $parent Element to augment.
@param ConstantDescriptor $constant Element to export.

@return \DOMElement
Export the given reflected constant definition to the provided parent element .