4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Bridge\PsrHttpMessage\Tests\Fixtures;
14 use Psr\Http\Message\ServerRequestInterface;
15 use Psr\Http\Message\StreamInterface;
16 use Psr\Http\Message\UriInterface;
19 * @author Kévin Dunglas <dunglas@gmail.com>
21 class ServerRequest extends Message implements ServerRequestInterface
23 private $requestTarget;
29 private $uploadedFiles;
33 public function __construct($version = '1.1', array $headers = array(), StreamInterface $body = null, $requestTarget = '/', $method = 'GET', $uri = null, array $server = array(), array $cookies = array(), array $query = array(), array $uploadedFiles = array(), $data = null, array $attributes = array())
35 parent::__construct($version, $headers, $body);
37 $this->requestTarget = $requestTarget;
38 $this->method = $method;
40 $this->server = $server;
41 $this->cookies = $cookies;
42 $this->query = $query;
43 $this->uploadedFiles = $uploadedFiles;
45 $this->attributes = $attributes;
48 public function getRequestTarget()
50 return $this->requestTarget;
53 public function withRequestTarget($requestTarget)
55 throw new \BadMethodCallException('Not implemented.');
58 public function getMethod()
63 public function withMethod($method)
67 public function getUri()
72 public function withUri(UriInterface $uri, $preserveHost = false)
74 throw new \BadMethodCallException('Not implemented.');
77 public function getServerParams()
82 public function getCookieParams()
84 return $this->cookies;
87 public function withCookieParams(array $cookies)
89 throw new \BadMethodCallException('Not implemented.');
92 public function getQueryParams()
97 public function withQueryParams(array $query)
99 throw new \BadMethodCallException('Not implemented.');
102 public function getUploadedFiles()
104 return $this->uploadedFiles;
107 public function withUploadedFiles(array $uploadedFiles)
109 throw new \BadMethodCallException('Not implemented.');
112 public function getParsedBody()
117 public function withParsedBody($data)
119 throw new \BadMethodCallException('Not implemented.');
122 public function getAttributes()
124 return $this->attributes;
127 public function getAttribute($name, $default = null)
129 return isset($this->attributes[$name]) ? $this->attributes[$name] : $default;
132 public function withAttribute($name, $value)
134 throw new \BadMethodCallException('Not implemented.');
137 public function withoutAttribute($name)
139 throw new \BadMethodCallException('Not implemented.');