@@ -51,8 +51,7 @@ discard block |
||
| 51 | 51 | * @class HttpCookie |
| 52 | 52 | * @package Platine\Http\Client |
| 53 | 53 | */ |
| 54 | -class HttpCookie |
|
| 55 | -{ |
|
| 54 | +class HttpCookie { |
|
| 56 | 55 | /** |
| 57 | 56 | * The name of cookie |
| 58 | 57 | * @var string |
@@ -112,8 +111,7 @@ discard block |
||
| 112 | 111 | * Create new instance |
| 113 | 112 | * @param string $cookieString |
| 114 | 113 | */ |
| 115 | - public function __construct(string $cookieString) |
|
| 116 | - { |
|
| 114 | + public function __construct(string $cookieString) { |
|
| 117 | 115 | $parts = array_map('trim', explode(';', $cookieString)); |
| 118 | 116 | foreach ($parts as $partStr) { |
| 119 | 117 | $part = array_map('trim', explode('=', $partStr)); |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * @class HttpMethod |
| 52 | 52 | * @package Platine\Http\Client |
| 53 | 53 | */ |
| 54 | -class HttpMethod |
|
| 55 | -{ |
|
| 54 | +class HttpMethod { |
|
| 56 | 55 | public const HEAD = 'HEAD'; |
| 57 | 56 | public const GET = 'GET'; |
| 58 | 57 | public const PUT = 'PUT'; |
@@ -57,8 +57,7 @@ |
||
| 57 | 57 | * @class HttpStatus |
| 58 | 58 | * @package Platine\Http\Client |
| 59 | 59 | */ |
| 60 | -class HttpStatus |
|
| 61 | -{ |
|
| 60 | +class HttpStatus { |
|
| 62 | 61 | // Informational 1xx: |
| 63 | 62 | public const INFORMATIONAL = 100; |
| 64 | 63 | public const CONTINUE = 100; |
@@ -39,6 +39,5 @@ |
||
| 39 | 39 | * @class HttpClientException |
| 40 | 40 | * @package Platine\Http\Client |
| 41 | 41 | */ |
| 42 | -class HttpClientException extends Exception |
|
| 43 | -{ |
|
| 42 | +class HttpClientException extends Exception { |
|
| 44 | 43 | } |
@@ -55,8 +55,7 @@ discard block |
||
| 55 | 55 | * @class HttpClient |
| 56 | 56 | * @package Platine\Http\Client |
| 57 | 57 | */ |
| 58 | -class HttpClient |
|
| 59 | -{ |
|
| 58 | +class HttpClient { |
|
| 60 | 59 | /** |
| 61 | 60 | * The base URL |
| 62 | 61 | * @var string |
@@ -109,8 +108,7 @@ discard block |
||
| 109 | 108 | * Create new instance |
| 110 | 109 | * @param string $baseUrl |
| 111 | 110 | */ |
| 112 | - public function __construct(string $baseUrl = '') |
|
| 113 | - { |
|
| 111 | + public function __construct(string $baseUrl = '') { |
|
| 114 | 112 | $this->baseUrl = $baseUrl; |
| 115 | 113 | } |
| 116 | 114 | |
@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | * @class HttpResponse |
| 55 | 55 | * @package Platine\Http\Client |
| 56 | 56 | */ |
| 57 | -class HttpResponse |
|
| 58 | -{ |
|
| 57 | +class HttpResponse { |
|
| 59 | 58 | /** |
| 60 | 59 | * The request URL |
| 61 | 60 | * @var string |
@@ -189,8 +188,7 @@ discard block |
||
| 189 | 188 | * @param string $name |
| 190 | 189 | * @return mixed|null |
| 191 | 190 | */ |
| 192 | - public function getHeader(string $name) |
|
| 193 | - { |
|
| 191 | + public function getHeader(string $name) { |
|
| 194 | 192 | return $this->headers[$name] ?? null; |
| 195 | 193 | } |
| 196 | 194 | |
@@ -259,8 +257,7 @@ discard block |
||
| 259 | 257 | * Return the response as XML |
| 260 | 258 | * @return mixed |
| 261 | 259 | */ |
| 262 | - public function xml() |
|
| 263 | - { |
|
| 260 | + public function xml() { |
|
| 264 | 261 | return Xml::decode($this->content); |
| 265 | 262 | } |
| 266 | 263 | |