Example #1
0
 /**
  * Class init
  *
  * @param   array                            $serverParams   Server parameters, typically from $_SERVER
  * @param   array                            $uploadedFiles  Upload file information, a tree of UploadedFiles
  * @param   string                           $uri            URI for the request, if any.
  * @param   string                           $method         HTTP method for the request, if any.
  * @param   string|resource|StreamInterface  $body           Message body, if any.
  * @param   array                            $headers        Headers for the message, if any.
  *
  * @throws \InvalidArgumentException
  */
 public function __construct(array $serverParams = array(), array $uploadedFiles = array(), $uri = null, $method = null, $body = 'php://input', array $headers = array())
 {
     if (!ServerHelper::validateUploadedFiles($uploadedFiles)) {
         throw new \InvalidArgumentException('Invalid uploaded files, every file should be an UploadedInterface');
     }
     if ($body == 'php://input') {
         $body = new PhpInputStream();
     }
     $this->serverParams = $serverParams;
     $this->uploadedFiles = $uploadedFiles;
     parent::__construct($uri, $method, $body, $headers);
 }