Bugfix: PHPStan kommt damit nicht klar
This commit is contained in:
@@ -47,12 +47,16 @@ class ErrorHandlerTest extends Unit
|
||||
/** @noinspection PhpFieldAssignmentTypeMismatchInspection */
|
||||
$this->request = $this->makeEmpty(ServerRequestInterface::class, [
|
||||
'getAttribute' => function ($name) {
|
||||
return match ($name) {
|
||||
RouteContext::ROUTE_PARSER => $this->makeEmpty(RouteParserInterface::class),
|
||||
RouteContext::ROUTING_RESULTS => $this->makeEmpty(RoutingResults::class),
|
||||
default => null,
|
||||
};
|
||||
/** @noinspection PhpSwitchCanBeReplacedWithMatchExpressionInspection */
|
||||
switch ($name) {
|
||||
case RouteContext::ROUTE_PARSER:
|
||||
return $this->makeEmpty(RouteParserInterface::class);
|
||||
case RouteContext::ROUTING_RESULTS:
|
||||
return $this->makeEmpty(RoutingResults::class);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user