-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
declare type for arguments of anonymous functions for v2.7 #26821
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
declare type for arguments of anonymous functions for v2.7 #26821
Conversation
@DQNEO Can you check if there are other anonymous functions that could use some type hints as well? |
For this component, that's all.
Sure, I'll do. |
One PR for all components please. |
There is a risk factor here to break BC. This can suddendly forbid duck typing. |
In this case, we control the array of parameters (as it comes from |
yes: this must be thought case by case, with a risk of mistake if we're not extra careful, that's what I meant |
I've done for most of anonymous functions in which I thought we could declare types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for merging in master
Thank you @DQNEO. |
….7 (DQNEO) This PR was submitted for the 2.7 branch but it was squashed and merged into the 4.1-dev branch instead (closes #26821). Discussion ---------- declare type for arguments of anonymous functions for v2.7 | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Declare type for array_map Commits ------- 74ab256 declare type for arguments of anonymous functions for v2.7
This PR was merged into the 4.1-dev branch. Discussion ---------- Revert the type declaration of Role merged in #26821 | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | in #2681 (https://github.com/symfony/symfony/pull/26821/files#diff-5febf3ee0bb2e743b1a929abe55968e8R89) I added a `Role` type declaration. But users who had played duck type there could face B.C. break. So I'd like to revert the change. Commits ------- 66adc9f Revert the type declaration for Role, because users might do duck typing.
This PR was squashed before being merged into the 4.1-dev branch (closes #26990). Discussion ---------- declare types in array_map callbacks | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This is a continuation of symfony/symfony#26821 Commits ------- e7d5634cf4 declare types in array_map callbacks
This PR was squashed before being merged into the 4.1-dev branch (closes #26990). Discussion ---------- declare types in array_map callbacks | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This is a continuation of #26821 Commits ------- e7d5634 declare types in array_map callbacks
Declare type for array_map