Skip to content

Commit 39ee02f

Browse files
Remove BC layers related to new methods and new parameters
1 parent c4e22fa commit 39ee02f

File tree

4 files changed

+32
-8
lines changed

4 files changed

+32
-8
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
CHANGELOG
22
=========
33

4+
7.0
5+
---
6+
7+
* Add methods `getConstraint()`, `getCause()` and `__toString()` to `ConstraintViolationInterface`
8+
* Add method `__toString()` to `ConstraintViolationListInterface`
9+
* Add method `disableTranslation()` to `ConstraintViolationBuilderInterface`
10+
411
6.4
512
---
613

ConstraintViolationInterface.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030
* element is still the person, but the property path is "address.street".
3131
*
3232
* @author Bernhard Schussek <[email protected]>
33-
*
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.
3733
*/
3834
interface ConstraintViolationInterface
3935
{
@@ -113,4 +109,19 @@ public function getInvalidValue(): mixed;
113109
* Returns a machine-digestible error code for the violation.
114110
*/
115111
public function getCode(): ?string;
112+
113+
/**
114+
* Returns the constraint whose validation caused the violation.
115+
*/
116+
public function getConstraint(): ?Constraint;
117+
118+
/**
119+
* Returns the cause of the violation.
120+
*/
121+
public function getCause(): mixed;
122+
123+
/**
124+
* Converts the violation into a string for debugging purposes.
125+
*/
126+
public function __toString(): string;
116127
}

ConstraintViolationListInterface.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
*
2121
* @extends \ArrayAccess<int, ConstraintViolationInterface>
2222
* @extends \Traversable<int, ConstraintViolationInterface>
23-
*
24-
* @method string __toString() Converts the violation into a string for debugging purposes. Not implementing it is deprecated since Symfony 6.1.
2523
*/
2624
interface ConstraintViolationListInterface extends \Traversable, \Countable, \ArrayAccess
2725
{
@@ -72,4 +70,9 @@ public function set(int $offset, ConstraintViolationInterface $violation);
7270
* @return void
7371
*/
7472
public function remove(int $offset);
73+
74+
/**
75+
* Converts the violation into a string for debugging purposes.
76+
*/
77+
public function __toString(): string;
7578
}

Violation/ConstraintViolationBuilderInterface.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
* execution context.
2121
*
2222
* @author Bernhard Schussek <[email protected]>
23-
*
24-
* @method $this disableTranslation()
2523
*/
2624
interface ConstraintViolationBuilderInterface
2725
{
@@ -58,6 +56,11 @@ public function setParameter(string $key, string $value): static;
5856
*/
5957
public function setParameters(array $parameters): static;
6058

59+
/**
60+
* @return $this
61+
*/
62+
public function disableTranslation(): static;
63+
6164
/**
6265
* Sets the translation domain which should be used for translating the
6366
* violation message.

0 commit comments

Comments
 (0)