Add phpstan analysis

This commit is contained in:
Vincent Langlet
2024-11-20 13:23:43 +01:00
committed by Fabien Potencier
parent 8c91bd7093
commit 75d48db822
11 changed files with 79 additions and 16 deletions
+4 -4
View File
@@ -53,9 +53,9 @@ class ExpressionParser
public const OPERATOR_LEFT = 1;
public const OPERATOR_RIGHT = 2;
/** @var array<string, array{precedence: int, class: class-string<AbstractUnary>}> */
/** @var array<string, array{precedence: int, precedence_change?: OperatorPrecedenceChange, class: class-string<AbstractUnary>}> */
private $unaryOperators;
/** @var array<string, array{precedence: int, class: class-string<AbstractBinary>, associativity: self::OPERATOR_*}> */
/** @var array<string, array{precedence: int, precedence_change?: OperatorPrecedenceChange, class: class-string<AbstractBinary>, associativity: self::OPERATOR_*}> */
private $binaryOperators;
private $readyNodes = [];
private array $precedenceChanges = [];
@@ -125,7 +125,7 @@ class ExpressionParser
$expr->setAttribute('operator', 'binary_'.$token->getValue());
$this->triggerPrecedenceDeprecations($expr, $token);
$this->triggerPrecedenceDeprecations($expr);
$token = $this->parser->getCurrentToken();
}
@@ -246,7 +246,7 @@ class ExpressionParser
$expr->setAttribute('operator', 'unary_'.$token->getValue());
if ($this->deprecationCheck) {
$this->triggerPrecedenceDeprecations($expr, $token);
$this->triggerPrecedenceDeprecations($expr);
}
return $this->parsePostfixExpression($expr);