On Sat, 4 Feb 2017 11:41:39 -0800 (PST)
"Ryan R." <[email protected]> wrote:

> Hello,
> I'd like to propose a change to the PSR-2 rule concerning the
> presence of one (and only one) empty line after opening braces for
> conditional statements.
> 
> Indeed I believe allowing (enforcing ?) a single empty line at the 
> beginning of the conditional statement would enhance the readability
> of the code, especially when multiple conditional statements are
> nested.

I agree in allowing (not enforcing) blank lines in conditionals.

Personally I prefer a blank line before the }else{ part:

if ('string' === $dummy) {
    if ('values' === $mergedOptions['some_default']) { 
        return substr($dummy, 0, 5);
    
    } else {
        $dummy = trim($dummy);
    }

    return ucwords($dummy);
}

In this case it is probably not so evident, but I find it more readable
when there is a block of 5-6 lines.

I don't think a PSR-2 change is possible, but maybe it could be
included in PSR-12?

Bye.

-- 
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/20170204230621.5fa888f5%40namek.
For more options, visit https://groups.google.com/d/optout.

Reply via email to