Skip to content

Commit 18a7986

Browse files
authored
Merge pull request #1986 from nextcloud/update-justinrainbow/json-schema
update justinrainbow/json-schema to 5.3.0
2 parents 14f8529 + b9f21c1 commit 18a7986

18 files changed

+50
-60
lines changed

composer.lock

Lines changed: 7 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer/installed.json

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,37 +1626,32 @@
16261626
},
16271627
{
16281628
"name": "justinrainbow/json-schema",
1629-
"version": "v5.2.13",
1630-
"version_normalized": "5.2.13.0",
1629+
"version": "5.3.0",
1630+
"version_normalized": "5.3.0.0",
16311631
"source": {
16321632
"type": "git",
16331633
"url": "https://github.com/jsonrainbow/json-schema.git",
1634-
"reference": "fbbe7e5d79f618997bc3332a6f49246036c45793"
1634+
"reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8"
16351635
},
16361636
"dist": {
16371637
"type": "zip",
1638-
"url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793",
1639-
"reference": "fbbe7e5d79f618997bc3332a6f49246036c45793",
1638+
"url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8",
1639+
"reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8",
16401640
"shasum": ""
16411641
},
16421642
"require": {
1643-
"php": ">=5.3.3"
1643+
"php": ">=7.1"
16441644
},
16451645
"require-dev": {
16461646
"friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1",
16471647
"json-schema/json-schema-test-suite": "1.2.0",
16481648
"phpunit/phpunit": "^4.8.35"
16491649
},
1650-
"time": "2023-09-26T02:20:38+00:00",
1650+
"time": "2024-07-06T21:00:26+00:00",
16511651
"bin": [
16521652
"bin/validate-json"
16531653
],
16541654
"type": "library",
1655-
"extra": {
1656-
"branch-alias": {
1657-
"dev-master": "5.0.x-dev"
1658-
}
1659-
},
16601655
"installation-source": "dist",
16611656
"autoload": {
16621657
"psr-4": {
@@ -1693,7 +1688,7 @@
16931688
],
16941689
"support": {
16951690
"issues": "https://github.com/jsonrainbow/json-schema/issues",
1696-
"source": "https://github.com/jsonrainbow/json-schema/tree/v5.2.13"
1691+
"source": "https://github.com/jsonrainbow/json-schema/tree/5.3.0"
16971692
},
16981693
"install-path": "../justinrainbow/json-schema"
16991694
},

composer/installed.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@
200200
'dev_requirement' => false,
201201
),
202202
'justinrainbow/json-schema' => array(
203-
'pretty_version' => 'v5.2.13',
204-
'version' => '5.2.13.0',
205-
'reference' => 'fbbe7e5d79f618997bc3332a6f49246036c45793',
203+
'pretty_version' => '5.3.0',
204+
'version' => '5.3.0.0',
205+
'reference' => 'feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8',
206206
'type' => 'library',
207207
'install_path' => __DIR__ . '/../justinrainbow/json-schema',
208208
'aliases' => array(),

justinrainbow/json-schema/src/JsonSchema/Constraints/BaseConstraint.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ class BaseConstraint
3838
/**
3939
* @param Factory $factory
4040
*/
41-
public function __construct(Factory $factory = null)
41+
public function __construct(?Factory $factory = null)
4242
{
4343
$this->factory = $factory ?: new Factory();
4444
}
4545

46-
public function addError(JsonPointer $path = null, $message, $constraint = '', array $more = null)
46+
public function addError(?JsonPointer $path, $message, $constraint = '', ?array $more = null)
4747
{
4848
$error = array(
4949
'property' => $this->convertJsonPointerIntoPropertyPath($path ?: new JsonPointer('')),

justinrainbow/json-schema/src/JsonSchema/Constraints/CollectionConstraint.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CollectionConstraint extends Constraint
2222
/**
2323
* {@inheritdoc}
2424
*/
25-
public function check(&$value, $schema = null, JsonPointer $path = null, $i = null)
25+
public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = null)
2626
{
2727
// Verify minItems
2828
if (isset($schema->minItems) && count($value) < $schema->minItems) {
@@ -61,7 +61,7 @@ public function check(&$value, $schema = null, JsonPointer $path = null, $i = nu
6161
* @param JsonPointer|null $path
6262
* @param string $i
6363
*/
64-
protected function validateItems(&$value, $schema = null, JsonPointer $path = null, $i = null)
64+
protected function validateItems(&$value, $schema = null, ?JsonPointer $path = null, $i = null)
6565
{
6666
if (is_object($schema->items)) {
6767
// just one type definition for the whole array

justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ abstract class Constraint extends BaseConstraint implements ConstraintInterface
3939
*
4040
* @return JsonPointer;
4141
*/
42-
protected function incrementPath(JsonPointer $path = null, $i)
42+
protected function incrementPath(?JsonPointer $path, $i)
4343
{
4444
$path = $path ?: new JsonPointer('');
4545

@@ -65,7 +65,7 @@ protected function incrementPath(JsonPointer $path = null, $i)
6565
* @param JsonPointer|null $path
6666
* @param mixed $i
6767
*/
68-
protected function checkArray(&$value, $schema = null, JsonPointer $path = null, $i = null)
68+
protected function checkArray(&$value, $schema = null, ?JsonPointer $path = null, $i = null)
6969
{
7070
$validator = $this->factory->createInstanceFor('collection');
7171
$validator->check($value, $schema, $path, $i);
@@ -83,7 +83,7 @@ protected function checkArray(&$value, $schema = null, JsonPointer $path = null,
8383
* @param mixed $additionalProperties
8484
* @param mixed $patternProperties
8585
*/
86-
protected function checkObject(&$value, $schema = null, JsonPointer $path = null, $properties = null,
86+
protected function checkObject(&$value, $schema = null, ?JsonPointer $path = null, $properties = null,
8787
$additionalProperties = null, $patternProperties = null, $appliedDefaults = array())
8888
{
8989
$validator = $this->factory->createInstanceFor('object');
@@ -100,7 +100,7 @@ protected function checkObject(&$value, $schema = null, JsonPointer $path = null
100100
* @param JsonPointer|null $path
101101
* @param mixed $i
102102
*/
103-
protected function checkType(&$value, $schema = null, JsonPointer $path = null, $i = null)
103+
protected function checkType(&$value, $schema = null, ?JsonPointer $path = null, $i = null)
104104
{
105105
$validator = $this->factory->createInstanceFor('type');
106106
$validator->check($value, $schema, $path, $i);
@@ -116,7 +116,7 @@ protected function checkType(&$value, $schema = null, JsonPointer $path = null,
116116
* @param JsonPointer|null $path
117117
* @param mixed $i
118118
*/
119-
protected function checkUndefined(&$value, $schema = null, JsonPointer $path = null, $i = null, $fromDefault = false)
119+
protected function checkUndefined(&$value, $schema = null, ?JsonPointer $path = null, $i = null, $fromDefault = false)
120120
{
121121
$validator = $this->factory->createInstanceFor('undefined');
122122

@@ -133,7 +133,7 @@ protected function checkUndefined(&$value, $schema = null, JsonPointer $path = n
133133
* @param JsonPointer|null $path
134134
* @param mixed $i
135135
*/
136-
protected function checkString($value, $schema = null, JsonPointer $path = null, $i = null)
136+
protected function checkString($value, $schema = null, ?JsonPointer $path = null, $i = null)
137137
{
138138
$validator = $this->factory->createInstanceFor('string');
139139
$validator->check($value, $schema, $path, $i);
@@ -149,7 +149,7 @@ protected function checkString($value, $schema = null, JsonPointer $path = null,
149149
* @param JsonPointer $path
150150
* @param mixed $i
151151
*/
152-
protected function checkNumber($value, $schema = null, JsonPointer $path = null, $i = null)
152+
protected function checkNumber($value, $schema = null, ?JsonPointer $path = null, $i = null)
153153
{
154154
$validator = $this->factory->createInstanceFor('number');
155155
$validator->check($value, $schema, $path, $i);
@@ -165,7 +165,7 @@ protected function checkNumber($value, $schema = null, JsonPointer $path = null,
165165
* @param JsonPointer|null $path
166166
* @param mixed $i
167167
*/
168-
protected function checkEnum($value, $schema = null, JsonPointer $path = null, $i = null)
168+
protected function checkEnum($value, $schema = null, ?JsonPointer $path = null, $i = null)
169169
{
170170
$validator = $this->factory->createInstanceFor('enum');
171171
$validator->check($value, $schema, $path, $i);
@@ -181,7 +181,7 @@ protected function checkEnum($value, $schema = null, JsonPointer $path = null, $
181181
* @param JsonPointer|null $path
182182
* @param mixed $i
183183
*/
184-
protected function checkFormat($value, $schema = null, JsonPointer $path = null, $i = null)
184+
protected function checkFormat($value, $schema = null, ?JsonPointer $path = null, $i = null)
185185
{
186186
$validator = $this->factory->createInstanceFor('format');
187187
$validator->check($value, $schema, $path, $i);

justinrainbow/json-schema/src/JsonSchema/Constraints/ConstraintInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function addErrors(array $errors);
4040
* @param string $constraint the constraint/rule that is broken, e.g.: 'minLength'
4141
* @param array $more more array elements to add to the error
4242
*/
43-
public function addError(JsonPointer $path = null, $message, $constraint='', array $more = null);
43+
public function addError(?JsonPointer $path, $message, $constraint='', ?array $more = null);
4444

4545
/**
4646
* checks if the validator has not raised errors
@@ -61,5 +61,5 @@ public function isValid();
6161
*
6262
* @throws \JsonSchema\Exception\ExceptionInterface
6363
*/
64-
public function check(&$value, $schema = null, JsonPointer $path = null, $i = null);
64+
public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = null);
6565
}

justinrainbow/json-schema/src/JsonSchema/Constraints/EnumConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class EnumConstraint extends Constraint
2222
/**
2323
* {@inheritdoc}
2424
*/
25-
public function check(&$element, $schema = null, JsonPointer $path = null, $i = null)
25+
public function check(&$element, $schema = null, ?JsonPointer $path = null, $i = null)
2626
{
2727
// Only validate enum if the attribute exists
2828
if ($element instanceof UndefinedConstraint && (!isset($schema->required) || !$schema->required)) {

justinrainbow/json-schema/src/JsonSchema/Constraints/Factory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ class Factory
7474
* @param int $checkMode
7575
*/
7676
public function __construct(
77-
SchemaStorageInterface $schemaStorage = null,
78-
UriRetrieverInterface $uriRetriever = null,
77+
?SchemaStorageInterface $schemaStorage = null,
78+
?UriRetrieverInterface $uriRetriever = null,
7979
$checkMode = Constraint::CHECK_MODE_NORMAL
8080
) {
8181
// set provided config options

justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class FormatConstraint extends Constraint
2424
/**
2525
* {@inheritdoc}
2626
*/
27-
public function check(&$element, $schema = null, JsonPointer $path = null, $i = null)
27+
public function check(&$element, $schema = null, ?JsonPointer $path = null, $i = null)
2828
{
2929
if (!isset($schema->format) || $this->factory->getConfig(self::CHECK_MODE_DISABLE_FORMAT)) {
3030
return;

0 commit comments

Comments
 (0)