Hey guys!
I'd looked through all existing coding-style standards (PSR-1, PSR-2,
PSR-12) and actually failed to find any suggestions about formatting of
long conditionals. We have standards for long argument lists, long
"implements" lists, long "use" lists, but what about long conditions?
For example:
if (($someLongVariable && $anotherLongVariable) || $moreLongVariablesHere
|| $this->andEvenSomeLongMethodCall()) {
//body here
}
Can be formatted like this:
if (
($someLongVariable && $anotherLongVariable)
||
$moreLongVariablesHere
||
$this->andEvenSomeLongMethodCall()
) {
//body here
}
or like this:
if (
($someLongVariable && $anotherLongVariable) ||
$moreLongVariablesHere ||
$this->andEvenSomeLongMethodCall()
) {
//body here
}
or in some other way.
Do we have a standard for this somewhere?
Thanks.
--
You received this message because you are subscribed to the Google Groups "PHP
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/php-fig/3f60c18b-f847-4d89-a972-a70290a165e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.