Skip to content

Commit 24fdf38

Browse files
committed
feature #48671 [Validator] Add getConstraint() method to ConstraintViolationInterface (syl20b)
This PR was squashed before being merged into the 6.3 branch. Discussion ---------- [Validator] Add `getConstraint()` method to `ConstraintViolationInterface` | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes | Deprecations? | yes | Tickets | Fix #48626 | License | MIT | Doc PR | Commits ------- 0118348 [Validator] Add `getConstraint()` method to `ConstraintViolationInterface`
2 parents 20065d2 + 0118348 commit 24fdf38

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

UPGRADE-6.3.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,9 @@ SecurityBundle
5555
--------------
5656

5757
* Deprecate enabling bundle and not configuring it
58+
59+
60+
Validator
61+
--------------
62+
63+
* Implementing the `ConstraintViolationInterface` without implementing the `getConstraint()` method is deprecated

src/Symfony/Component/Validator/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CHANGELOG
44
6.3
55
---
66

7+
* Add method `getConstraint()` to `ConstraintViolationInterface`
78
* Add `Uuid::TIME_BASED_VERSIONS` to match that a UUID being validated embeds a timestamp
89
* Add the `pattern` parameter in violations of the `Regex` constraint
910

src/Symfony/Component/Validator/ConstraintViolationInterface.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@
3131
*
3232
* @author Bernhard Schussek <bschussek@gmail.com>
3333
*
34-
* @method mixed getCause() Returns the cause of the violation. Not implementing it is deprecated since Symfony 6.2.
35-
* @method string __toString() Converts the violation into a string for debugging purposes. Not implementing it is deprecated since Symfony 6.1.
34+
* @method Constraint|null getConstraint() Returns the constraint whose validation caused the violation. Not implementing it is deprecated since Symfony 6.3.
35+
* @method mixed getCause() Returns the cause of the violation. Not implementing it is deprecated since Symfony 6.2.
36+
* @method string __toString() Converts the violation into a string for debugging purposes. Not implementing it is deprecated since Symfony 6.1.
3637
*/
3738
interface ConstraintViolationInterface
3839
{

0 commit comments

Comments
 (0)