Skip to content

Commit

Permalink
Fix "Undefined property: DOMText::$tagName"
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Apr 5, 2020
1 parent 2101071 commit faf9fa3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/php/unittest/web/SelectField.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function getValue() {

// Find selected
foreach ($this->node->childNodes as $child) {
if ('option' != $child->tagName || !$child->hasAttribute('selected')) continue;
if (!($child instanceof \DOMElement) || 'option' !== $child->tagName || !$child->hasAttribute('selected')) continue;
return $child->getAttribute('value');
}

Expand All @@ -34,7 +34,7 @@ public function getValue() {
public function getOptions() {
$r= [];
foreach ($this->node->childNodes as $child) {
if ('option' != $child->tagName) continue;
if (!($child instanceof \DOMElement) || 'option' !== $child->tagName) continue;
$r[]= new SelectOption($this->form, $child);
}
return $r;
Expand All @@ -48,7 +48,7 @@ public function getOptions() {
public function getSelectedOptions() {
$r= [];
foreach ($this->node->childNodes as $child) {
if ('option' != $child->tagName || !$child->hasAttribute('selected')) continue;
if (!($child instanceof \DOMElement) || 'option' !== $child->tagName || !$child->hasAttribute('selected')) continue;
$r[]= new SelectOption($this->form, $child);
}
return $r;
Expand Down

0 comments on commit faf9fa3

Please sign in to comment.