From 30227e2770438d2ceefbae2b52f713c7826b0718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Brala?= Date: Fri, 2 May 2025 16:16:19 +0200 Subject: [PATCH 1/4] Update UPGRADE-6.0.md Add missing breaking change to upgrade guide --- UPGRADE-6.0.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/UPGRADE-6.0.md b/UPGRADE-6.0.md index cdaa36dd..1cc1ec46 100644 --- a/UPGRADE-6.0.md +++ b/UPGRADE-6.0.md @@ -24,4 +24,20 @@ Thank you for your support and contributions to the project. foreach ($validator->getErrors() as $error) { echo $error['constraint']['name']; // required } - ``` \ No newline at end of file + ``` + +## BaseConstraint::addError signature changed + +* The signature for the `BaseContraint::AddError` method has changed. + + + *Before* + ```php + public function addError(?JsonPointer $path, $message, $constraint = '', ?array $more = null) + ``` + + *After* + ```php + public function addError(ConstraintError $constraint, ?JsonPointer $path = null, array $more = []): void + ``` + From c7407db14e8886adef9229ebae1ce8812dcc3ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Brala?= Date: Fri, 2 May 2025 17:17:11 +0200 Subject: [PATCH 2/4] Update UPGRADE-6.0.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- UPGRADE-6.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPGRADE-6.0.md b/UPGRADE-6.0.md index 1cc1ec46..19cb696b 100644 --- a/UPGRADE-6.0.md +++ b/UPGRADE-6.0.md @@ -28,7 +28,7 @@ Thank you for your support and contributions to the project. ## BaseConstraint::addError signature changed -* The signature for the `BaseContraint::AddError` method has changed. +* The signature for the `BaseConstraint::AddError` method has changed. *Before* From a01b8e8aa1f6440db2b9131fad698e08eca97325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Brala?= Date: Fri, 2 May 2025 17:17:33 +0200 Subject: [PATCH 3/4] Update UPGRADE-6.0.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- UPGRADE-6.0.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UPGRADE-6.0.md b/UPGRADE-6.0.md index 19cb696b..f861ee17 100644 --- a/UPGRADE-6.0.md +++ b/UPGRADE-6.0.md @@ -30,6 +30,8 @@ Thank you for your support and contributions to the project. * The signature for the `BaseConstraint::AddError` method has changed. + The `$message` parameter has been removed and replaced by the `ConstraintError` parameter. + The `ConstraintError` object encapsulates the error message along with additional information about the constraint violation. *Before* ```php From 6bd53d5d5c6be50a405de4506907d418f718acfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Brala?= Date: Mon, 5 May 2025 09:02:27 +0200 Subject: [PATCH 4/4] docs: add change to changelog.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73ea7e03..a6e05a9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fix objects are non-unique despite key order ([#819](https://github.com/jsonrainbow/json-schema/pull/819)) +### Changed +- Added extra breaking change to UPDATE-6.0.md regarding BaseConstraint::addError signature change ([#823](https://github.com/jsonrainbow/json-schema/pull/823) + ## [6.4.1] - 2025-04-04 ### Fixed - Fix support for 32bits PHP ([#817](https://github.com/jsonrainbow/json-schema/pull/817))