1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 13:51:54 +01:00

Fix version comparison for @since

Refs vimeo/psalm#10761
This commit is contained in:
Bruce Weirdan 2024-03-01 01:36:53 +01:00
parent 71707e6c4e
commit 97b22ecdfd

View File

@ -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;
}