From 1647b19c1574ac6c2cf75e572eef17c8bb3e001e Mon Sep 17 00:00:00 2001 From: TomasVotruba Date: Tue, 2 Mar 2021 13:55:57 +0100 Subject: [PATCH] bump deps --- composer.json | 2 +- rules/dead-code/src/ConditionEvaluator.php | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 5227c0ff2d6e..a679e89c5e94 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "nette/utils": "^3.2", "nikic/php-parser": "^4.10.4", "phpstan/phpdoc-parser": "^0.4.9", - "phpstan/phpstan": "^0.12.79", + "phpstan/phpstan": "^0.12.80", "phpstan/phpstan-phpunit": "^0.12.17", "psr/simple-cache": "^1.0", "sebastian/diff": "^4.0.4", diff --git a/rules/dead-code/src/ConditionEvaluator.php b/rules/dead-code/src/ConditionEvaluator.php index c358074b7a65..3355fd067632 100644 --- a/rules/dead-code/src/ConditionEvaluator.php +++ b/rules/dead-code/src/ConditionEvaluator.php @@ -37,10 +37,17 @@ public function evaluate(ConditionInterface $condition) private function evaluateVersionCompareCondition(VersionCompareCondition $versionCompareCondition) { $compareSign = $versionCompareCondition->getCompareSign(); + if ($compareSign !== null) { + return version_compare( + (string) $versionCompareCondition->getFirstVersion(), + (string) $versionCompareCondition->getSecondVersion(), + $compareSign + ); + } + return version_compare( (string) $versionCompareCondition->getFirstVersion(), - (string) $versionCompareCondition->getSecondVersion(), - $compareSign + (string) $versionCompareCondition->getSecondVersion() ); }