P.S. : The sentence about blank lines should also be modified in PSR-12 
proposal as, following the logic of the "code should look like this sample" 
rule the following would go against any decision made in relation to 
allowing blank lines in control structures alltogether :
"Blank lines MAY be added to improve readability and to indicate related 
blocks of code except where explictly forbidden."

Le dimanche 5 février 2017 14:04:27 UTC+1, Ryan R. a écrit :
>
> can you link to where in PSR-2 you're seeing that?
>>
>
> http://www.php-fig.org/psr/psr-2/#if-elseif-else >> see the "An if 
> structure looks like the following" sentence and following code sample
>
> I personnally did not pay attention to that sentence the first time around 
> and only looked at the rules noted at 
> http://www.php-fig.org/psr/psr-2/#control-structures
> But after getting a phpcs error on this précise type of case, I created an 
> issue in their github (
> https://github.com/squizlabs/PHP_CodeSniffer/issues/1330)
> I was told to pay attention at that precise line on the PSR.
>
> IMHO, thsi is not clear as currently stated in the PSR :
> I strongly believe allowing for one blank line at the beginning of 
> controle structure is useful / necessary.
>
> I also agree that Iitcould be useful to allow one at the end of the 
> control structure parts (see Alessandro's comment):
>
>> Personally I prefer a blank line before the }else{
>>
>
> However I'm puzzled with Nielz proposition, not on the fact that it would 
> increase readability, but more on the fact that it would mean reviewing the 
> entire concept of the braces placements in the PSRs. 
> Even though if I myself am quite annoyed by the decision taken to have two 
> different type of placements... I'd rather have only one (either on next 
> line or same line with an empty line allowed after)
>
> Le dimanche 5 février 2017 06:24:36 UTC+1, Korvin Szanto a écrit :
>>
>> Hi Everyone,
>>
>> On Sat, Feb 4, 2017 at 11:41 AM Ryan R. <ryan.r...@gmail.com> 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.
>>>
>>
>> I wasn't aware that this was the case, can you link to where in PSR-2 
>> you're seeing that? From what I understand PSR-2 currently allows blank 
>> lines and even (sort of) encourages adding them to improve readability [1]:
>>
>> > Blank lines MAY be added to improve readability and to indicate related 
>> blocks of code.
>>
>>  so we should be all set on this front.
>>
>> [1] http://www.php-fig.org/psr/psr-2/#lines
>>
>> Best wishes,
>> Korvin
>>
>

-- 
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/96f10684-7d85-499d-a611-1eb031b6f5eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to