@@ -41,7 +41,7 @@ |
||
41 | 41 | * ServerRequest constructor. |
42 | 42 | * @param string $uri |
43 | 43 | * @param string $method |
44 | - * @param array $server |
|
44 | + * @param string $server |
|
45 | 45 | */ |
46 | 46 | public function __construct($uri = '/', $method = 'GET', $server = []) |
47 | 47 | { |
@@ -64,7 +64,7 @@ |
||
64 | 64 | 'REMOTE_ADDR' => '127.0.0.1', |
65 | 65 | 'SERVER_PROTOCOL' => 'HTTP/1.1', |
66 | 66 | 'REQUEST_TIME' => time(), |
67 | - 'REQUEST_URI' => (string)$uri, |
|
67 | + 'REQUEST_URI' => (string) $uri, |
|
68 | 68 | 'REQUEST_METHOD' => $method |
69 | 69 | ], $_SERVER); |
70 | 70 |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | /** |
132 | 132 | * {@inheritdoc} |
133 | 133 | * |
134 | - * @return int|null The file size in bytes or null if unknown. |
|
134 | + * @return integer The file size in bytes or null if unknown. |
|
135 | 135 | */ |
136 | 136 | public function getSize() |
137 | 137 | { |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | /** |
153 | 153 | * {@inheritdoc} |
154 | 154 | * |
155 | - * @return string|null The filename sent by the client or null if none |
|
155 | + * @return string The filename sent by the client or null if none |
|
156 | 156 | * was provided. |
157 | 157 | */ |
158 | 158 | public function getClientFilename() |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | /** |
164 | 164 | * {@inheritdoc} |
165 | 165 | * |
166 | - * @return string|null The media type sent by the client or null if none |
|
166 | + * @return string The media type sent by the client or null if none |
|
167 | 167 | * was provided. |
168 | 168 | */ |
169 | 169 | public function getClientMediaType() |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | /** |
134 | 134 | * {@inheritdoc} |
135 | 135 | * |
136 | - * @return null|int The URI port. |
|
136 | + * @return integer The URI port. |
|
137 | 137 | */ |
138 | 138 | public function getPort() |
139 | 139 | { |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | } |
311 | 311 | |
312 | 312 | /** |
313 | - * @param $uri |
|
313 | + * @param string $uri |
|
314 | 314 | */ |
315 | 315 | protected function format($uri) |
316 | 316 | { |
@@ -371,8 +371,8 @@ discard block |
||
371 | 371 | } |
372 | 372 | |
373 | 373 | /** |
374 | - * @param $scheme |
|
375 | - * @param $port |
|
374 | + * @param string $scheme |
|
375 | + * @param integer $port |
|
376 | 376 | * @return bool |
377 | 377 | */ |
378 | 378 | protected function isStandardPort($scheme, $port) |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | } |
392 | 392 | |
393 | 393 | /** |
394 | - * @param $key |
|
394 | + * @param string $key |
|
395 | 395 | * @param $value |
396 | 396 | * @return static |
397 | 397 | */ |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function withScheme($scheme) |
188 | 188 | { |
189 | - $scheme = str_replace('://', '', strtolower((string)$scheme)); |
|
189 | + $scheme = str_replace('://', '', strtolower((string) $scheme)); |
|
190 | 190 | |
191 | 191 | if (!empty($scheme) && !array_key_exists($scheme, $this->schemes)) { |
192 | 192 | throw new InvalidArgumentException('Invalid scheme provided.'); |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | throw new InvalidArgumentException('Invalid port specified'); |
239 | 239 | } |
240 | 240 | |
241 | - return $this->_clone('port', (int)$port); |
|
241 | + return $this->_clone('port', (int) $port); |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | /** |
@@ -97,6 +97,6 @@ |
||
97 | 97 | */ |
98 | 98 | public function __toString() |
99 | 99 | { |
100 | - return (string)$this->getBody(); |
|
100 | + return (string) $this->getBody(); |
|
101 | 101 | } |
102 | 102 | } |
@@ -108,7 +108,7 @@ |
||
108 | 108 | public function withStatus($code, $reasonPhrase = '') |
109 | 109 | { |
110 | 110 | $instance = clone $this; |
111 | - $code = (int)$code; |
|
111 | + $code = (int) $code; |
|
112 | 112 | if (is_float($code) || $code < 100 || $code >= 600) { |
113 | 113 | throw new \InvalidArgumentException(sprintf('Invalid status code %d', $code)); |
114 | 114 | } |
@@ -119,7 +119,7 @@ |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | $instance = clone $this; |
122 | - $instance->headers[$name] = array_filter((array)$value); |
|
122 | + $instance->headers[$name] = array_filter((array) $value); |
|
123 | 123 | return $instance; |
124 | 124 | } |
125 | 125 |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | foreach (new GlobIterator($this->path . '/*.*') as $file) { |
99 | 99 | |
100 | - if($config = $this->getType($file)) { |
|
100 | + if ($config = $this->getType($file)) { |
|
101 | 101 | $this->configs[$config[0]] = $config[1]; |
102 | 102 | } |
103 | 103 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $extension = $file->getExtension(); |
113 | 113 | $name = $file->getBasename(".$extension"); |
114 | 114 | |
115 | - $type = array_filter($this->types, function ($n) use ($extension) { |
|
115 | + $type = array_filter($this->types, function($n) use ($extension) { |
|
116 | 116 | return in_array($extension, $n::$extensions); |
117 | 117 | }); |
118 | 118 |