-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Adding details to types in PHPDoc #8548
Conversation
@@ -399,7 +399,7 @@ protected function getDeleteSQL(PersistentCollection $collection) | |||
/** | |||
* Internal note: Order of the parameters must be the same as the order of the columns in getDeleteSql. | |||
* | |||
* @return mixed[] | |||
* @return list<mixed> |
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.
Should this be duplicated because of the list
part?
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.
list is now an alias of array in phpstorm. Not sure in VS Code
@@ -428,7 +430,7 @@ public function isScalarResult($columnName) | |||
* | |||
* @param string $alias | |||
* | |||
* @return string | |||
* @return class-string |
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.
This is not understood by IDEs is it?
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.
It's now an alias of string in PHPStorm. Not sure in VS Code
How closer to Psalm and PHPStan's next levels does this bring us? |
@vladyslavstartsev @simonberger please review 🙏 |
It wasn't quite my metric, but with issues up to level 3, it fixes 63 issues, it revealed 13 new ones and upped the type coverage from 90.4980% to 90.5595% |
ec30919
to
5f27ad9
Compare
Why are there 2 commits? What is the difference between "psalm fixes" and just "fixes"? |
!'m still working on that, I'll squash them later |
This should be good now :) This has been rebased and I fixed the new issues related to the baselines that were introduced. I had to change a few things:
|
Your last message has bullet points containing interesting information. Could you please make one commit per bullet point, and reuse what you wrote to create a commit messages? Some of these commits should probably target 2.8.x. For instance, to avoid issues when merging up, it would be great to have the same versions of phpstan on all branches. The second one can stay on the 2.9.x PR I think, because it will have no effect on the CI of the end user. The third one should be contributed to 2.8.x, since it does not affect the code itself but rather the build process, and as you pointed out, it seems important to have the same messages, especially when merging up (we don't want to have complicated things to do when merging up). Since it is a temporary solution, it should probably come with a comment saying we should remove it when we successfully remove the baseline? And finally, some changes in this PR are type improvements, while some others are type fixes (the types were just plain wrong before, for instance when we use |
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.
I learnt today that 2.9.0 was going to be released really soon, so there is no need to backport the "fixes" to 2.8.x
Thanks @orklah ! |
This PR propose detailing phpdoc for the most part. Most types were generated directly by Psalm and refined by hand.