Skip to content

Commit f837c8e

Browse files
committed
Fixed: Count returns 1 on StdClass object
1 parent fbddef5 commit f837c8e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Common/JsonSchema/JsonPatch.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ protected function handleObject(\stdClass $srcStruct, \stdClass $desStruct, stri
7878

7979
protected function shouldPartiallyReplace(\stdClass $o1, \stdClass $o2): bool
8080
{
81-
return count(array_diff_key((array) $o1, (array) $o2)) < count($o1);
81+
// NOTE: count(stdClass) always returns 1
82+
return count(array_diff_key((array) $o1, (array) $o2)) < 1;
8283
}
8384

8485
protected function arrayDiff(array $a1, array $a2): array

0 commit comments

Comments
 (0)