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 1 commit into from Nov 9, 2019


Copy link

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

This comment has been minimized.

Copy link

malukenho commented Nov 5, 2019


simPod approved these changes Nov 5, 2019

This comment has been minimized.

Copy link

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
@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
None yet
5 participants
You can’t perform that action at this time.