Skip to content

Commit 4af8d1a

Browse files
authored
Update JsonValueMatchesSchema
A stdClass type declaration in forceToObject function dissallow to decode JSON whitch starts with array
1 parent d977ebc commit 4af8d1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Constraint/JsonValueMatchesSchema.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ public function __construct($schema)
3030
}
3131

3232
/**
33-
* VERY dirty hack to force a JSON document into an instance of the stdClass class.
33+
* VERY dirty hack to force a JSON document into an object.
3434
*
3535
* Yell if you can think of something better.
3636
*
3737
* @param array|stdClass $jsonDocument
3838
* @return stdClass
3939
*/
40-
private function forceToObject($jsonDocument): stdClass
40+
private function forceToObject($jsonDocument)
4141
{
4242
if (is_string($jsonDocument)) {
4343
return json_decode($jsonDocument);

0 commit comments

Comments
 (0)