Skip to content

Commit 63398f3

Browse files
committed
:octocat: PrototypeElement::tag() - return null if $this::$tagName doesn't exist
1 parent e5c313c commit 63398f3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Node/PrototypeElement.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function insert_top(PrototypeElement $node):PrototypeElement;
6565
public function insert_bottom(PrototypeElement $node):PrototypeElement;
6666

6767
/**
68-
* Returns the element tag name (convenience method)
68+
* Returns the element tag name (convenience method) or null if the property doesn't exist
6969
*/
70-
public function tag():string;
70+
public function tag():?string;
7171
}

src/Node/PrototypeElementTrait.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function insert_bottom(PrototypeElement $node):PrototypeElement{
119119
/**
120120
* @inheritDoc
121121
*/
122-
public function tag():string{
123-
return $this->tagName;
122+
public function tag():?string{
123+
return $this->tagName ?? null;
124124
}
125125
}

0 commit comments

Comments
 (0)