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

Improve wording of the NonexistentOffset, BooleanAndConstantConditionRule and BooleanOrConstantConditionRule #1882

Merged
merged 2 commits into from
Oct 25, 2022

Conversation

VincentLanglet
Copy link
Contributor

@VincentLanglet VincentLanglet commented Oct 20, 2022

Related to phpstan/phpstan#8187 (comment)

I feel like

Offset 'c' does not exist on array{c?: int}.

is confusing and

Offset 'c' might not exist on array{c?: int}.

is better.

@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

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

We can't do this because it'd break existing baselines. We can do this only with a new bleedingEdge toggle.

A similar thing could be fixed in BooleanAndConstantConditionRule and BooleanOrConstantConditionRule where the message still uses && and || even for logical and and or operators.

@herndlm
Copy link
Contributor

herndlm commented Oct 21, 2022

new bleeding edge toggle kind of means that it will get into the next major automatically, right?
sounds like a good solution then, otherwise it would need to be remembered / noted down :)

@ondrejmirtes
Copy link
Member

Exactly, and no rebase nightmare either.

@VincentLanglet
Copy link
Contributor Author

Yeah, I'll update the PR

@VincentLanglet
Copy link
Contributor Author

We can't do this because it'd break existing baselines. We can do this only with a new bleedingEdge toggle.

Done

A similar thing could be fixed in BooleanAndConstantConditionRule and BooleanOrConstantConditionRule where the message still uses && and || even for logical and and or operators.

Done

@VincentLanglet VincentLanglet changed the title Improve wording of the NonexistenOffset error Improve wording of the NonexistenOffset, BooleanAndConstantConditionRule and BooleanOrConstantConditionRule error Oct 22, 2022
@ondrejmirtes ondrejmirtes changed the title Improve wording of the NonexistenOffset, BooleanAndConstantConditionRule and BooleanOrConstantConditionRule error Improve wording of the NonexistentOffset, BooleanAndConstantConditionRule and BooleanOrConstantConditionRule Oct 25, 2022
@ondrejmirtes ondrejmirtes merged commit d2227f8 into phpstan:1.9.x Oct 25, 2022
@ondrejmirtes
Copy link
Member

Thank you.

@VincentLanglet VincentLanglet deleted the wording branch October 25, 2022 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants