vendor/http-interop/http-factory-guzzle/src/ServerRequestFactory.php line 22

Open in your IDE?
  1. <?php
  2. namespace Http\Factory\Guzzle;
  3. use GuzzleHttp\Psr7\ServerRequest;
  4. use Psr\Http\Message\ServerRequestFactoryInterface;
  5. use Psr\Http\Message\ServerRequestInterface;
  6. class ServerRequestFactory implements ServerRequestFactoryInterface
  7. {
  8.     public function createServerRequest(string $method$uri, array $serverParams = []): ServerRequestInterface
  9.     {
  10.         if (empty($method)) {
  11.             if (!empty($serverParams['REQUEST_METHOD'])) {
  12.                 $method $serverParams['REQUEST_METHOD'];
  13.             } else {
  14.                 throw new \InvalidArgumentException('Cannot determine HTTP method');
  15.             }
  16.         }
  17.         return new ServerRequest($method$uri, [], null'1.1'$serverParams);
  18.     }
  19. }