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

Support for phpstan 2? #859

Open
mfn opened this issue Nov 11, 2024 · 2 comments · May be fixed by #873
Open

Support for phpstan 2? #859

mfn opened this issue Nov 11, 2024 · 2 comments · May be fixed by #873
Assignees

Comments

@mfn
Copy link

mfn commented Nov 11, 2024

phpstan 2.0 was just released:

@mfn mfn changed the title Support for phptan 2 Support for phpstan 2 Nov 11, 2024
@mfn mfn changed the title Support for phpstan 2 Support for phpstan 2? Nov 11, 2024
@localheinz localheinz self-assigned this Nov 11, 2024
@localheinz
Copy link
Member

Thank you, will do as soon as I find the time!

@gregtyler
Copy link

I just had a look at this to see if I could help out, but it's more involved than I'd hoped. You might already be well on top of this, but thought I should write up some of the required changes I found in case it's helpful:

  • rector/rector also has a PHPStan dependency and doesn't support v2.0 yet, so it'll have to wait for that (or drop the dependency, I suppose)
  • The final array_map of NoConstructorParameterWithDefaultValueRule returns string[] rather than Rules\RuleError[]: the sprintf just needs to be wrapped in a RuleBuilder like elsewhere
  • The errors all need identifiers when being built
  • checkMissingIterableValueType and checkGenericClassInNonGenericObjectType need to be replaced with ignore statements
  • The ignored error message in AbstractTestCase has changed syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants