summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2017-11-27 20:49:52 +0000
committerAndres Rey <[email protected]>2017-11-27 20:49:52 +0000
commit87da0cee01f949b0ff3fe2d0dff53875e11ab3b9 (patch)
tree1e71a6c76f5fa49c83a2550ea5730a0f6d8380f5 /src
parenta761d115b6582973df42121140e36a17453d866b (diff)
Check it attributes is null instead of checking the attribute exists (It always exists)
Diffstat (limited to 'src')
-rw-r--r--src/NodeClass/NodeClassTrait.php2
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;