Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Add phpdoc for constraint#42136
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
derrabus commentedJul 15, 2021
Fixing Doc blocks should be done as a bugfix on lower branches (4.4 mainly, in this case). |
VincentLanglet commentedJul 15, 2021
I fully agree on this. If the core team now decide it's a bugfix, I'm fine doing it on 4.4 but I'd like some confirmation before doing this PR again. |
derrabus commentedJul 15, 2021
Fair enough. Sorry for the confusion. 😞 |
nicolas-grekas commentedJul 19, 2021
We try to remove phpdoc actually. |
VincentLanglet commentedJul 19, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The rule has some sens, but it's not because a property has a default value that another type is forbidden My main issue was that psalm and phpstan consider as |
nicolas-grekas commentedJul 19, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
That's an issue with psalm/phpstan, it might be fixed with a plugin maybe? |
VincentLanglet commentedJul 19, 2021
So I should remove the phpdoc of property with default value and keep the others ? |
nicolas-grekas commentedJul 19, 2021
That'd work for me yes. If a default value can be added instead in some cases, that'd be even better. |
Uh oh!
There was an error while loading.Please reload this page.
When extending some constraint and overriding some property, it's not always simple to know what can be passed to the properties and when it can be null. Those properties should have phpdoc to define their type.
Plus it avoid a psalm error
NonInvariantDocblockPropertyTypefor the developer which use a more specific phpdoc (because atm, properties are considered as mixed).And, it will help the typing for PHP8 on the branch 6.0@nicolas-grekas :)