@@ -52,8 +52,7 @@ discard block |
||
| 52 | 52 | * @class HttpCookie |
| 53 | 53 | * @package Platine\Framework\Http\Client |
| 54 | 54 | */ |
| 55 | -class HttpCookie |
|
| 56 | -{ |
|
| 55 | +class HttpCookie { |
|
| 57 | 56 | /** |
| 58 | 57 | * The name of cookie |
| 59 | 58 | * @var string |
@@ -113,8 +112,7 @@ discard block |
||
| 113 | 112 | * Create new instance |
| 114 | 113 | * @param string $cookieString |
| 115 | 114 | */ |
| 116 | - public function __construct(string $cookieString) |
|
| 117 | - { |
|
| 115 | + public function __construct(string $cookieString) { |
|
| 118 | 116 | $parts = array_map('trim', explode(';', $cookieString)); |
| 119 | 117 | foreach ($parts as $partStr) { |
| 120 | 118 | $part = array_map('trim', explode('=', $partStr)); |
@@ -55,8 +55,7 @@ discard block |
||
| 55 | 55 | * @class HttpResponse |
| 56 | 56 | * @package Platine\Framework\Http\Client |
| 57 | 57 | */ |
| 58 | -class HttpResponse |
|
| 59 | -{ |
|
| 58 | +class HttpResponse { |
|
| 60 | 59 | /** |
| 61 | 60 | * The request URL |
| 62 | 61 | * @var string |
@@ -180,8 +179,7 @@ discard block |
||
| 180 | 179 | * @param string $name |
| 181 | 180 | * @return mixed|null |
| 182 | 181 | */ |
| 183 | - public function getHeader(string $name) |
|
| 184 | - { |
|
| 182 | + public function getHeader(string $name) { |
|
| 185 | 183 | return $this->headers[$name] ?? null; |
| 186 | 184 | } |
| 187 | 185 | |
@@ -250,8 +248,7 @@ discard block |
||
| 250 | 248 | * Return the response as XML |
| 251 | 249 | * @return mixed |
| 252 | 250 | */ |
| 253 | - public function xml() |
|
| 254 | - { |
|
| 251 | + public function xml() { |
|
| 255 | 252 | return Xml::decode($this->content); |
| 256 | 253 | } |
| 257 | 254 | |
@@ -40,6 +40,5 @@ |
||
| 40 | 40 | * @class HttpClientException |
| 41 | 41 | * @package Platine\Framework\Http\Client |
| 42 | 42 | */ |
| 43 | -class HttpClientException extends Exception |
|
| 44 | -{ |
|
| 43 | +class HttpClientException extends Exception { |
|
| 45 | 44 | } |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | * @class HttpStatus |
| 59 | 59 | * @package Platine\Framework\Http\Client |
| 60 | 60 | */ |
| 61 | -class HttpStatus |
|
| 62 | -{ |
|
| 61 | +class HttpStatus { |
|
| 63 | 62 | // Informational 1xx: |
| 64 | 63 | public const INFORMATIONAL = 100; |
| 65 | 64 | public const CONTINUE = 100; |
@@ -56,8 +56,7 @@ discard block |
||
| 56 | 56 | * @class HttpClient |
| 57 | 57 | * @package Platine\Framework\Http\Client |
| 58 | 58 | */ |
| 59 | -class HttpClient |
|
| 60 | -{ |
|
| 59 | +class HttpClient { |
|
| 61 | 60 | /** |
| 62 | 61 | * The base URL |
| 63 | 62 | * @var string |
@@ -110,8 +109,7 @@ discard block |
||
| 110 | 109 | * Create new instance |
| 111 | 110 | * @param string $baseUrl |
| 112 | 111 | */ |
| 113 | - public function __construct(string $baseUrl = '') |
|
| 114 | - { |
|
| 112 | + public function __construct(string $baseUrl = '') { |
|
| 115 | 113 | $this->baseUrl = $baseUrl; |
| 116 | 114 | } |
| 117 | 115 | |