Readability-wise using same braces style as we're using for classes and 
methods would be beneficial for control structures i.e.

if ($foo)
{
    doFoo();
}
elseif ($bar)
{
    doBar();
}
else
{
    doSomethingElse();
}

Clear code blocks, vertically aligned braces.

You are right that this particular case is like idiosyncrasies but not 
personal ones. PSRs aren't created by a single person but a group. We have 
PSR-2 that we decided to be compatible with at the very start as stated in 
the meta-document.

If you have arguments 

On Sunday, April 21, 2019 at 12:51:52 PM UTC+3, alexey...@gmail.com wrote:
>
> Hi Alexander,
>
> Well, maybe. It's widely used in Java so I've got used to it years ago.
>>
>
> Well, I had a wrong assumption that coding standards are there to help 
> with code readability and code understanding. Thanks for explaining in 
> great detail that they are in fact a means to enshrine personal 
> idiosyncrasies and state "we always do it that way, just because".
>
>
> четверг, 18 апреля 2019 г., 15:54:09 UTC+3 пользователь Alexander Makarov 
> написал:
>>
>> Well, maybe. It's widely used in Java so I've got used to it years ago.
>>
>> On Thursday, April 18, 2019 at 3:26:30 PM UTC+3, Robert Korulczyk wrote:
>>>
>>> > As the way to improve the code, it's possible: 
>>> > 
>>> > switch (true) { 
>>> >     case preg_match(Token::REGEX_OPERATOR, $this->code, $match, null, 
>>> $this->cursor): 
>>> >         $this->pushToken(Token::OPERATOR_TYPE, preg_replace('/\s+/', ' 
>>> ', $match[0])); 
>>> >     break; 
>>> >     case preg_match(self::REGEX_NAME, $this->code, $match, null, 
>>> $this->cursor): 
>>> >         $this->pushToken(Token::NAME_TYPE, $match[0]); 
>>> >     break; 
>>> > } 
>>> > 
>>> > $this->moveCursor($match[0]); 
>>>
>>> This is not an improvement, you're overusing switch syntax to hide 
>>> regular if with dynamic condition - it is closer to obfuscation than 
>>> readability 
>>> improvement. 
>>>
>>>
>>> Regards, 
>>> Robert Korulczyk 
>>>
>>

-- 
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/9991189e-e403-4f32-a196-0370392ae623%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Re: PSR-12 &q... Alexandru Pătrănescu
    • Re: PSR-... alexey . borzov
      • Re: ... 'Alexander Makarov' via PHP Framework Interoperability Group
        • ... alexey . borzov
          • ... Woody Gilk
            • ... alexey . borzov
            • ... 'Alexander Makarov' via PHP Framework Interoperability Group
            • ... Robert Korulczyk
            • ... 'Alexander Makarov' via PHP Framework Interoperability Group
            • ... alexey . borzov
            • ... 'Alexander Makarov' via PHP Framework Interoperability Group
            • ... Mikko Rantalainen
            • ... Joe T.
            • ... Joe T.
            • ... Josh Bruce
            • ... Ben Ramsey
            • ... Josh Bruce
            • ... Josh Bruce
            • ... alexey . borzov
            • ... Woody Gilk
            • ... alexey . borzov

Reply via email to