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/bf9bad27-0547-4869-aa4b-bc86348e9f5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • PSR-12 "... alexey . borzov
    • Re: PSR-... Woody Gilk
      • Re: ... Alexandru Pătrănescu
        • ... alexey . borzov
          • ... '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

Reply via email to