Skip to content

Commit

Permalink
csfix
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosas committed Feb 1, 2025
1 parent c779bf1 commit 8548955
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Statement/Builder/DeclarationStatementBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ private function extractRuleName(string $fullName): string
$sanitized = is_string($sanitized = preg_replace('/[^a-zA-Z0-9.]/', '', $sanitized)) ? $sanitized : $randomName;
$sanitized = is_string($sanitized = preg_replace('/\.+/', '.', $sanitized)) ? $sanitized : $randomName;

return trim($sanitized, '.');
return mb_trim($sanitized, '.');
}
}
2 changes: 1 addition & 1 deletion src/Statement/Builder/RelationStatementBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ private function extractRuleName(string $fullName): string
$sanitized = is_string($sanitized = preg_replace('/[^a-zA-Z0-9.]/', '', $sanitized)) ? $sanitized : $randomName;
$sanitized = is_string($sanitized = preg_replace('/\.+/', '.', $sanitized)) ? $sanitized : $randomName;

return trim($sanitized, '.');
return mb_trim($sanitized, '.');
}
}
4 changes: 2 additions & 2 deletions src/Test/TestExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __invoke(): iterable
}

/**
* @param class-string $test
* @param class-string $test
* @return null|\ReflectionClass<object>
*/
private function reflectTest(string $test): ?\ReflectionClass
Expand All @@ -48,7 +48,7 @@ private function reflectTest(string $test): ?\ReflectionClass
return null;
}

/** @var \ReflectionClass<object> $classReflection */
// @var \ReflectionClass<object> $classReflection
return $classReflection;

Check failure on line 52 in src/Test/TestExtractor.php

View workflow job for this annotation

GitHub Actions / Static Code and Architecture analysis (8.4, highest)

Method PHPat\Test\TestExtractor::reflectTest() should return ReflectionClass<object>|null but returns PHPStan\BetterReflection\Reflection\Adapter\ReflectionClass|PHPStan\BetterReflection\Reflection\Adapter\ReflectionEnum.
}
}

0 comments on commit 8548955

Please sign in to comment.