Skip to content

Commit

Permalink
WiP
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Dec 31, 2023
1 parent a06ac55 commit 1d15d7e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/NodeComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static function isEqualNode(?DOMNode $node, ?DOMNode $otherNode): bool
}
if ($node instanceof DOMElement && $otherNode instanceof DOMElement)
{
return self::isEqualElementNode($node, $otherNode);
return static::isEqualElementNode($node, $otherNode);
}
if ($node instanceof DOMCharacterData && $otherNode instanceof DOMCharacterData)
{
Expand All @@ -53,7 +53,7 @@ public static function isEqualNode(?DOMNode $node, ?DOMNode $otherNode): bool
if (($node instanceof DOMDocument && $otherNode instanceof DOMDocument)
|| ($node instanceof DOMDocumentFragment && $otherNode instanceof DOMDocumentFragment))
{
return self::isEqualNodeList($node->childNodes, $otherNode->childNodes);
return static::isEqualNodeList($node->childNodes, $otherNode->childNodes);
}
if ($node instanceof DOMDocumentType && $otherNode instanceof DOMDocumentType)
{
Expand Down Expand Up @@ -98,7 +98,7 @@ protected static function getNamespaceDeclarations(DOMElement $element): array

protected static function hasEqualNamespaceDeclarations(DOMElement $element, DOMElement $otherElement): bool
{
return self::getNamespaceDeclarations($element) == self::getNamespaceDeclarations($otherElement);
return static::getNamespaceDeclarations($element) == static::getNamespaceDeclarations($otherElement);
}

protected static function isEqualElementNode(DOMElement $element, DOMElement $otherElement): bool
Expand All @@ -119,8 +119,8 @@ protected static function isEqualElementNode(DOMElement $element, DOMElement $ot
}
}

return self::isEqualNodeList($element->childNodes, $otherElement->childNodes)
&& self::hasEqualNamespaceDeclarations($element, $otherElement);
return static::isEqualNodeList($element->childNodes, $otherElement->childNodes)
&& static::hasEqualNamespaceDeclarations($element, $otherElement);
}

protected static function isEqualNodeList(DOMNodeList $list, DOMNodeList $otherList): bool
Expand All @@ -131,7 +131,7 @@ protected static function isEqualNodeList(DOMNodeList $list, DOMNodeList $otherL
}
foreach ($list as $i => $node)
{
if (!self::isEqualNode($node, $otherList->item($i)))
if (!static::isEqualNode($node, $otherList->item($i)))
{
return false;
}
Expand Down

0 comments on commit 1d15d7e

Please sign in to comment.