diff options
Diffstat (limited to 'src/Nodes/NodeTrait.php')
-rw-r--r-- | src/Nodes/NodeTrait.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Nodes/NodeTrait.php b/src/Nodes/NodeTrait.php index 9f878ce..b4ca746 100644 --- a/src/Nodes/NodeTrait.php +++ b/src/Nodes/NodeTrait.php @@ -164,6 +164,24 @@ trait NodeTrait } /** + * Override for native hasAttribute + * + * @see getAttribute + * + * @param $attributeName + * + * @return bool + */ + public function hasAttribute($attributeName) + { + if (!is_null($this->attributes)) { + return parent::hasAttribute($attributeName); + } + + return false; + } + + /** * Get the ancestors of the current node. * * @param int|bool $maxLevel Max amount of ancestors to get. False for all of them |