Skip to content

Commit 708a160

Browse files
bbralaCopilot
andauthored
Update UPGRADE-6.0.md (#823)
Add missing breaking change to upgrade guide Fixes #822 --------- Co-authored-by: Copilot <[email protected]>
1 parent 0f69f0e commit 708a160

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
### Fixed
1010
- Fix objects are non-unique despite key order ([#819](https://github.com/jsonrainbow/json-schema/pull/819))
1111

12+
### Changed
13+
- Added extra breaking change to UPDATE-6.0.md regarding BaseConstraint::addError signature change ([#823](https://github.com/jsonrainbow/json-schema/pull/823)
14+
1215
## [6.4.1] - 2025-04-04
1316
### Fixed
1417
- Fix support for 32bits PHP ([#817](https://github.com/jsonrainbow/json-schema/pull/817))

UPGRADE-6.0.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,22 @@ Thank you for your support and contributions to the project.
2424
foreach ($validator->getErrors() as $error) {
2525
echo $error['constraint']['name']; // required
2626
}
27-
```
27+
```
28+
29+
## BaseConstraint::addError signature changed
30+
31+
* The signature for the `BaseConstraint::AddError` method has changed.
32+
33+
The `$message` parameter has been removed and replaced by the `ConstraintError` parameter.
34+
The `ConstraintError` object encapsulates the error message along with additional information about the constraint violation.
35+
36+
*Before*
37+
```php
38+
public function addError(?JsonPointer $path, $message, $constraint = '', ?array $more = null)
39+
```
40+
41+
*After*
42+
```php
43+
public function addError(ConstraintError $constraint, ?JsonPointer $path = null, array $more = []): void
44+
```
45+

0 commit comments

Comments
 (0)