-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Add the type for ConstraintValidatorTestCase::createValidator #48012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
stof
commented
Oct 27, 2022
Q | A |
---|---|
Branch? | 6.2 |
Bug fix? | no |
New feature? | no |
Deprecations? | no |
Tickets | n/a |
License | MIT |
Doc PR | n/a |
Do we need to add the changed file in the list of excluded classes in |
indeed, we should (and ideally, we should update the patcher to account for |
Looking at it, the patcher handles template type only when the method has a native return type. Maybe this should be typed like that for now, to account for adding a native return type in Symfony 7.0: /**
* @return ConstraintValidatorInterface
* @psalm-return T
*/
abstract protected function createValidator(); This way, in 7.0, we can add |
@stof that'd make sense to me. |
I updated the PR |
…t the patcher (stof) This PR was merged into the 6.2 branch. Discussion ---------- Fix the DataTransformerInterface generic types to support the patcher | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | n/a The type patcher adding return types handles template types only for methods that already have a return type. As `DataTransformerInterface` is not typed yet in Symfony 6.x, we need to keep the future native types in ``@return`` for the patcher tool. This puts the generic type (introduced in #47412) in ``@psalm`-return`, as done in #48012 (I detected this issue when regenerating the return type for that other PR) Commits ------- d9fd5c7 Fix the DataTransformerInterface generic types to support the patcher
rebase needed |
@nicolas-grekas The rebase is done |
src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php
Outdated
Show resolved
Hide resolved
36604b9
to
894a449
Compare
Thank you @stof. |