diff --git a/CHANGELOG.md b/CHANGELOG.md index cf3624939..8e5871099 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Fixed +- Fix undefined local variable in `CalcFunction::parse()` (#593) + ## 8.5.1 ### Fixed diff --git a/config/phpstan-baseline.neon b/config/phpstan-baseline.neon index 243e36c44..82fcb3f45 100644 --- a/config/phpstan-baseline.neon +++ b/config/phpstan-baseline.neon @@ -10,8 +10,3 @@ parameters: count: 2 path: ../src/RuleSet/DeclarationBlock.php - - - message: "#^Variable \\$oVal might not be defined\\.$#" - count: 1 - path: ../src/Value/CalcFunction.php - diff --git a/src/Value/CalcFunction.php b/src/Value/CalcFunction.php index c8791d98a..a3db27101 100644 --- a/src/Value/CalcFunction.php +++ b/src/Value/CalcFunction.php @@ -91,7 +91,7 @@ public static function parse(ParserState $oParserState, $bIgnoreCase = false) sprintf( 'Next token was expected to be an operand of type %s. Instead "%s" was found.', implode(', ', $aOperators), - $oVal + $oParserState->peek() ), '', 'custom',