Skip to content

Instantly share code, notes, and snippets.

@bitwombat
Last active October 5, 2017 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitwombat/2b3f08e5984bba782c520a23e8c276ab to your computer and use it in GitHub Desktop.
Save bitwombat/2b3f08e5984bba782c520a23e8c276ab to your computer and use it in GitHub Desktop.
PHPStorm/EA Extended inspections complains about this else.
if ($mustBeCurrent) {
$title = 'People currently proficient in';
} else {
$title = 'People who have ever had training in';
}
@bitwombat
Copy link
Author

bitwombat commented Oct 5, 2017

PHPstorm's inspections (might be part of the EA Extended Plugin's inspections) complain that:

Assignment in this branch should be moved before the if.

This seems to be part of the trendy "war on if statements", but the logic above seems completely appropriate and readable. More so than the "default assignment" style. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment