示例#1
0
 /**
  * Constructor.
  *
  * @param null|array $serverParams  Optional; the server parameters
  * @param null|array $cookieParams  Optional; the cookies, if any
  * @param null|array $queryParams   Optional; the query parameters, if any
  * @param null|array $uploadedFiles Optional; the uploaded files, if any
  * @param null|array $attributes    Optional; the application-specified attributes
  *
  * <!-- -->
  * @param null|array|object $parsedBody Optional; the parsed body
  *
  * <!-- -->
  * @param null|string|resource|\Psr\Http\Message\StreamInterface $body Optional; the body
  *
  * <!-- -->
  * @param null|array $headers Optional; the headers
  *
  * <!-- -->
  * @param null|string|\Psr\Http\Message\UriInterface $uri Optional; the URI
  *
  * <!-- -->
  * @param null|string $method   Optional; the request method
  * @param null|string $protocol Optional; the HTTP protocol version
  */
 public function __construct(array $serverParams = null, array $cookieParams = null, array $queryParams = null, array $uploadedFiles = null, array $attributes = null, $parsedBody = null, $body = null, array $headers = null, $uri = null, $method = null, $protocol = null)
 {
     $this->serverParams = (array) $serverParams;
     $this->cookieParams = (array) $cookieParams;
     $this->queryParams = (array) $queryParams;
     $this->attributes = (array) $attributes;
     $this->setParsedBody($parsedBody)->setUploadedFiles((array) $uploadedFiles);
     if (null === $body) {
         $body = 'php://input';
     }
     parent::__construct($body, $headers, $uri, $method, $protocol);
 }
示例#2
0
 public function testGetUriReturnsInstanceOfUriInterface()
 {
     $request = new Request();
     $this->assertInstanceOf('Psr\\Http\\Message\\UriInterface', $request->getUri());
 }