diff options
author | Andres Rey <[email protected]> | 2016-10-18 16:13:19 +0000 |
---|---|---|
committer | StyleCI Bot <[email protected]> | 2016-10-18 16:13:19 +0000 |
commit | ee754d5a7b184fb66ad57b660fdcbdf691f29bce (patch) | |
tree | 97ac8dccd32a69054a9c5f937afdc02ef3723dc4 /src/DOMElement.php | |
parent | d75e04143ccd1d68a0e02bc074aec28fc0d67806 (diff) |
Applied fixes from StyleCI
Diffstat (limited to 'src/DOMElement.php')
-rw-r--r-- | src/DOMElement.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/DOMElement.php b/src/DOMElement.php index 728aa65..8e7456d 100644 --- a/src/DOMElement.php +++ b/src/DOMElement.php @@ -5,14 +5,11 @@ namespace andreskrey\Readability; use League\HTMLToMarkdown\Element; /** - * Class DOMElement + * Class DOMElement. * * This is a extension of the original Element class from League\HTMLToMarkdown\Element. * This class adds functions specific to Readability.php and overloads some of them to fit the purpose of this project. - * - * @package andreskrey\Readability */ - class DOMElement extends Element implements DOMElementInterface { /** @@ -21,7 +18,7 @@ class DOMElement extends Element implements DOMElementInterface protected $node; /** - * Constructor + * Constructor. * * @param \DOMNode $node Selected element from DOMDocument */ @@ -73,6 +70,7 @@ class DOMElement extends Element implements DOMElementInterface * Get the ancestors of the current node. * * @param int $maxLevel Max amount of ancestors to get. + * * @return array */ public function getNodeAncestors($maxLevel = 3) @@ -103,7 +101,7 @@ class DOMElement extends Element implements DOMElementInterface public function getParent() { $node = $this->node->parentNode; + return ($node) ? new static($node) : null; } - } |