From 65ab0fa253b4c1ba454a4d36847ef923ba08c08f Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 2 Nov 2017 16:27:01 +0100 Subject: fix FTBFS from Koschei, add patch for PHP 7.2 from https://github.com/mikemccabe/json-patch-php/pull/17 --- 17.patch | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 17.patch (limited to '17.patch') diff --git a/17.patch b/17.patch new file mode 100644 index 0000000..d60dbef --- /dev/null +++ b/17.patch @@ -0,0 +1,23 @@ +From 84ef9af3c437cf173afe2a5f7c0f9ce1b17529d4 Mon Sep 17 00:00:00 2001 +From: Remi Collet +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); -- cgit