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

Ban short ternary operator #92

Merged
merged 1 commit into from Nov 9, 2019

Conversation

@Majkl578
Copy link
Contributor

Majkl578 commented Nov 5, 2019

Short ternary operator implies weak comparison and as such this rule bans weak code which coerces to false, e.g.:

'' ?: 'default'
0 ?: -1

Build failure seems unrelated.

@Majkl578 Majkl578 force-pushed the Majkl578:ban-short-ternary branch from d5d2959 to 0f18de6 Nov 5, 2019
@malukenho

This comment has been minimized.

Copy link

malukenho commented Nov 5, 2019

Awesome

@simPod
simPod approved these changes Nov 5, 2019
@ondrejmirtes

This comment has been minimized.

Copy link
Member

ondrejmirtes commented Nov 9, 2019

Thank you!

@ondrejmirtes ondrejmirtes merged commit 5f60d4e into phpstan:master Nov 9, 2019
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
@Majkl578 Majkl578 deleted the Majkl578:ban-short-ternary branch Nov 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.