@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * 'icon' => boolean determining if the icons must be displayed or not, |
71 | 71 | * ]. The first two are mandatory. |
72 | 72 | * |
73 | - * @return DOMDocument $domDocument : The DOMDocument instance created with the HTML. |
|
73 | + * @return \DOMElement $domDocument : The DOMDocument instance created with the HTML. |
|
74 | 74 | */ |
75 | 75 | private function buildHTMLTreeFromNode(DOMDocument $document, Node $node, array $options) { |
76 | 76 | $domElementA = $this->buildElement($document, $options[HTML_CONVERTER_MAIN_TAG_KEY][0]); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @param DOMDocument $document : The current DOMDocument in creation with the HTML tree. |
118 | 118 | * @param array $description : The array describing the tag to create. |
119 | 119 | * |
120 | - * @return DOMElement $domElement : The created DOMElement. |
|
120 | + * @return \DOMElement $domElement : The created DOMElement. |
|
121 | 121 | */ |
122 | 122 | private function buildElement(DOMDocument $document, array $description) { |
123 | 123 | $domElement = $document->createElement($description[HTML_CONVERTER_TAG_KEY]); |
@@ -97,8 +97,7 @@ |
||
97 | 97 | $domElementC = $this->buildElement($document, $options[HTML_CONVERTER_MAIN_TAG_KEY][2]); |
98 | 98 | $domElementC->appendChild($text); |
99 | 99 | $domElementB->appendChild($domElementC); |
100 | - } |
|
101 | - else { |
|
100 | + } else { |
|
102 | 101 | $domElementB->appendChild($text); |
103 | 102 | } |
104 | 103 |
@@ -38,7 +38,6 @@ |
||
38 | 38 | /** |
39 | 39 | * Abstract class to actually perform the conversion from the Document instance passed in parameter. |
40 | 40 | * |
41 | - * @param mixed $data : The data to convert. Here : a string as the file path or the Document instance. |
|
42 | 41 | * @param array $options : An array of options for the conversion. |
43 | 42 | * |
44 | 43 | * @return mixed : The result of the conversion. |
@@ -22,8 +22,7 @@ |
||
22 | 22 | public function convert($data, $options = []) { |
23 | 23 | if(!is_string($data) && !($data instanceof Document)) { |
24 | 24 | throw new InvalidArgumentException('The $data variable must be of type "string" (the file path), or an instance of "Document".'); |
25 | - } |
|
26 | - elseif(!is_array($options)) { |
|
25 | + } elseif(!is_array($options)) { |
|
27 | 26 | throw new InvalidArgumentException('The $options variable must be and array.'); |
28 | 27 | } |
29 | 28 |
@@ -118,7 +118,7 @@ |
||
118 | 118 | /** |
119 | 119 | * For each attribute whom the name is the keys of $availableAttributes, its value will be put in the matching attribute. |
120 | 120 | * |
121 | - * @param DOMNamedNodeMap $nodeAttributes : The list of attributes of the current node to fill the Node object. |
|
121 | + * @param DOMNamedNodeMap $nodeAtributes : The list of attributes of the current node to fill the Node object. |
|
122 | 122 | * @param array $availableAttributes : One of the static array of this class to describe the list of known attributes. |
123 | 123 | * @param Node $node : The Node object to fill in. |
124 | 124 | */ |
@@ -97,11 +97,9 @@ |
||
97 | 97 | foreach($domNode->childNodes as $childNode) { |
98 | 98 | if($childNode->nodeName === self::NODE_NODENAME) { |
99 | 99 | $children->add($this->fillNode($childNode)); |
100 | - } |
|
101 | - elseif($childNode->nodeName === self::FONT_NODENAME) { |
|
100 | + } elseif($childNode->nodeName === self::FONT_NODENAME) { |
|
102 | 101 | $this->fillNodeAttributes($childNode->attributes, self::$fontAvailableAttributes, $node); |
103 | - } |
|
104 | - elseif($childNode->nodeName === self::ICON_NODENAME) { |
|
102 | + } elseif($childNode->nodeName === self::ICON_NODENAME) { |
|
105 | 103 | foreach($childNode->attributes as $attribute) { |
106 | 104 | if(array_key_exists($attribute->nodeName, self::$iconAvailableAttributes)) { |
107 | 105 | $node->setIcon(new Icon($attribute->nodeValue)); |
@@ -363,11 +363,9 @@ |
||
363 | 363 | $newValue[] = $node->toArray(); |
364 | 364 | } |
365 | 365 | $value = $newValue; |
366 | - } |
|
367 | - elseif($value instanceof Icon) { |
|
366 | + } elseif($value instanceof Icon) { |
|
368 | 367 | $value = $value->getFilePath(); |
369 | - } |
|
370 | - elseif($value instanceof DOMElement) { |
|
368 | + } elseif($value instanceof DOMElement) { |
|
371 | 369 | return; |
372 | 370 | } |
373 | 371 | $array[$key] = $value; |
@@ -352,7 +352,6 @@ |
||
352 | 352 | /** |
353 | 353 | * Return the list of children of the current node. |
354 | 354 | * |
355 | - * @param NodeList $children : The list of children node. |
|
356 | 355 | */ |
357 | 356 | public function getChildren() { |
358 | 357 | return $this->children; |
@@ -150,8 +150,7 @@ |
||
150 | 150 | $sorter = function($value, $key) use(&$array) { |
151 | 151 | if($value instanceof Node) { |
152 | 152 | $value = $value->toArray(); |
153 | - } |
|
154 | - elseif($value instanceof DOMDocument) { |
|
153 | + } elseif($value instanceof DOMDocument) { |
|
155 | 154 | return; |
156 | 155 | } |
157 | 156 | $array[$key] = $value; |