You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #61056 [Validator] Allow mixed root on CompoundConstraintTestCase validator (thePanz)
This PR was merged into the 7.2 branch.
Discussion
----------
[Validator] Allow mixed root on `CompoundConstraintTestCase` validator
| Q | A
| ------------- | ---
| Branch? | 7.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues |
| License | MIT
The CompoundConstraintTestCase is currently defining a `protected string $root`, forcing the root to be a "string".
Testing compound constraints where the root is something different is triggering Static-Analysis (phpstan) warings or (worst) casting the `$root` to a string, causing PHP errors.
In the given code: the `$root` is passed to the ExecutionContext, which has the following constructor signature: `__construct(private ValidatorInterface $validator, private mixed $root, private TranslatorInterface $translator, ...)`, thus `mixed` can be safely used in the `CompoundConstraintTestCase` class too.
Commits
-------
47b5387 Allow mixed root on CompoundConstraintTestCase validator
0 commit comments