| @@ -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 |      { | 
| @@ -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 | |
| @@ -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 |      { | 
| 376 | 391 | $this -> _port = $port; | 
| @@ -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 | |
| @@ -194,7 +194,6 @@ discard block | ||
| 194 | 194 | * | 
| 195 | 195 | * @link http://tools.ietf.org/html/rfc7230#section-5.3 (for the various | 
| 196 | 196 | * request-target forms allowed in request messages) | 
| 197 | - * @param mixed $requestTarget | |
| 198 | 197 | * @return static | 
| 199 | 198 | */ | 
| 200 | 199 | public function withRequestTarget($target) | 
| @@ -414,6 +413,9 @@ discard block | ||
| 414 | 413 | } | 
| 415 | 414 | |
| 416 | 415 | |
| 416 | + /** | |
| 417 | + * @param string $method | |
| 418 | + */ | |
| 417 | 419 | protected function fillFields($method) | 
| 418 | 420 |      { | 
| 419 | 421 | $server = new Server; | 
| @@ -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)) { | 
| @@ -4,9 +4,7 @@ | ||
| 4 | 4 | |
| 5 | 5 | use Psr\Http\Message\ServerRequestInterface as RequestInterface; | 
| 6 | 6 | use Almendra\Http\Psr\Messages\Response; | 
| 7 | - | |
| 8 | 7 | use Almendra\Http\Helpers\URI as URIHelper; | 
| 9 | -use Almendra\Http\Server; | |
| 10 | 8 | |
| 11 | 9 | class ServerRequest extends Response implements RequestInterface | 
| 12 | 10 |  { | 
| @@ -155,7 +155,7 @@ discard block | ||
| 155 | 155 | * | 
| 156 | 156 | * After the stream has been detached, the stream is in an unusable state. | 
| 157 | 157 | * | 
| 158 | - * @return resource|null Underlying PHP stream, if any | |
| 158 | + * @return null|Stream Underlying PHP stream, if any | |
| 159 | 159 | */ | 
| 160 | 160 | public function detach() | 
| 161 | 161 |      { | 
| @@ -376,7 +376,7 @@ discard block | ||
| 376 | 376 | /** | 
| 377 | 377 | * Gets the value of body. | 
| 378 | 378 | * | 
| 379 | - * @return mixed | |
| 379 | + * @return null|Stream | |
| 380 | 380 | */ | 
| 381 | 381 | public function getBody() | 
| 382 | 382 |      { | 
| @@ -390,7 +390,7 @@ discard block | ||
| 390 | 390 | /** | 
| 391 | 391 | * Sets the value of body. | 
| 392 | 392 | * | 
| 393 | - * @param mixed $body the body | |
| 393 | + * @param resource $body the body | |
| 394 | 394 | * | 
| 395 | 395 | * @return self | 
| 396 | 396 | */ | 
| @@ -15,7 +15,6 @@ discard block | ||
| 15 | 15 | /** | 
| 16 | 16 | * Retrieves all values defined in the superglobal $_SERVER. | 
| 17 | 17 | * | 
| 18 | - * @param string $value The key's name. | |
| 19 | 18 | * @return string|mixed | 
| 20 | 19 | */ | 
| 21 | 20 | public static function getValues(); | 
| @@ -33,7 +32,6 @@ discard block | ||
| 33 | 32 | * Returns all values from the $_GET superglobal. | 
| 34 | 33 | * Null if none exists. | 
| 35 | 34 | * | 
| 36 | - * @param string $name | |
| 37 | 35 | * @return mixed | 
| 38 | 36 | */ | 
| 39 | 37 | public static function gets(array $values = null); | 
| @@ -16,7 +16,7 @@ discard block | ||
| 16 | 16 | * Retrieves a value defined in the superglobal $_SERVER. | 
| 17 | 17 | * | 
| 18 | 18 | * @param string $value The key's name. | 
| 19 | - * @return string|mixed | |
| 19 | + * @return string | |
| 20 | 20 | */ | 
| 21 | 21 | public static function getValue($value, $default = '') | 
| 22 | 22 |      { | 
| @@ -58,7 +58,6 @@ discard block | ||
| 58 | 58 | * Returns all values from the $_GET superglobal. | 
| 59 | 59 | * Null if none exists. | 
| 60 | 60 | * | 
| 61 | - * @param string $name | |
| 62 | 61 | * @return mixed | 
| 63 | 62 | */ | 
| 64 | 63 | public static function gets(array $values = null) | 
| @@ -95,7 +94,6 @@ discard block | ||
| 95 | 94 | * Returns all values from the $_POST superglobal. | 
| 96 | 95 | * Null if none exists. | 
| 97 | 96 | * | 
| 98 | - * @param string $name | |
| 99 | 97 | * @return mixed | 
| 100 | 98 | */ | 
| 101 | 99 | public static function posts(array $values = null) | 
| @@ -132,7 +130,6 @@ discard block | ||
| 132 | 130 | * Returns all values from the $_FILES superglobal. | 
| 133 | 131 | * Null if none exists. | 
| 134 | 132 | * | 
| 135 | - * @param string $name | |
| 136 | 133 | * @return mixed | 
| 137 | 134 | */ | 
| 138 | 135 | public static function files(array $values = null) |