Total Complexity | 5 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
12 | class DropDefaultDomainFromRequestMiddleware implements MiddlewareInterface |
||
13 | { |
||
14 | private string $defaultDomain; |
||
15 | |||
16 | 5 | public function __construct(string $defaultDomain) |
|
19 | } |
||
20 | |||
21 | 5 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
22 | { |
||
23 | 5 | $request = $request->withQueryParams($this->sanitizeDomainFromPayload($request->getQueryParams())) |
|
24 | 5 | ->withParsedBody($this->sanitizeDomainFromPayload($request->getParsedBody())); |
|
|
|||
25 | |||
26 | 5 | return $handler->handle($request); |
|
27 | } |
||
28 | |||
29 | 5 | private function sanitizeDomainFromPayload(array $payload): array |
|
36 | } |
||
37 | } |
||
38 |