diff options
author | Andres Rey <[email protected]> | 2017-11-27 20:49:52 +0000 |
---|---|---|
committer | Andres Rey <[email protected]> | 2017-11-27 20:49:52 +0000 |
commit | 87da0cee01f949b0ff3fe2d0dff53875e11ab3b9 (patch) | |
tree | 1e71a6c76f5fa49c83a2550ea5730a0f6d8380f5 | |
parent | a761d115b6582973df42121140e36a17453d866b (diff) |
Check it attributes is null instead of checking the attribute exists (It always exists)
-rw-r--r-- | src/NodeClass/NodeClassTrait.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/NodeClass/NodeClassTrait.php b/src/NodeClass/NodeClassTrait.php index 985292e..9618d28 100644 --- a/src/NodeClass/NodeClassTrait.php +++ b/src/NodeClass/NodeClassTrait.php @@ -29,7 +29,7 @@ trait NodeClassTrait */ public function getAttribute($attributeName) { - if (property_exists($this, 'attributes')) { + if (!is_null($this->attributes)) { foreach ($this->attributes as $attribute) { if ($attribute->name === $attributeName) { return $attribute->value; |