Skip to content

Commit

Permalink
Use str_contains
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jan 4, 2024
1 parent a0d727a commit 880ffbc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Parser/RichParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 880ffbc

Please sign in to comment.