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() ); }