Lines
100.00%
3 / 3
Methods
100.00%
2 / 2
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| __invoke | 100.00% | 2 / 2 | 100.00% | 1 / 1 | 1 | ||
| 13 | final readonly class HomeController | |
| 14 | { | |
| 15 | public function __construct( | |
| 16 | private RouteParserInterface $routeParser, | |
| 17 | private ResponseFactory $responseFactory, | |
| 18 | ) { | |
| 19 | } | |
| 20 | ||
| 21 | /** | |
| 22 | * @param array<string, string> $args | |
| 23 | */ | |
| 24 | // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter | |
| 25 | public function __invoke(Request $request, Response $response, array $args): Response | |
| 26 | { | |
| 27 | $url = $this->routeParser->relativeUrlFor("list"); | |
| 28 | return $this->responseFactory->createResponse(StatusCode::STATUS_FOUND)->withHeader("Location", $url); | |
| 29 | } | |
| 30 | } |