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

Fix PHPStan (again) #2416

Closed
wants to merge 1 commit into from
Closed

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Dec 12, 2023

PHPStan released version 1.10.49 today and managed to break things again... maybe someone should explain semver to them....

Either way, this fixes it.

I've favoured ignoring these issues instead of "fixing" them as we were already ignoring a "Result of method * (void) is used" for level 0, which is about the same thing.

These methods all return the return value of a parent/child method, which can either be int or void. For code consistency and stability, it is a lot clearer to have these return statements in place and it will prevent potential future breakage if the parent/child would start returning a stack pointer.

Ref: https://github.com/phpstan/phpstan/releases/tag/1.10.49

PHPStan released version 1.10.49 today and managed to break things again... maybe someone should explain semver to them....

Either way, this fixes it.

I've favoured ignoring these issues instead of "fixing" them as we were already ignoring a "Result of method * (void) is used" for level 0, which is about the same thing.

These methods all `return` the return value of a parent/child method, which can either be `int` or `void`.
For code consistency and stability, it is a lot clearer to have these `return` statements in place and it will prevent potential future breakage if the parent/child would start returning a stack pointer.

Ref: https://github.com/phpstan/phpstan/releases/tag/1.10.49
@ondrejmirtes
Copy link

We're going to fix this use-case in PHPStan, looks easy enough to fix.

@jrfnl
Copy link
Member Author

jrfnl commented Dec 12, 2023

Much appreciated @ondrejmirtes !

Copy link
Member

@GaryJones GaryJones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but I won't merge in case there's a thought that phpstan itself may be updated with a new release quick enough.

@jrfnl
Copy link
Member Author

jrfnl commented Dec 12, 2023

Approved, but I won't merge in case there's a thought that phpstan itself may be updated with a new release quick enough.

That's fine, let's give it a little, but I do have another PR ready to go, which would have a broken build without this, so let's not leave it too long as I think it would probably be good to get 3.1.0 out of the door soonish.

@ondrejmirtes
Copy link

Fixed in PHPStan 1.10.50: https://github.com/phpstan/phpstan/releases/tag/1.10.50

@jrfnl
Copy link
Member Author

jrfnl commented Dec 13, 2023

Thank you @ondrejmirtes !

I've triggered a build on develop and can confirm this PR is no longer needed. Closing.

@jrfnl jrfnl closed this Dec 13, 2023
@jrfnl jrfnl deleted the feature/fix-phpstan-again branch December 13, 2023 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants