-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Fix/update PHPStan #212
Fix/update PHPStan #212
Conversation
Hey, for this:
Looks like all the failures are related to ignored errors which are actually not found in the code on 7.4. To silence those errors we could just use this config option |
8041ab8
to
dcd6403
Compare
phpstan-baseline.neon
Outdated
message: "#^Parameter \\#1 \\$callable of class loophp\\\\collection\\\\Iterator\\\\ClosureIterator constructor expects callable\\(\\.\\.\\.mixed\\)\\: iterable, Closure\\(Generator\\)\\: Generator\\<mixed, mixed, mixed, void\\> given\\.$#" | ||
count: 1 | ||
path: src/Collection.php | ||
|
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.
@drupol I'm a bit concerned by the high number of new errors this is adding to the baseline. This is likely due to PHPStan's new level 9, which is quite brutal, similar to Psalm's level 1 which disallows mixed (which we are not using - this this project uses the default Psalm level 2).
This PR is currently trying to do 2 things at the same time, and I think we should separate them:
-
updating to PHPStan 1.0 -> we should be able to do this and fix any errors as long as there aren't too many
-
updating to PHPStan level 9 -> I don't think we can do this yet, it might take quite a bit of work to get the static analysis in place properly for this. For now I think we should limit the level to 8 in the grumphp config for this project only
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.
Right, I had this in mind as well at the beginning, then I skipped it.
I will update the PR accordingly in the evening.
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.
Job done!
dcd6403
to
7b18dd9
Compare
message: "#^PHPDoc tag @template T for class loophp\\\\collection\\\\Contract\\\\Operation\\\\Unpackable with bound type array\\<int, NewT\\|NewTKey\\> is not supported\\.$#" | ||
count: 1 | ||
path: src/Contract/Operation/Unpackable.php | ||
|
||
- | ||
message: "#^PHPDoc tag @template T for interface loophp\\\\collection\\\\Contract\\\\Operation\\\\Unpackable with bound type array\\<int, NewT\\|NewTKey\\> is not supported\\.$#" | ||
count: 1 | ||
path: src/Contract/Operation/Unpackable.php | ||
|
||
- | ||
message: "#^PHPDoc tag @template T for class loophp\\\\collection\\\\Operation\\\\Unpack with bound type array\\<int, NewT\\|NewTKey\\> is not supported\\.$#" | ||
count: 1 | ||
path: src/Operation/Unpack.php |
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.
something good came out of this 😄
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.
Definitely ! :)
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.
We'll need to see how we can fix the new baseline errors, I'll probably look into it when I get the time
This PR:
reportUnmatchedIgnoredErrors
Fixes #210