Skip to content

Commit 880ffbc

Browse files
committed
Use str_contains
1 parent a0d727a commit 880ffbc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Parser/RichParser.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use PHPStan\ShouldNotHappenException;
1313
use function array_filter;
1414
use function is_string;
15+
use function str_contains;
1516
use function strpos;
1617
use function substr;
1718
use function substr_count;
@@ -112,9 +113,9 @@ private function getLinesToIgnore(array $tokens): array
112113
$this->getLinesToIgnoreForTokenByIgnoreComment($text, $line, '@phpstan-ignore-line');
113114

114115
} else {
115-
if (strpos($text, '@phpstan-ignore-next-line') !== false) {
116+
if (str_contains($text, '@phpstan-ignore-next-line')) {
116117
$line++;
117-
} elseif (strpos($text, '@phpstan-ignore-line') === false) {
118+
} elseif (!str_contains($text, '@phpstan-ignore-line')) {
118119
continue;
119120
}
120121

0 commit comments

Comments
 (0)