Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion UPGRADE-6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,22 @@ Thank you for your support and contributions to the project.
foreach ($validator->getErrors() as $error) {
echo $error['constraint']['name']; // required
}
```
```

## BaseConstraint::addError signature changed

* 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
public function addError(?JsonPointer $path, $message, $constraint = '', ?array $more = null)
```

*After*
```php
public function addError(ConstraintError $constraint, ?JsonPointer $path = null, array $more = []): void
```