Skip to content

Commit

Permalink
PHP 7.2 fix: Considering count returns 1 on empty StdClass object
Browse files Browse the repository at this point in the history
  • Loading branch information
mrwogu committed Jan 27, 2018
1 parent 74ff7a5 commit d6ac9a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Common/JsonSchema/JsonPatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected function handleObject(\stdClass $srcStruct, \stdClass $desStruct, stri

protected function shouldPartiallyReplace(\stdClass $o1, \stdClass $o2): bool
{
return count(array_diff_key((array) $o1, (array) $o2)) < count((array) $o1);
return count(array_diff_key((array) $o1, (array) $o2)) <= count((array) $o1);
}

protected function arrayDiff(array $a1, array $a2): array
Expand Down

0 comments on commit d6ac9a5

Please sign in to comment.