Hey,

Yes, very nice appendix out there:

https://github.com/php-fig-rectified/fig-rectified-standards/blob/master/PSR-2-R-coding-style-guide-additions.md#multi-line-declarationconditionconcatenation

Pretty much the obvious solution if you consistently continue PSR.

Regards
Sven

Am 2017-06-21 10:11, schrieb Sergey Karavay:
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 php-fig+unsubscr...@googlegroups.com.
 To post to this group, send email to php-fig@googlegroups.com.
 To view this discussion on the web visit

https://groups.google.com/d/msgid/php-fig/3f60c18b-f847-4d89-a972-a70290a165e6%40googlegroups.com
[1].
 For more options, visit https://groups.google.com/d/optout [2].


Links:
------
[1]

https://groups.google.com/d/msgid/php-fig/3f60c18b-f847-4d89-a972-a70290a165e6%40googlegroups.com?utm_medium=email&utm_source=footer
[2] https://groups.google.com/d/optout

--
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 php-fig+unsubscr...@googlegroups.com.
To post to this group, send email to php-fig@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/b4ceeb17e6e27de622bbfa8671ec7e17%40e7o.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to