1 | <?php |
||
26 | class DocBlockConverter |
||
27 | { |
||
28 | /** @var TagConverter Converter used to generate XML elements from TagDescriptors */ |
||
29 | protected $tagConverter; |
||
30 | |||
31 | /** @var RouterAbstract */ |
||
32 | private $router; |
||
33 | |||
34 | /** |
||
35 | * Stores the converter for tags on this converter. |
||
36 | */ |
||
37 | 1 | public function __construct(TagConverter $tagConverter, RouterAbstract $router) |
|
42 | |||
43 | /** |
||
44 | * Exports the given reflection object to the parent XML element. |
||
45 | * |
||
46 | * This method creates a new child element on the given parent XML element |
||
47 | * and takes the properties of the Reflection argument and sets the |
||
48 | * elements and attributes on the child. |
||
49 | * |
||
50 | * If a child DOMElement is provided then the properties and attributes are |
||
51 | * set on this but the child element is not appended onto the parent. This |
||
52 | * is the responsibility of the invoker. Essentially this means that the |
||
53 | * $parent argument is ignored in this case. |
||
54 | * |
||
55 | * @param \DOMElement $parent The parent element to augment. |
||
56 | * @param DescriptorAbstract $element The data source. |
||
57 | * |
||
58 | * @return \DOMElement |
||
59 | */ |
||
60 | 4 | public function convert(\DOMElement $parent, DescriptorAbstract $element) |
|
76 | |||
77 | /** |
||
78 | * Adds the short description of $docblock to the given node as description |
||
79 | * field. |
||
80 | */ |
||
81 | 1 | protected function addSummary(\DOMElement $node, DescriptorAbstract $element) |
|
86 | |||
87 | /** |
||
88 | * Adds the DocBlock's long description to the $child element, |
||
89 | */ |
||
90 | 1 | protected function addDescription(\DOMElement $node, DescriptorAbstract $element) |
|
95 | |||
96 | /** |
||
97 | * Adds each tag to the XML Node representing the DocBlock. |
||
98 | * |
||
99 | * The Descriptor contains an array of tag groups (that are tags grouped by their name), which in itself contains |
||
100 | * an array of the individual tags. |
||
101 | * |
||
102 | * @param DescriptorAbstract $descriptor |
||
103 | */ |
||
104 | 2 | protected function addTags(\DOMElement $docBlock, $descriptor) |
|
116 | |||
117 | /** |
||
118 | * Adds the 'inherited_from' tag when a Descriptor inherits from another Descriptor. |
||
119 | * |
||
120 | * @param DescriptorAbstract $descriptor |
||
121 | */ |
||
122 | 2 | protected function addInheritedFromTag(\DOMElement $docBlock, $descriptor) |
|
139 | } |
||
140 |