Skip to content

Conversation

@thg2k
Copy link
Contributor

@thg2k thg2k commented Jun 10, 2024

This was in my wishlist for a long time.. so I did it 😄

@thg2k thg2k marked this pull request as draft June 10, 2024 20:12
@thg2k thg2k force-pushed the pr/shift_range_adv_1 branch 4 times, most recently from d882aa9 to db47c34 Compare June 14, 2024 09:39
@thg2k thg2k marked this pull request as ready for review June 14, 2024 09:51
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@thg2k
Copy link
Contributor Author

thg2k commented Jun 14, 2024

@ondrejmirtes I played with this feature for a few days in my codebase and I feel it is ready to go. Can you review this? Is there anythink that I'm overlooking?

Copy link
Member

Choose a reason for hiding this comment

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

Please add ShiftLeft and ShiftRight here, instead of removing the PHPDoc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done for both. This should lead to a unreachable statement for the "else" branch, not sure if that is a problem.

Copy link
Member

Choose a reason for hiding this comment

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

This should lead to

It doesn't in bleeding edge. PHPStan no longer penalizes for unreachable else branch that throws an exception.

Copy link
Member

Choose a reason for hiding this comment

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

Please add ShiftLeft and ShiftRight here, instead of removing the PHPDoc.

@thg2k
Copy link
Contributor Author

thg2k commented Jun 14, 2024

Please note that this would conflict with #3152 if it gets merged. That should have the priority as I think it's a bad bug. I'm happy to rebase this (or the other) in case.

@ondrejmirtes ondrejmirtes force-pushed the pr/shift_range_adv_1 branch from 36171c3 to a42834d Compare June 14, 2024 20:36
@ondrejmirtes ondrejmirtes merged commit dd534ea into phpstan:1.11.x Jun 14, 2024
@ondrejmirtes
Copy link
Member

Thank you.

@thg2k thg2k deleted the pr/shift_range_adv_1 branch June 15, 2024 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants