Skip to content

Instantly share code, notes, and snippets.

@tom--
Created August 9, 2012 12:58
Show Gist options
  • Save tom--/3303986 to your computer and use it in GitHub Desktop.
Save tom--/3303986 to your computer and use it in GitHub Desktop.
PhpStorm Code: Reformat Code wierdness
<?php
// On my mac, cmd-opt-L reformats my php files according to the code style in effect.
// The following is how PhpStorm auto-formats this statement.
// What do I have to set in the code style so it comes out right?
if (isset(
$_SESSION['one'],
$_SESSION['two'],
$_SESSION['three'],
$_SESSION['four'],
$_SESSION['five']
)
&& $_SESSION['one']
&& $_SESSION['two'] >= 2
&& $_SESSION['four'] !== '0'
) {
// something
}
// A reasonable format, that i had before pressing cmd-opt-L, is:
if (isset(
$_SESSION['one'],
$_SESSION['two'],
$_SESSION['three'],
$_SESSION['four'],
$_SESSION['five']
)
&& $_SESSION['one']
&& $_SESSION['two'] >= 2
&& $_SESSION['four'] !== '0'
) {
// something
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment