|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace hiapi\console; |
|
4
|
|
|
|
|
5
|
|
|
use Psr\Http\Message\ServerRequestInterface; |
|
6
|
|
|
use Psr\Http\Message\UriInterface; |
|
7
|
|
|
use Psr\Http\Message\StreamInterface; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* PSR-7 compatible console ServerRequest |
|
11
|
|
|
* |
|
12
|
|
|
* XXX |
|
13
|
|
|
* XXX NOT finished, NOT used |
|
14
|
|
|
* XXX |
|
15
|
|
|
* @ |
|
16
|
|
|
* @author Andrii Vasyliev <[email protected]> |
|
17
|
|
|
*/ |
|
18
|
|
|
class ServerRequest implements ServerRequestInterface |
|
19
|
|
|
{ |
|
20
|
|
|
|
|
21
|
|
|
protected $route; |
|
22
|
|
|
|
|
23
|
|
|
protected $params; |
|
24
|
|
|
|
|
25
|
|
|
public function getQueryParams() |
|
26
|
|
|
{ |
|
27
|
|
|
if ($this->params === null) { |
|
28
|
|
|
$this->params = $this->parseParams(); |
|
|
|
|
|
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
return $this->params; |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
protected function parseParams() |
|
35
|
|
|
{ |
|
36
|
|
|
if (isset($_SERVER['argv'])) { |
|
37
|
|
|
$args = $_SERVER['argv']; |
|
38
|
|
|
array_shift($this->_params); |
|
|
|
|
|
|
39
|
|
|
} else { |
|
40
|
|
|
$args = []; |
|
41
|
|
|
} |
|
42
|
|
|
foreach ($args as $arg) { |
|
43
|
|
|
var_dump($arg); |
|
|
|
|
|
|
44
|
|
|
} |
|
45
|
|
|
die; |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
public function getParsedBody() |
|
49
|
|
|
{ |
|
50
|
|
|
return []; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
public function getServerParams() |
|
54
|
|
|
{ |
|
55
|
|
|
throw new \Exception('not implemented'); |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
public function getCookieParams() |
|
59
|
|
|
{ |
|
60
|
|
|
throw new \Exception('not implemented'); |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
public function withCookieParams(array $cookies) |
|
64
|
|
|
{ |
|
65
|
|
|
throw new \Exception('not implemented'); |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
public function withQueryParams(array $query) |
|
69
|
|
|
{ |
|
70
|
|
|
throw new \Exception('not implemented'); |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
public function getUploadedFiles() |
|
74
|
|
|
{ |
|
75
|
|
|
throw new \Exception('not implemented'); |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
public function withUploadedFiles(array $uploadedFiles) |
|
79
|
|
|
{ |
|
80
|
|
|
throw new \Exception('not implemented'); |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
public function withParsedBody($data) |
|
84
|
|
|
{ |
|
85
|
|
|
throw new \Exception('not implemented'); |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
public function getAttributes() |
|
89
|
|
|
{ |
|
90
|
|
|
throw new \Exception('not implemented'); |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
public function getAttribute($name, $default = null) |
|
94
|
|
|
{ |
|
95
|
|
|
throw new \Exception('not implemented'); |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
public function withAttribute($name, $value) |
|
99
|
|
|
{ |
|
100
|
|
|
throw new \Exception('not implemented'); |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
public function withoutAttribute($name) |
|
104
|
|
|
{ |
|
105
|
|
|
throw new \Exception('not implemented'); |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
public function getRequestTarget() |
|
109
|
|
|
{ |
|
110
|
|
|
throw new \Exception('not implemented'); |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
public function withRequestTarget($requestTarget) |
|
114
|
|
|
{ |
|
115
|
|
|
throw new \Exception('not implemented'); |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
public function getMethod() |
|
119
|
|
|
{ |
|
120
|
|
|
throw new \Exception('not implemented'); |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
public function withMethod($method) |
|
124
|
|
|
{ |
|
125
|
|
|
throw new \Exception('not implemented'); |
|
126
|
|
|
} |
|
127
|
|
|
|
|
128
|
|
|
public function getUri() |
|
129
|
|
|
{ |
|
130
|
|
|
throw new \Exception('not implemented'); |
|
131
|
|
|
} |
|
132
|
|
|
|
|
133
|
|
|
public function withUri(UriInterface $uri, $preserveHost = false) |
|
134
|
|
|
{ |
|
135
|
|
|
throw new \Exception('not implemented'); |
|
136
|
|
|
} |
|
137
|
|
|
|
|
138
|
|
|
public function getProtocolVersion() |
|
139
|
|
|
{ |
|
140
|
|
|
throw new \Exception('not implemented'); |
|
141
|
|
|
} |
|
142
|
|
|
|
|
143
|
|
|
public function withProtocolVersion($version) |
|
144
|
|
|
{ |
|
145
|
|
|
throw new \Exception('not implemented'); |
|
146
|
|
|
} |
|
147
|
|
|
|
|
148
|
|
|
public function getHeaders() |
|
149
|
|
|
{ |
|
150
|
|
|
throw new \Exception('not implemented'); |
|
151
|
|
|
} |
|
152
|
|
|
|
|
153
|
|
|
public function hasHeader($name) |
|
154
|
|
|
{ |
|
155
|
|
|
throw new \Exception('not implemented'); |
|
156
|
|
|
} |
|
157
|
|
|
|
|
158
|
|
|
public function getHeader($name) |
|
159
|
|
|
{ |
|
160
|
|
|
throw new \Exception('not implemented'); |
|
161
|
|
|
} |
|
162
|
|
|
|
|
163
|
|
|
public function getHeaderLine($name) |
|
164
|
|
|
{ |
|
165
|
|
|
throw new \Exception('not implemented'); |
|
166
|
|
|
} |
|
167
|
|
|
|
|
168
|
|
|
public function withHeader($name, $value) |
|
169
|
|
|
{ |
|
170
|
|
|
throw new \Exception('not implemented'); |
|
171
|
|
|
} |
|
172
|
|
|
|
|
173
|
|
|
public function withAddedHeader($name, $value) |
|
174
|
|
|
{ |
|
175
|
|
|
throw new \Exception('not implemented'); |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
public function withoutHeader($name) |
|
179
|
|
|
{ |
|
180
|
|
|
throw new \Exception('not implemented'); |
|
181
|
|
|
} |
|
182
|
|
|
|
|
183
|
|
|
public function getBody() |
|
184
|
|
|
{ |
|
185
|
|
|
throw new \Exception('not implemented'); |
|
186
|
|
|
} |
|
187
|
|
|
|
|
188
|
|
|
public function withBody(StreamInterface $body) |
|
189
|
|
|
{ |
|
190
|
|
|
throw new \Exception('not implemented'); |
|
191
|
|
|
} |
|
192
|
|
|
} |
|
193
|
|
|
|
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.