Skip to content

Commit 30807e3

Browse files
committed
patch for PHP8.0
1 parent 9e756be commit 30807e3

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/Model/SchemaDefinition/JsonSchema.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,18 @@ public function __construct(string $file, array $json)
4848
{
4949
// wrap in an allOf to pass the processing to multiple handlers - ugly hack to be removed after rework
5050
if (isset($json['$ref']) && count(array_diff(array_intersect(array_keys($json), self::SCHEMA_SIGNATURE_RELEVANT_FIELDS), ['$ref', 'type']))) {
51-
$json = [
52-
...array_diff_key($json, array_fill_keys(self::SCHEMA_SIGNATURE_RELEVANT_FIELDS, null)),
53-
'allOf' => [
54-
['$ref' => $json['$ref']],
55-
array_intersect_key(
56-
$json,
57-
array_fill_keys(array_diff(self::SCHEMA_SIGNATURE_RELEVANT_FIELDS, ['$ref']), null),
58-
),
51+
$json = array_merge(
52+
array_diff_key($json, array_fill_keys(self::SCHEMA_SIGNATURE_RELEVANT_FIELDS, null)),
53+
[
54+
'allOf' => [
55+
['$ref' => $json['$ref']],
56+
array_intersect_key(
57+
$json,
58+
array_fill_keys(array_diff(self::SCHEMA_SIGNATURE_RELEVANT_FIELDS, ['$ref']), null),
59+
),
60+
],
5961
],
60-
];
62+
);
6163
}
6264

6365
$this->json = $json;

0 commit comments

Comments
 (0)