Increaed phpstan level to 7

This commit is contained in:
Alejandro Celaya
2021-07-17 20:58:24 +02:00
parent 8efda2ef56
commit bceea090ed
9 changed files with 28 additions and 8 deletions

View File

@@ -17,8 +17,10 @@ class DropDefaultDomainFromRequestMiddleware implements MiddlewareInterface
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
/** @var array $body */
$body = $request->getParsedBody();
$request = $request->withQueryParams($this->sanitizeDomainFromPayload($request->getQueryParams()))
->withParsedBody($this->sanitizeDomainFromPayload($request->getParsedBody()));
->withParsedBody($this->sanitizeDomainFromPayload($body));
return $handler->handle($request);
}

View File

@@ -32,6 +32,7 @@ class OverrideDomainMiddleware implements MiddlewareInterface
$domain = $this->domainService->getDomain($domainId);
if ($requestMethod === RequestMethodInterface::METHOD_POST) {
/** @var array $payload */
$payload = $request->getParsedBody();
$payload[ShortUrlInputFilter::DOMAIN] = $domain->getAuthority();