Skip to content

Commit

Permalink
Code style updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivopetkov committed Oct 7, 2016
1 parent 976dbec commit 9c0d9c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/HTML5DOMElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ public function __get($name)
return preg_replace('@^<' . $nodeName . '[^>]*>|</' . $nodeName . '>$@', '', $html);
} elseif ($name === 'outerHTML') {
return $this->ownerDocument->saveHTML($this);
} else {
throw new \Exception('Undefined property: HTML5DOMElement::$' . $name);
}
throw new \Exception('Undefined property: HTML5DOMElement::$' . $name);
}

/**
Expand All @@ -59,6 +58,7 @@ public function __set($name, $value)
$node = $this->ownerDocument->importNode($node, true);
$this->appendChild($node);
}
return;
} elseif ($name === 'outerHTML') {
$tmpDoc = new \IvoPetkov\HTML5DOMDocument();
$tmpDoc->loadHTML('<body>' . $value . '</body>');
Expand All @@ -67,9 +67,9 @@ public function __set($name, $value)
$this->parentNode->insertBefore($node, $this);
}
$this->parentNode->removeChild($this);
} else {
throw new \Exception('Undefined property: HTML5DOMElement::$' . $name);
return;
}
throw new \Exception('Undefined property: HTML5DOMElement::$' . $name);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/HTML5DOMNodeList.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ public function __get($name)
{
if ($name === 'length') {
return sizeof($this);
} else {
throw new \Exception('Undefined property: \IvoPetkov\HTML5DOMNodeList::$' . $name);
}
throw new \Exception('Undefined property: \IvoPetkov\HTML5DOMNodeList::$' . $name);
}

}

0 comments on commit 9c0d9c1

Please sign in to comment.