-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
feat: create PhpStan type resolvers #456
feat: create PhpStan type resolvers #456
Conversation
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.
Neat! Yeah, I agree to wait for #452
a749c32
to
b0980c3
Compare
b0980c3
to
4b2dd2c
Compare
6d75461
to
6b8fb17
Compare
4b2dd2c
to
8957818
Compare
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 couldn't get rid of all these phpstan errors 🤷
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'm more and more thinking to analyse ./tests
folder with phpstan... this will be useful to battle test the phpstan extension
8957818
to
6e4ffd7
Compare
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'm good to merge this into feat/split-factories
What about the todos though?
831f799
to
4496bac
Compare
0b94a41
to
657fb6f
Compare
657fb6f
to
5f631ac
Compare
Here is a draft suggestion to add PHPStan type resolvers for factories' methods.
This would override the
@phpstan-method
stuff in the factories, and it has the big advantage to give us back the control over the type system, we could then update these as long as we're updating the code.It has the drawback that we may need to support two versions of this: one for PHPStan, and another one for Psalm (and I'll have to learn how to make this for Psalm 😅) For now we can only drop the
@phpstan-method
generation with maker, and keep the@psalm-method
annotation.Some stuff still needs to be done:
I would like to merge refactor: split Factory class #452 beforewe will merge it in the branchfeat/split-factories
foundry-phpstan.neon
file@phpstan-method
and show how it should be configuredmake:factory
CHANGELOG.md
to explain existing@phpstan-method
can be dropped in userlandwe can even imagine that once we've made the subtree split, we'd create a
zenstruck/foundry-phpstan
package which will be a phpstan extension and be auto installed withphpstan/extension-installer
WDYT of this?