@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * |
| 41 | 41 | * @var integer |
| 42 | 42 | */ |
| 43 | - const HTTP_PORT = 80; |
|
| 43 | + const HTTP_PORT = 80; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Https port |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | $port = $this->getPort(); |
| 199 | 199 | $userInfo = $this->getUserInfo(); |
| 200 | 200 | |
| 201 | - return ($userInfo ? $userInfo. '@' : '').$this->getHost().($port ? ':' . $port : ''); |
|
| 201 | + return ($userInfo ? $userInfo . '@' : '') . $this->getHost() . ($port ? ':' . $port : ''); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | /** |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | if (!empty($this->user)) { |
| 221 | 221 | $userInfo = $this->user; |
| 222 | 222 | if (!empty($this->password)) { |
| 223 | - $userInfo .= ':'.$this->password; |
|
| 223 | + $userInfo .= ':' . $this->password; |
|
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | $this->validatePath($path); |
| 471 | 471 | |
| 472 | 472 | $clone = clone $this; |
| 473 | - $clone->path = $this->urlEncode((string)$path); |
|
| 473 | + $clone->path = $this->urlEncode((string) $path); |
|
| 474 | 474 | |
| 475 | 475 | return $clone; |
| 476 | 476 | } |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | $this->validateQuery($query); |
| 498 | 498 | |
| 499 | 499 | $clone = clone $this; |
| 500 | - $clone->query = $this->urlEncode((string)$query); |
|
| 500 | + $clone->query = $this->urlEncode((string) $query); |
|
| 501 | 501 | |
| 502 | 502 | return $clone; |
| 503 | 503 | } |
@@ -566,8 +566,8 @@ discard block |
||
| 566 | 566 | |
| 567 | 567 | $path = '/' . ltrim($path, '/'); |
| 568 | 568 | |
| 569 | - return ($scheme ? $scheme.':' : '').($authority ? '//'.$authority : '') |
|
| 570 | - .$path.($query ? '?' . $query : '').($fragment ? '#' . $fragment : ''); |
|
| 569 | + return ($scheme ? $scheme . ':' : '') . ($authority ? '//' . $authority : '') |
|
| 570 | + .$path . ($query ? '?' . $query : '') . ($fragment ? '#' . $fragment : ''); |
|
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | // ------------ PRIVATE METHODS |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | throw new InvalidArgumentException('Uri scheme must be a string'); |
| 600 | 600 | } |
| 601 | 601 | |
| 602 | - $scheme = str_replace('://', '', strtolower((string)$scheme)); |
|
| 602 | + $scheme = str_replace('://', '', strtolower((string) $scheme)); |
|
| 603 | 603 | if (!isset($this->validSchema[$scheme])) { |
| 604 | 604 | throw new InvalidArgumentException('Uri scheme must be one of: "", "https", "http"'); |
| 605 | 605 | } |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | { |
| 703 | 703 | return preg_replace_callback( |
| 704 | 704 | '/(?:[^a-zA-Z0-9_\-\.~:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/', |
| 705 | - function ($match) { |
|
| 705 | + function($match) { |
|
| 706 | 706 | return rawurlencode($match[0]); |
| 707 | 707 | }, |
| 708 | 708 | $path |
@@ -276,6 +276,9 @@ discard block |
||
| 276 | 276 | return $clone; |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | + /** |
|
| 280 | + * @param string $headerName |
|
| 281 | + */ |
|
| 279 | 282 | private function validateHeaderName($headerName) |
| 280 | 283 | { |
| 281 | 284 | if (is_array($headerName)) { |
@@ -283,6 +286,9 @@ discard block |
||
| 283 | 286 | } |
| 284 | 287 | } |
| 285 | 288 | |
| 289 | + /** |
|
| 290 | + * @param string $version |
|
| 291 | + */ |
|
| 286 | 292 | private function validateProtocol($version) |
| 287 | 293 | { |
| 288 | 294 | $valid = [ |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | $target = '/'; |
| 66 | 66 | if ($this->uri->getPath() !== null) { |
| 67 | 67 | $target = $this->uri->getPath(); |
| 68 | - $target .= (!empty($this->uri->getQuery())) ? '?'.$this->uri->getQuery() : ''; |
|
| 68 | + $target .= (!empty($this->uri->getQuery())) ? '?' . $this->uri->getQuery() : ''; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $this->requestTarget = $target; |