Commit e88263c
committed
bug symfony#61056 [Validator] Allow mixed root on
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 validatorCompoundConstraintTestCase validator (thePanz)File tree
1 file changed
+1
-1
lines changed- src/Symfony/Component/Validator/Test
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
0 commit comments