Fixed some phpstan errors

This commit is contained in:
Alejandro Celaya 2021-07-19 18:35:42 +02:00
parent bceea090ed
commit b8fa234dbb
4 changed files with 4 additions and 7 deletions

View File

@ -27,6 +27,7 @@ class EditShortUrlTagsAction extends AbstractRestAction
public function handle(Request $request): Response
{
/** @var array $bodyParams */
$bodyParams = $request->getParsedBody();
if (! isset($bodyParams['tags'])) {

View File

@ -20,15 +20,9 @@ class CreateTagsAction extends AbstractRestAction
{
}
/**
* Process an incoming server request and return a response, optionally delegating
* to the next middleware component to create the response.
*
*
* @throws \InvalidArgumentException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
/** @var array $body */
$body = $request->getParsedBody();
$tags = $body['tags'] ?? [];

View File

@ -23,6 +23,7 @@ class UpdateTagAction extends AbstractRestAction
public function handle(ServerRequestInterface $request): ResponseInterface
{
/** @var array $body */
$body = $request->getParsedBody();
$apiKey = AuthenticationMiddleware::apiKeyFromRequest($request);

View File

@ -18,6 +18,7 @@ class DefaultShortCodesLengthMiddleware implements MiddlewareInterface
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
/** @var array $body */
$body = $request->getParsedBody();
if (! isset($body[ShortUrlInputFilter::SHORT_CODE_LENGTH])) {
$body[ShortUrlInputFilter::SHORT_CODE_LENGTH] = $this->defaultShortCodesLength;