From 9993c39f1a77f2dd1a6b54e5085435cf5fff1fa5 Mon Sep 17 00:00:00 2001 From: Danny van der Sluijs Date: Fri, 13 Sep 2024 14:56:02 +0200 Subject: [PATCH 1/2] fix: remove default value to resolve deprecations notice --- src/JsonSchema/Constraints/Constraint.php | 2 +- src/JsonSchema/Constraints/ObjectConstraint.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/JsonSchema/Constraints/Constraint.php b/src/JsonSchema/Constraints/Constraint.php index bc20e97b..2390bf90 100644 --- a/src/JsonSchema/Constraints/Constraint.php +++ b/src/JsonSchema/Constraints/Constraint.php @@ -40,7 +40,7 @@ abstract class Constraint extends BaseConstraint implements ConstraintInterface * * @return JsonPointer; */ - protected function incrementPath(?JsonPointer $path = null, $i) + protected function incrementPath(?JsonPointer $path, $i) { $path = $path ?: new JsonPointer(''); diff --git a/src/JsonSchema/Constraints/ObjectConstraint.php b/src/JsonSchema/Constraints/ObjectConstraint.php index 36daf77d..5b7d1d00 100644 --- a/src/JsonSchema/Constraints/ObjectConstraint.php +++ b/src/JsonSchema/Constraints/ObjectConstraint.php @@ -52,7 +52,7 @@ public function check(&$element, $schema = null, ?JsonPointer $path = null, $pro $this->validateElement($element, $matches, $schema, $path, $properties, $additionalProp); } - public function validatePatternProperties($element, ?JsonPointer $path = null, $patternProperties) + public function validatePatternProperties($element, ?JsonPointer $path, $patternProperties) { $matches = []; foreach ($patternProperties as $pregex => $schema) { From 759624e0cbadd7957656bcbbc5298554f871f0b1 Mon Sep 17 00:00:00 2001 From: Danny van der Sluijs Date: Fri, 13 Sep 2024 14:57:07 +0200 Subject: [PATCH 2/2] docs: add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31ecc436..93132a7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix pugx badges in README ([#742](https://github.com/jsonrainbow/json-schema/pull/742)) - Add missing property in UriResolverTest ([#743](https://github.com/jsonrainbow/json-schema/pull/743)) - Correct casing of paths used in tests ([#745](https://github.com/jsonrainbow/json-schema/pull/745)) +- Resolve deprecations of optional parameter ([#752](https://github.com/jsonrainbow/json-schema/pull/752)) ### Changed - Bump to minimum PHP 7.2 ([#746](https://github.com/jsonrainbow/json-schema/pull/746))