Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Rules/ClassForbiddenNameCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ public function checkClassNames(array $pairs): array
$projectName = $project;
$withoutPrefixClassName = substr($className, strlen($prefix));

if (strpos($withoutPrefixClassName, '\\') === false) {
$pos = strpos($withoutPrefixClassName, '\\');
if ($pos === false) {
continue;
}

$withoutPrefixClassName = substr($withoutPrefixClassName, strpos($withoutPrefixClassName, '\\'));
$withoutPrefixClassName = substr($withoutPrefixClassName, $pos);
}

if ($projectName === null) {
Expand Down
4 changes: 2 additions & 2 deletions src/Testing/TypeInferenceTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
use function is_string;
use function preg_match;
use function sprintf;
use function str_starts_with;
use function stripos;
use function strpos;
use function strtolower;
use function version_compare;
use const PHP_VERSION;
Expand Down Expand Up @@ -424,7 +424,7 @@ private static function isFileLintSkipped(string $file): bool
}

// ignore shebang line
if (strpos($firstLine, '#!') === 0) {
if (str_starts_with($firstLine, '#!')) {
$firstLine = fgets($f);
if ($firstLine === false) {
return false;
Expand Down
Loading