From 187c214f584974a322b1eefebf7b7c206b254c02 Mon Sep 17 00:00:00 2001 From: Pere Orga Date: Wed, 8 Mar 2023 20:33:55 +0100 Subject: [PATCH] Use analysis_php_version_id instead of config->getPhpVersion() --- .../Provider/AddRemoveTaints/HtmlFunctionTainter.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Psalm/Internal/Provider/AddRemoveTaints/HtmlFunctionTainter.php b/src/Psalm/Internal/Provider/AddRemoveTaints/HtmlFunctionTainter.php index 064fb7e2c..c7d404260 100644 --- a/src/Psalm/Internal/Provider/AddRemoveTaints/HtmlFunctionTainter.php +++ b/src/Psalm/Internal/Provider/AddRemoveTaints/HtmlFunctionTainter.php @@ -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'];