Skip to content

Commit

Permalink
Merge pull request #4 from revinate/php7.4-compat
Browse files Browse the repository at this point in the history
Fixing ArrayAccess comparison
  • Loading branch information
ccarrillot committed Jun 25, 2020
2 parents a72b9b9 + 9ddb339 commit d4f3f37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/getValueFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function getValue($doc, $fieldName, $default = null) {
return isset($doc[$fieldName]) || array_key_exists($fieldName, $doc) ? $doc[$fieldName] : $default;
}
if ($doc instanceof ArrayAccess) {
return isset($doc[$fieldName]) || property_exists($doc, $fieldName) ? $doc[$fieldName] : $default;
return isset($doc[$fieldName]) || $doc->offsetExists($fieldName) ? $doc[$fieldName] : $default;
}
if (is_object($doc)) {
if (isset($doc->{$fieldName})) {
Expand Down

0 comments on commit d4f3f37

Please sign in to comment.