1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Use analysis_php_version_id instead of config->getPhpVersion()

This commit is contained in:
Pere Orga 2023-03-08 20:33:55 +01:00
parent 17939eda04
commit 187c214f58

View File

@ -47,8 +47,7 @@ class HtmlFunctionTainter implements AddTaintsInterface, RemoveTaintsInterface
$second_arg = $item->getArgs()[1]->value ?? null;
if ($second_arg === null) {
$php_version = $statements_analyzer->getCodebase()->config->getPhpVersion();
if ($php_version !== null && version_compare($php_version, '8.1', '>=')) {
if ($statements_analyzer->getCodebase()->analysis_php_version_id >= 8_01_00) {
return ['html', 'has_quotes'];
}
return ['html'];
@ -100,8 +99,7 @@ class HtmlFunctionTainter implements AddTaintsInterface, RemoveTaintsInterface
$second_arg = $item->getArgs()[1]->value ?? null;
if ($second_arg === null) {
$php_version = $statements_analyzer->getCodebase()->config->getPhpVersion();
if ($php_version !== null && version_compare($php_version, '8.1', '>=')) {
if ($statements_analyzer->getCodebase()->analysis_php_version_id >= 8_01_00) {
return ['html', 'has_quotes'];
}
return ['html'];