Skip to content

Commit 27028a5

Browse files
✨ Migrate to PHPStan 2
1 parent b4b61f6 commit 27028a5

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

phpstan.neon

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
parameters:
22
level: 7
3-
checkGenericClassInNonGenericObjectType: false
43
paths:
54
- src
5+
ignoreErrors:
6+
-
7+
identifier: missingType.generics

src/Helpers/Parser.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ public static function findClassName(?string $fileContent): ?string
4444

4545
$namespace = null;
4646
if (preg_match('#(^|\s)namespace(.*?)\s*;#sm', $fileContent, $m)) {
47+
// @phpstan-ignore-next-line
4748
$namespace = $m[2] ?? null;
49+
50+
// @phpstan-ignore-next-line
4851
$namespace = $namespace !== null ? trim($namespace) : null;
4952
}
5053

src/RouteLoader.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ public function register(): void
151151
protected function buildRouteArgs(Route $route): array
152152
{
153153
$actions = [];
154-
$isDebug = $this->options?->debug ?? false;
154+
$isDebug = $this->options?->debug;
155+
if ($isDebug === null) {
156+
$isDebug = false;
157+
}
158+
155159
foreach ($route->actions as $action) {
156160
$actions[] = [
157161
'methods' => $action->methods,

0 commit comments

Comments
 (0)