Skip to content

Commit 03c379f

Browse files
SpacePossumnicolas-grekas
authored andcommitted
[CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction
1 parent 52ad769 commit 03c379f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Parser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,14 @@ public function parseHashExpression()
305305
public function parsePostfixExpression($node)
306306
{
307307
$token = $this->stream->current;
308-
while ($token->type == Token::PUNCTUATION_TYPE) {
308+
while (Token::PUNCTUATION_TYPE == $token->type) {
309309
if ('.' === $token->value) {
310310
$this->stream->next();
311311
$token = $this->stream->current;
312312
$this->stream->next();
313313

314314
if (
315-
$token->type !== Token::NAME_TYPE
315+
Token::NAME_TYPE !== $token->type
316316
&&
317317
// Operators like "not" and "matches" are valid method or property names,
318318
//
@@ -325,7 +325,7 @@ public function parsePostfixExpression($node)
325325
// Other types, such as STRING_TYPE and NUMBER_TYPE, can't be parsed as property nor method names.
326326
//
327327
// As a result, if $token is NOT an operator OR $token->value is NOT a valid property or method name, an exception shall be thrown.
328-
($token->type !== Token::OPERATOR_TYPE || !preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A', $token->value))
328+
(Token::OPERATOR_TYPE !== $token->type || !preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A', $token->value))
329329
) {
330330
throw new SyntaxError('Expected name', $token->cursor, $this->stream->getExpression());
331331
}

TokenStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function expect($type, $value = null, $message = null)
8484
*/
8585
public function isEOF()
8686
{
87-
return $this->current->type === Token::EOF_TYPE;
87+
return Token::EOF_TYPE === $this->current->type;
8888
}
8989

9090
/**

0 commit comments

Comments
 (0)