Request.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @package Grav\Framework\Psr7
  5. *
  6. * @copyright Copyright (c) 2015 - 2022 Trilby Media, LLC. All rights reserved.
  7. * @license MIT License; see LICENSE file for details.
  8. */
  9. namespace Grav\Framework\Psr7;
  10. use Grav\Framework\Psr7\Traits\RequestDecoratorTrait;
  11. use Psr\Http\Message\RequestInterface;
  12. use Psr\Http\Message\StreamInterface;
  13. use Psr\Http\Message\UriInterface;
  14. class Request implements RequestInterface
  15. {
  16. use RequestDecoratorTrait;
  17. /**
  18. * @param string $method HTTP method
  19. * @param string|UriInterface $uri URI
  20. * @param array $headers Request headers
  21. * @param string|null|resource|StreamInterface $body Request body
  22. * @param string $version Protocol version
  23. */
  24. public function __construct(string $method, $uri, array $headers = [], $body = null, string $version = '1.1')
  25. {
  26. $this->message = new \Nyholm\Psr7\Request($method, $uri, $headers, $body, $version);
  27. }
  28. }