From 880ffbcd163b58113825bc287e5ec28f39c72874 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Wed, 3 Jan 2024 19:59:21 +0100 Subject: [PATCH] Use str_contains --- src/Parser/RichParser.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Parser/RichParser.php b/src/Parser/RichParser.php index 710dd120fc..008c2dc601 100644 --- a/src/Parser/RichParser.php +++ b/src/Parser/RichParser.php @@ -12,6 +12,7 @@ use PHPStan\ShouldNotHappenException; use function array_filter; use function is_string; +use function str_contains; use function strpos; use function substr; use function substr_count; @@ -112,9 +113,9 @@ private function getLinesToIgnore(array $tokens): array $this->getLinesToIgnoreForTokenByIgnoreComment($text, $line, '@phpstan-ignore-line'); } else { - if (strpos($text, '@phpstan-ignore-next-line') !== false) { + if (str_contains($text, '@phpstan-ignore-next-line')) { $line++; - } elseif (strpos($text, '@phpstan-ignore-line') === false) { + } elseif (!str_contains($text, '@phpstan-ignore-line')) { continue; }