Skip to content

Commit 905c83e

Browse files
committed
Update PHPStan
1 parent 532e938 commit 905c83e

File tree

4 files changed

+51
-43
lines changed

4 files changed

+51
-43
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
"laminas/laminas-diactoros": "^2.8",
3131
"lcobucci/coding-standard": "^8.0",
3232
"phpstan/extension-installer": "^1.1",
33-
"phpstan/phpstan": "^0.12",
34-
"phpstan/phpstan-deprecation-rules": "^0.12",
35-
"phpstan/phpstan-phpunit": "^0.12",
36-
"phpstan/phpstan-strict-rules": "^0.12",
33+
"phpstan/phpstan": "^1.4",
34+
"phpstan/phpstan-deprecation-rules": "^1.0",
35+
"phpstan/phpstan-phpunit": "^1.0",
36+
"phpstan/phpstan-strict-rules": "^1.1",
3737
"phpunit/phpunit": "^9.5"
3838
},
3939
"autoload": {

composer.lock

Lines changed: 38 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/StatusCodeExtractionStrategy/ClassMap.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Lcobucci\ErrorHandling\StatusCodeExtractionStrategy;
99
use Throwable;
1010

11+
use function assert;
12+
use function is_int;
13+
1114
final class ClassMap implements StatusCodeExtractionStrategy
1215
{
1316
private const DEFAULT_MAP = [
@@ -35,6 +38,7 @@ public function extractStatusCode(Throwable $error): int
3538
}
3639

3740
$code = $error->getCode();
41+
assert(is_int($code));
3842

3943
return $code !== 0 ? $code : StatusCodeInterface::STATUS_INTERNAL_SERVER_ERROR;
4044
}

tests/ErrorConversionMiddlewareTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,12 @@ public function processShouldKeepOriginalErrorAsResponseAttribute(): void
185185
public function processShouldAddDebugInfoData(): void
186186
{
187187
$response = $this->handleProcessWithError(new ServerRequest(), new RuntimeException(), new NoTrace());
188-
189188
self::assertInstanceOf(UnformattedResponse::class, $response);
190-
self::assertArrayHasKey('_debug', $response->getUnformattedContent());
189+
190+
$unformattedContent = $response->getUnformattedContent();
191+
192+
self::assertIsArray($unformattedContent);
193+
self::assertArrayHasKey('_debug', $unformattedContent);
191194
}
192195

193196
/**

0 commit comments

Comments
 (0)