Skip to content

Commit 0306c65

Browse files
Matt3o12baseciq
authored andcommitted
Fix null value assignment for tag attributes in getAttributes method
1 parent 2edf438 commit 0306c65

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PHPHtmlParser/Dom/Tag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,13 @@ public function makeOpeningTag()
326326
foreach (\array_keys($this->attr) as $key) {
327327
try {
328328
$attributeDTO = $this->getAttribute($key);
329+
$val = $attributeDTO->getValue();
329330
} catch (AttributeNotFoundException $e) {
330331
// attribute that was in the array not found in the array... let's continue.
331332
continue;
332333
} catch (\TypeError $e) {
333-
$val = null;
334+
$val = null;
334335
}
335-
$val = $attributeDTO->getValue();
336336
if (\is_null($val)) {
337337
$return .= ' ' . $key;
338338
} elseif ($attributeDTO->isDoubleQuote()) {

0 commit comments

Comments
 (0)