1 | <?php |
||
23 | class Request extends Message implements RequestInterface |
||
24 | { |
||
25 | /** @var string The request target. */ |
||
26 | private $requestTarget; |
||
27 | |||
28 | /** @var string The method. */ |
||
29 | private $method; |
||
30 | |||
31 | /** @var UriInterface The URI. */ |
||
32 | private $uri; |
||
33 | |||
34 | /** |
||
35 | * Construct a Request object with the given method, uri, version, headers & body. |
||
36 | * |
||
37 | * @param string $method |
||
38 | * @param UriInterface $uri |
||
39 | * @param string $version = self::DEFAULT_VERSION |
||
40 | * @param array $headers = [] |
||
41 | * @param StreamInterface|null $body = null |
||
42 | */ |
||
43 | 22 | public function __construct($method, UriInterface $uri, $version = self::DEFAULT_VERSION, array $headers = [], StreamInterface $body = null) |
|
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | 2 | public function getRequestTarget() |
|
68 | |||
69 | /** |
||
70 | * Set the request target. |
||
71 | * |
||
72 | * @param string $requestTarget |
||
73 | * @return $this |
||
74 | */ |
||
75 | 1 | private function setRequestTarget($requestTarget) |
|
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | 1 | public function withRequestTarget($requestTarget) |
|
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | */ |
||
95 | 5 | public function getMethod() |
|
99 | |||
100 | /** |
||
101 | * Set the method. |
||
102 | * |
||
103 | * @param string $method |
||
104 | * @return $this |
||
105 | */ |
||
106 | 22 | private function setMethod($method) |
|
112 | |||
113 | /** |
||
114 | * {@inheritdoc} |
||
115 | */ |
||
116 | 1 | public function withMethod($method) |
|
122 | |||
123 | /** |
||
124 | * {@inheritdoc} |
||
125 | */ |
||
126 | 3 | public function getUri() |
|
130 | |||
131 | /** |
||
132 | * Set the uri. |
||
133 | * |
||
134 | * @param UriInterface $uri |
||
135 | * @param boolean $preserveHost = false |
||
136 | * @return $this |
||
137 | */ |
||
138 | 22 | private function setUri(UriInterface $uri, $preserveHost = false) |
|
152 | |||
153 | /** |
||
154 | * {@inheritdoc} |
||
155 | */ |
||
156 | 1 | public function withUri(UriInterface $uri, $preserveHost = false) |
|
162 | } |
||
163 |