blob: d60dbef79979f77f74191aa143b12a9b8a9f122f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
From 84ef9af3c437cf173afe2a5f7c0f9ce1b17529d4 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Thu, 2 Nov 2017 16:18:43 +0100
Subject: [PATCH] Fix count(): Parameter must be an array or an object that
implements Countable ...
---
src/JsonPatch.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/JsonPatch.php b/src/JsonPatch.php
index d180e5a..f77192c 100644
--- a/src/JsonPatch.php
+++ b/src/JsonPatch.php
@@ -261,7 +261,7 @@ private static function is_index($part)
private static function diff_values($path, $value, $other)
{
// manually handle the {}-looks-like-[] case, when other is associative
- if ((count($value) == 0 || count($other) == 0)
+ if ((!$value || !$other)
&& (self::is_associative($value) || self::is_associative($other)))
{
return self::diff_assoc($path, $value, $other);
|