Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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