Skip to content

Commit

Permalink
Fixed: Count returns 1 on StdClass object
Browse files Browse the repository at this point in the history
  • Loading branch information
mrwogu committed Jan 28, 2018
1 parent 3d6d813 commit 0a44efa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Common/JsonSchema/JsonPatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ 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($o1);
// NOTE: count(stdClass) always returns 1
return count(array_diff_key((array) $o1, (array) $o2)) < 1;
}

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

0 comments on commit 0a44efa

Please sign in to comment.