@@ -11,6 +11,7 @@ discard block |
||
11 | 11 | * Retrieve the parameters from the URI |
12 | 12 | * |
13 | 13 | * @param type name description |
14 | + * @param null|string $uri |
|
14 | 15 | * @return type description |
15 | 16 | */ |
16 | 17 | public static function getQueryParams($uri, $serialized = true) |
@@ -64,7 +65,6 @@ discard block |
||
64 | 65 | /** |
65 | 66 | * Serializes the query params |
66 | 67 | * |
67 | - * @param array $params The query params |
|
68 | 68 | * @return string |
69 | 69 | */ |
70 | 70 | public static function serializeQueryParams(array $queryParams) |
@@ -105,6 +105,9 @@ discard block |
||
105 | 105 | return htmlentities(strip_tags($query), ENT_QUOTES); |
106 | 106 | } |
107 | 107 | |
108 | + /** |
|
109 | + * @param string $query |
|
110 | + */ |
|
108 | 111 | public static function isQueryValid($query) |
109 | 112 | { |
110 | 113 | if (!is_string($query) && !method_exists($query, '__toString')) { |
@@ -114,6 +117,9 @@ discard block |
||
114 | 117 | return true; |
115 | 118 | } |
116 | 119 | |
120 | + /** |
|
121 | + * @param string $uri |
|
122 | + */ |
|
117 | 123 | public static function isValid($uri) |
118 | 124 | { |
119 | 125 | if (!($uri instanceof PsrUri) && !is_string($uri)) { |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | * Adds a header. Does not replace the value if it already exists. |
249 | 249 | * |
250 | 250 | * @param string $name The header's name |
251 | - * @param mixed $value The header's value |
|
251 | + * @param string $value The header's value |
|
252 | 252 | * @return void |
253 | 253 | */ |
254 | 254 | public function addHeader($name, $value) |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | /** |
292 | 292 | * Returns the message's body. |
293 | 293 | * |
294 | - * @return Psr\Http\Message\StreamInterface |
|
294 | + * @return StreamInterface|null |
|
295 | 295 | */ |
296 | 296 | public function getBody() |
297 | 297 | { |
@@ -196,7 +196,6 @@ discard block |
||
196 | 196 | * |
197 | 197 | * @link http://tools.ietf.org/html/rfc7230#section-5.3 (for the various |
198 | 198 | * request-target forms allowed in request messages) |
199 | - * @param mixed $requestTarget |
|
200 | 199 | * @return static |
201 | 200 | */ |
202 | 201 | public function withRequestTarget($target) |
@@ -222,6 +221,9 @@ discard block |
||
222 | 221 | return $this -> _method; |
223 | 222 | } |
224 | 223 | |
224 | + /** |
|
225 | + * @param string $method |
|
226 | + */ |
|
225 | 227 | public function setMethod($method) |
226 | 228 | { |
227 | 229 | $this -> _method = $method; |
@@ -357,6 +359,9 @@ discard block |
||
357 | 359 | return null; |
358 | 360 | } |
359 | 361 | |
362 | + /** |
|
363 | + * @param string $method |
|
364 | + */ |
|
360 | 365 | protected function fillFields($method) |
361 | 366 | { |
362 | 367 | $server = new Server; |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Almendra\Http\Psr\Messages; |
4 | 4 | |
5 | 5 | use Psr\Http\Message\UriInterface; |
6 | - |
|
7 | 6 | use Almendra\Http\Helpers\URI as URIHelper; |
8 | 7 | use Almendra\Http\Server; |
9 | 8 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | /** |
49 | 49 | * Returns the deserialized query parameters |
50 | 50 | * |
51 | - * @return array The query parameters |
|
51 | + * @return boolean The query parameters |
|
52 | 52 | */ |
53 | 53 | public function getQueryParams() |
54 | 54 | { |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Almendra\Http\Psr\Messages; |
4 | 4 | |
5 | 5 | use Psr\Http\Message\ServerRequestInterface as RequestInterface; |
6 | -use Psr\Http\Message\UriInterface; |
|
7 | 6 | |
8 | 7 | class ServerRequest extends Message implements RequestInterface |
9 | 8 | { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * Constructs a new URI |
66 | 66 | * |
67 | 67 | * @param string $uri The URI |
68 | - * @return boolean true if success |
|
68 | + * @return boolean|null true if success |
|
69 | 69 | */ |
70 | 70 | public function __construct($uri = null) |
71 | 71 | { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * Returns the user authority in the "[user-info@]host[:port]" format. |
99 | 99 | * |
100 | 100 | * @param type name description |
101 | - * @return type description |
|
101 | + * @return string description |
|
102 | 102 | */ |
103 | 103 | public function getAuthority() |
104 | 104 | { |
@@ -254,6 +254,9 @@ discard block |
||
254 | 254 | return $this -> _fragment; |
255 | 255 | } |
256 | 256 | |
257 | + /** |
|
258 | + * @param string $fragment |
|
259 | + */ |
|
257 | 260 | protected function setFragment($fragment = null) |
258 | 261 | { |
259 | 262 | $this -> _fragment = (isset($fragment) && null !== $fragment) ? |
@@ -284,6 +287,9 @@ discard block |
||
284 | 287 | return $clone; |
285 | 288 | } |
286 | 289 | |
290 | + /** |
|
291 | + * @param string $scheme |
|
292 | + */ |
|
287 | 293 | protected function setScheme($scheme) |
288 | 294 | { |
289 | 295 | $this -> _scheme = $scheme; |
@@ -312,11 +318,17 @@ discard block |
||
312 | 318 | return $clone; |
313 | 319 | } |
314 | 320 | |
321 | + /** |
|
322 | + * @param string $user |
|
323 | + */ |
|
315 | 324 | protected function setUser($user) |
316 | 325 | { |
317 | 326 | $this -> _username = $user; |
318 | 327 | } |
319 | 328 | |
329 | + /** |
|
330 | + * @param null|string $password |
|
331 | + */ |
|
320 | 332 | protected function setPassword($password) |
321 | 333 | { |
322 | 334 | $this -> _password = $password; |
@@ -371,6 +383,9 @@ discard block |
||
371 | 383 | return $clone; |
372 | 384 | } |
373 | 385 | |
386 | + /** |
|
387 | + * @param null|integer $port |
|
388 | + */ |
|
374 | 389 | protected function setPort($port) { |
375 | 390 | $this -> _port = $port; |
376 | 391 | } |
@@ -421,6 +436,9 @@ discard block |
||
421 | 436 | return $clone; |
422 | 437 | } |
423 | 438 | |
439 | + /** |
|
440 | + * @param string $query |
|
441 | + */ |
|
424 | 442 | public function setQuery($query) |
425 | 443 | { |
426 | 444 | $this -> _query = $query; |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Almendra\Http\Psr\Messages; |
4 | 4 | |
5 | 5 | use Psr\Http\Message\UriInterface; |
6 | - |
|
7 | 6 | use Almendra\Http\Helpers\URI as URIHelper; |
8 | 7 | use Almendra\Http\Server; |
9 | 8 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | * Retrieves a value define in the superglobal $_SERVER. |
11 | 11 | * |
12 | 12 | * @param string $value The key's name. |
13 | - * @return string|mixed |
|
13 | + * @return string |
|
14 | 14 | */ |
15 | 15 | public static function getValue($value, $default = '') |
16 | 16 | { |