bugfix/rest-api-phpstan #21

Merged
TorstenHettstedt merged 2 commits from bugfix/rest-api-phpstan into master 2021-12-15 19:50:36 +01:00
Showing only changes of commit 371425f3c5 - Show all commits
+10 -6
View File
@@ -46,13 +46,17 @@ 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,
};
'getAttribute' => function ($name) {
/** @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;
}
},
]);
}