From 4af8d1ae30a0a91d2dc19c0d140a041adc86eee7 Mon Sep 17 00:00:00 2001 From: Blazej456 Date: Thu, 7 Sep 2017 13:18:00 +0200 Subject: [PATCH] Update JsonValueMatchesSchema A stdClass type declaration in forceToObject function dissallow to decode JSON whitch starts with array --- src/Constraint/JsonValueMatchesSchema.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Constraint/JsonValueMatchesSchema.php b/src/Constraint/JsonValueMatchesSchema.php index c1d28ef..299184c 100644 --- a/src/Constraint/JsonValueMatchesSchema.php +++ b/src/Constraint/JsonValueMatchesSchema.php @@ -30,14 +30,14 @@ public function __construct($schema) } /** - * VERY dirty hack to force a JSON document into an instance of the stdClass class. + * VERY dirty hack to force a JSON document into an object. * * Yell if you can think of something better. * * @param array|stdClass $jsonDocument * @return stdClass */ - private function forceToObject($jsonDocument): stdClass + private function forceToObject($jsonDocument) { if (is_string($jsonDocument)) { return json_decode($jsonDocument);