Skip to content

Commit 33ca508

Browse files
committed
Bugfix: consider null namespace
1 parent 7ca1b3e commit 33ca508

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/XML/Registry/ElementRegistry.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function registerElementHandler(string $class): void
7474
$className = AbstractElement::getClassName($class);
7575
$namespace = $class::NS;
7676

77-
$this->registry[$namespace][$className] = $class;
77+
$this->registry[$namespace ?? ''][$className] = $class;
7878
}
7979

8080

@@ -95,6 +95,6 @@ public function getElementHandler(?string $namespace, string $element): ?string
9595
Assert::nullOrValidURI($namespace, InvalidDOMElementException::class);
9696
Assert::validNCName($element, InvalidDOMElementException::class);
9797

98-
return $this->registry[$namespace][$element] ?? null;
98+
return $this->registry[$namespace ?? ''][$element] ?? null;
9999
}
100100
}

0 commit comments

Comments
 (0)