@@ -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 |
@@ -9,7 +9,6 @@ |
||
9 | 9 | use Psr\Http\Message\UriInterface; |
10 | 10 | |
11 | 11 | // \HttpMessage |
12 | -use Kambo\HttpMessage\Uri; |
|
13 | 12 | use Kambo\HttpMessage\Message; |
14 | 13 | use Kambo\HttpMessage\Headers; |
15 | 14 | use Kambo\HttpMessage\RequestTrait; |
@@ -5,13 +5,11 @@ |
||
5 | 5 | use InvalidArgumentException; |
6 | 6 | |
7 | 7 | // \Psr |
8 | -use Psr\Http\Message\RequestInterface; |
|
9 | 8 | use Psr\Http\Message\UriInterface; |
10 | 9 | |
11 | 10 | // \HttpMessage |
12 | 11 | use Kambo\HttpMessage\Uri; |
13 | 12 | use Kambo\HttpMessage\Message; |
14 | -use Kambo\HttpMessage\Headers; |
|
15 | 13 | |
16 | 14 | /** |
17 | 15 | * Shared methods for outgoing, client-side request and server request. |
@@ -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; |