Skip to content
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

Generated factories with PHPStan methods cause PhpStorm to mark file as error #503

Open
rsereir opened this issue Sep 9, 2023 · 3 comments

Comments

@rsereir
Copy link

rsereir commented Sep 9, 2023

Hello,

I have an issue with phpstan annotations on phpstorm:

Method with same name already defined in this class

I didn't find anything opened on this github, and nothing else in the web.

I didn't really know if it's a phpstorm i

ssue or more depth Foundry problem ( or maybe just config..? )

This is the render of my Factory with the error:
Screenshot 2023-09-09 at 15 53 35

@kbond
Copy link
Member

kbond commented Sep 9, 2023

Hey, I just ran into this the other day too. My solution was to wrap the type-hint in (), so for your example: @phpstan-method static (list<Proxy<EmailTemplateTranslation>>) all().

Is your above example what's generated by the maker?

@rsereir
Copy link
Author

rsereir commented Sep 9, 2023

@kbond Thanks for your tip, it looks better now, but it's not underlight like previous methods

Yes all is generated by maker

Screenshot 2023-09-09 at 16 57 01

@kbond
Copy link
Member

kbond commented Sep 9, 2023

but it's not underlight like previous methods

Yeah, PHPStorm doesn't recognise the syntax but at least it no longer marks the entire file with an error.

Yes all is generated by maker

Ok, we'll need to update the maker template - let's keep this issue open.

@kbond kbond changed the title Foundry and PHPStorm Generated factories with PHPStan methods cause PhpStorm to mark file as error Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants