Skip to content

Commit 087d56f

Browse files
committed
Upgrade PHPStan to v0.12
1 parent 9d97db5 commit 087d56f

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
"infection/infection": "^0.13",
2424
"laminas/laminas-diactoros": "^2.2",
2525
"lcobucci/coding-standard": "^3.0",
26-
"phpstan/phpstan": "^0.11",
27-
"phpstan/phpstan-deprecation-rules": "^0.11",
28-
"phpstan/phpstan-phpunit": "^0.11",
29-
"phpstan/phpstan-strict-rules": "^0.11",
26+
"phpstan/phpstan": "^0.12",
27+
"phpstan/phpstan-deprecation-rules": "^0.12",
28+
"phpstan/phpstan-phpunit": "^0.12",
29+
"phpstan/phpstan-strict-rules": "^0.12",
3030
"phpunit/phpunit": "^8.2",
3131
"squizlabs/php_codesniffer": "^3.4"
3232
},

src/DebugInfoStrategy/NoTrace.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ public function extractDebugInfo(Throwable $error): ?array
2626
return $debugInfo;
2727
}
2828

29+
/**
30+
* @return Generator<array<string, string|int>>
31+
*/
2932
private function streamStack(?Throwable $previous): Generator
3033
{
3134
if ($previous === null) {

src/StatusCodeExtractionStrategy/ClassMap.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public function extractStatusCode(Throwable $error): int
4242
}
4343
}
4444

45-
return $error->getCode() ?: StatusCodeInterface::STATUS_INTERNAL_SERVER_ERROR;
45+
$code = $error->getCode();
46+
47+
return $code !== 0 ? $code : StatusCodeInterface::STATUS_INTERNAL_SERVER_ERROR;
4648
}
4749
}

tests/ErrorConversionMiddlewareTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function processShouldConvertTheExceptionIntoAnUnformattedResponseWithThe
9494
}
9595

9696
/**
97-
* @return array<string, array<Throwable|array<string, mixed>>>
97+
* @return array<string, array<Throwable|int|array<string, mixed>>>
9898
*/
9999
public function possibleConversions(): iterable
100100
{

0 commit comments

Comments
 (0)