From 97b22ecdfd4037a29f487628deffb7fb0777b2ed Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Fri, 1 Mar 2024 01:36:53 +0100 Subject: [PATCH] Fix version comparison for `@since` Refs vimeo/psalm#10761 --- .../Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php b/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php index f0a8f34cc..fa2d09f2a 100644 --- a/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php +++ b/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php @@ -463,7 +463,7 @@ final class FunctionLikeNodeScanner if ($docblock_info) { if ($docblock_info->since_php_major_version && !$this->aliases->namespace) { $analysis_major_php_version = $this->codebase->getMajorAnalysisPhpVersion(); - $analysis_minor_php_version = $this->codebase->getMajorAnalysisPhpVersion(); + $analysis_minor_php_version = $this->codebase->getMinorAnalysisPhpVersion(); if ($docblock_info->since_php_major_version > $analysis_major_php_version) { return false; } @@ -1047,7 +1047,7 @@ final class FunctionLikeNodeScanner if ($docblock_info) { if ($docblock_info->since_php_major_version && !$this->aliases->namespace) { $analysis_major_php_version = $this->codebase->getMajorAnalysisPhpVersion(); - $analysis_minor_php_version = $this->codebase->getMajorAnalysisPhpVersion(); + $analysis_minor_php_version = $this->codebase->getMinorAnalysisPhpVersion(); if ($docblock_info->since_php_major_version > $analysis_major_php_version) { return false; }