| Total Complexity | 3 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Coverage | 70% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | final class WebControllerService |
||
| 14 | { |
||
| 15 | private ResponseFactoryInterface $responseFactory; |
||
| 16 | private UrlGeneratorInterface $urlGenerator; |
||
| 17 | |||
| 18 | 10 | public function __construct(ResponseFactoryInterface $responseFactory, UrlGeneratorInterface $urlGenerator) |
|
| 19 | { |
||
| 20 | 10 | $this->responseFactory = $responseFactory; |
|
| 21 | 10 | $this->urlGenerator = $urlGenerator; |
|
| 22 | } |
||
| 23 | |||
| 24 | 2 | public function getRedirectResponse(string $url): ResponseInterface |
|
| 25 | { |
||
| 26 | 2 | return $this->responseFactory |
|
| 27 | 2 | ->createResponse(Status::FOUND) |
|
| 28 | 2 | ->withHeader(Header::LOCATION, $this->urlGenerator->generate($url)); |
|
| 29 | } |
||
| 30 | |||
| 31 | public function getNotFoundResponse(): ResponseInterface |
||
| 35 | } |
||
| 36 | } |
||
| 37 |