Skip to content

Commit 9fd2b6f

Browse files
committed
code review
1 parent 52b3042 commit 9fd2b6f

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

src/AbstractAttributeHandler.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ class AbstractAttributeHandler extends AbstractNodeHandler
3737

3838
const DEFAULT_OCCURRENCE_VALUE = 1;
3939

40-
public function getNode(): DOMAttr
41-
{
42-
return parent::getNode();
43-
}
44-
4540
public function getAttribute(): DOMAttr
4641
{
4742
return $this->getNode();

src/AbstractElementHandler.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ public function __construct(DOMElement $element, AbstractDomDocumentHandler $dom
1313
parent::__construct($element, $domDocument, $index);
1414
}
1515

16-
public function getNode(): DOMElement
17-
{
18-
return parent::getNode();
19-
}
20-
2116
public function getElement(): DOMElement
2217
{
2318
return $this->getNode();

src/AbstractNodeHandler.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,12 @@ public function getChildren(): array
9292
return $this->getHandlers($this->getNode()->childNodes);
9393
}
9494

95-
private function getHandlers(Traversable $nodes): array
95+
private function getHandlers(?Traversable $nodes): array
9696
{
97+
if (is_null($nodes)) {
98+
return [];
99+
}
100+
97101
$handlers = array();
98102
foreach ($nodes as $index => $node) {
99103
if (!is_int($index)) {

src/DomDocumentHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected function getAttributeHandler(DOMAttr $attribute, AbstractDomDocumentHa
2525
return new AttributeHandler($attribute, $domDocument, $index);
2626
}
2727

28-
public function getRootElement(): ElementHandler
28+
public function getRootElement(): ?ElementHandler
2929
{
3030
return $this->rootElement;
3131
}

0 commit comments

Comments
 (0)