Skip to content

Commit 3e43e52

Browse files
committed
ObjectFunctions::getPropertyValue(). Access to non-existent properties.
1 parent 9cd63a9 commit 3e43e52

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/WS/Utils/Collections/Functions/ObjectFunctions.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ public static function getPropertyValue($object, string $fieldName)
2323
return $object->{$fieldName};
2424
}
2525

26+
if (isset($object->{$fieldName})) {
27+
return $object->{$fieldName};
28+
}
29+
2630
if (method_exists($object, $fieldName)) {
2731
return $object->{$fieldName}();
2832
}

0 commit comments

Comments
 (0)