While reading the code of SpaceyParanthesisSniff.php in CodeSniffer - I found the following snippet at Line 76 :
if ( ( $nextToken['code'] === T_WHITESPACE && strpos( $nextToken['content'], "\n" ) === false && $nextToken['content'] != ' ' ) || ( $nextToken['code'] !== T_CLOSE_PARENTHESIS && $nextToken['code'] !== T_WHITESPACE ) ) {
I was wondering if there is a style guide for where the boolean operator (&&) should be kept - in the beginning of the next line or the end of the current line.
If there is a rule (couldn't find one in https://www.mediawiki.org/wiki/CC/PHP) - maybe there should be a sniff for this ?
Could also be extended for all operators - for example a long string - should the concatenation (dot .) operator be at the end of the line or at the beginning of the new line
$a = "a very long string which spans " . "multiple lines."; OR $a = "a very long string which spans " . "multiple lines.";