Skip to content
This repository has been archived by the owner on Jan 17, 2022. It is now read-only.

Commit

Permalink
build(phpstan): Upgrade PHPStan to newest version (#137)
Browse files Browse the repository at this point in the history
Small refactor occured due to PHPStan and all deps version bump
  • Loading branch information
k911 authored Jul 5, 2018
1 parent 04a7dcc commit 19b5a3c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
14 changes: 2 additions & 12 deletions Bridge/Symfony/HttpFoundation/RequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace App\Bundle\SwooleBundle\Bridge\Symfony\HttpFoundation;

use Swoole\Http\Request as SwooleRequest;
use Symfony\Component\HttpFoundation\ParameterBag;
use Symfony\Component\HttpFoundation\Request as HttpFoundationRequest;

final class RequestFactory implements RequestFactoryInterface
Expand All @@ -22,23 +21,14 @@ public function make(SwooleRequest $request): HttpFoundationRequest
$server['HTTP_'.\mb_strtoupper(\str_replace('-', '_', $key))] = $value;
}

$httpFoundationRequest = new HttpFoundationRequest(
return new HttpFoundationRequest(
$request->get ?? [],
$request->post ?? [],
[],
$request->cookie ?? [],
$request->files ?? [],
$server,
$request->rawcontent()
$request->rawContent()
);

if (0 === \mb_strpos($httpFoundationRequest->headers->get('content-type', ''), 'application/x-www-form-urlencoded')
&& \in_array(\mb_strtoupper($httpFoundationRequest->server->get('REQUEST_METHOD', 'GET')), ['PUT', 'DELETE', 'PATCH'])
) {
\parse_str($httpFoundationRequest->getContent(), $data);
$httpFoundationRequest->request = new ParameterBag($data);
}

return $httpFoundationRequest;
}
}
2 changes: 0 additions & 2 deletions Command/ServerProfileCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ protected function configure(): void
* {@inheritdoc}
*
* @throws \OutOfRangeException
* @throws \Psr\Container\NotFoundExceptionInterface
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Symfony\Component\Console\Exception\InvalidArgumentException
* @throws \InvalidArgumentException
* @throws \Exception
Expand Down
2 changes: 0 additions & 2 deletions Command/ServerRunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ protected function configure(): void
/**
* {@inheritdoc}
*
* @throws \Psr\Container\NotFoundExceptionInterface
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Symfony\Component\Console\Exception\InvalidArgumentException
* @throws \InvalidArgumentException
* @throws \Exception
Expand Down

0 comments on commit 19b5a3c

Please sign in to comment.