Version 1
[yaffs-website] / vendor / symfony / psr-http-message-bridge / Tests / Fixtures / ServerRequest.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Bridge\PsrHttpMessage\Tests\Fixtures;
13
14 use Psr\Http\Message\ServerRequestInterface;
15 use Psr\Http\Message\StreamInterface;
16 use Psr\Http\Message\UriInterface;
17
18 /**
19  * @author Kévin Dunglas <dunglas@gmail.com>
20  */
21 class ServerRequest extends Message implements ServerRequestInterface
22 {
23     private $requestTarget;
24     private $method;
25     private $uri;
26     private $server;
27     private $cookies;
28     private $query;
29     private $uploadedFiles;
30     private $data;
31     private $attributes;
32
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())
34     {
35         parent::__construct($version, $headers, $body);
36
37         $this->requestTarget = $requestTarget;
38         $this->method = $method;
39         $this->uri = $uri;
40         $this->server = $server;
41         $this->cookies = $cookies;
42         $this->query = $query;
43         $this->uploadedFiles = $uploadedFiles;
44         $this->data = $data;
45         $this->attributes = $attributes;
46     }
47
48     public function getRequestTarget()
49     {
50         return $this->requestTarget;
51     }
52
53     public function withRequestTarget($requestTarget)
54     {
55         throw new \BadMethodCallException('Not implemented.');
56     }
57
58     public function getMethod()
59     {
60         return $this->method;
61     }
62
63     public function withMethod($method)
64     {
65     }
66
67     public function getUri()
68     {
69         return $this->uri;
70     }
71
72     public function withUri(UriInterface $uri, $preserveHost = false)
73     {
74         throw new \BadMethodCallException('Not implemented.');
75     }
76
77     public function getServerParams()
78     {
79         return $this->server;
80     }
81
82     public function getCookieParams()
83     {
84         return $this->cookies;
85     }
86
87     public function withCookieParams(array $cookies)
88     {
89         throw new \BadMethodCallException('Not implemented.');
90     }
91
92     public function getQueryParams()
93     {
94         return $this->query;
95     }
96
97     public function withQueryParams(array $query)
98     {
99         throw new \BadMethodCallException('Not implemented.');
100     }
101
102     public function getUploadedFiles()
103     {
104         return $this->uploadedFiles;
105     }
106
107     public function withUploadedFiles(array $uploadedFiles)
108     {
109         throw new \BadMethodCallException('Not implemented.');
110     }
111
112     public function getParsedBody()
113     {
114         return $this->data;
115     }
116
117     public function withParsedBody($data)
118     {
119         throw new \BadMethodCallException('Not implemented.');
120     }
121
122     public function getAttributes()
123     {
124         return $this->attributes;
125     }
126
127     public function getAttribute($name, $default = null)
128     {
129         return isset($this->attributes[$name]) ? $this->attributes[$name] : $default;
130     }
131
132     public function withAttribute($name, $value)
133     {
134         throw new \BadMethodCallException('Not implemented.');
135     }
136
137     public function withoutAttribute($name)
138     {
139         throw new \BadMethodCallException('Not implemented.');
140     }
141 }