Am 05.02.2017 um 00:06 schrieb Alessandro Pellizzari:
> On Sat, 4 Feb 2017 11:41:39 -0800 (PST) Ryan R. wrote:
> 
>> 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:

The readability is IMHO enhanced best by placing the braces on their own
lines:

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

    return ucwords($dummy);
}

With that rule, you get the optical block separation out of the box.
Start and end of a block is easily recognized, because the corresponding
braces are always on the same column.

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

Agree.

Regards,
Niels

-- 
| New Stars on the Horizon:      GreenCape  ·  nibralab  ·  laJoom |
| http://www.bsds.de   ·   BSDS Braczek Software- und DatenSysteme |
| Webdesign · Webhosting · e-Commerce · Joomla! Content Management |
 ------------------------------------------------------------------

-- 
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/05a6c7d7-b7f0-0b2b-a73b-b0e2bcee70d6%40bsds.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to