Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implement bit shift operation on integers and unions #3145

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

Merged
ondrejmirtes merged 1 commit into phpstan:1.11.x from thg2k:pr/shift_range_adv_1
Jun 14, 2024

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
Copy link
Collaborator

This pull request has been marked as ready for review.

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

@ondrejmirtes ondrejmirtes Jun 14, 2024

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

@ondrejmirtes ondrejmirtes Jun 14, 2024

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

@ondrejmirtes ondrejmirtes Jun 14, 2024

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

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 merged commit dd534ea into phpstan:1.11.x Jun 14, 2024
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

Reviewers

@ondrejmirtes ondrejmirtes ondrejmirtes approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /