@@ -47,8 +47,7 @@ |
||
| 47 | 47 | |
| 48 | 48 | namespace Platine\Http; |
| 49 | 49 | |
| 50 | -abstract class Message implements MessageInterface |
|
| 51 | -{ |
|
| 50 | +abstract class Message implements MessageInterface { |
|
| 52 | 51 | /** |
| 53 | 52 | * The message protocol version. |
| 54 | 53 | * @var string |
@@ -50,8 +50,7 @@ |
||
| 50 | 50 | use InvalidArgumentException; |
| 51 | 51 | use RuntimeException; |
| 52 | 52 | |
| 53 | -class UploadedFile implements UploadedFileInterface |
|
| 54 | -{ |
|
| 53 | +class UploadedFile implements UploadedFileInterface { |
|
| 55 | 54 | /** |
| 56 | 55 | * The uploaded file name |
| 57 | 56 | * @var string |
@@ -51,8 +51,7 @@ discard block |
||
| 51 | 51 | * @class Request |
| 52 | 52 | * @package Platine\Http |
| 53 | 53 | */ |
| 54 | -class Request extends Message implements RequestInterface |
|
| 55 | -{ |
|
| 54 | +class Request extends Message implements RequestInterface { |
|
| 56 | 55 | /** |
| 57 | 56 | * The request target |
| 58 | 57 | * @var string |
@@ -76,8 +75,7 @@ discard block |
||
| 76 | 75 | * @param string $method the HTTP request method |
| 77 | 76 | * @param UriInterface|string|null $uri the request Uri |
| 78 | 77 | */ |
| 79 | - public function __construct(string $method = 'GET', $uri = null) |
|
| 80 | - { |
|
| 78 | + public function __construct(string $method = 'GET', $uri = null) { |
|
| 81 | 79 | $this->method = $this->filterMethod($method); |
| 82 | 80 | if ($uri === null) { |
| 83 | 81 | $uri = new Uri(); |
@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | use InvalidArgumentException; |
| 52 | 52 | |
| 53 | -class ServerRequest extends Request implements ServerRequestInterface |
|
| 54 | -{ |
|
| 53 | +class ServerRequest extends Request implements ServerRequestInterface { |
|
| 55 | 54 | /** |
| 56 | 55 | * The array of servers params |
| 57 | 56 | * @var array<string, mixed> |
@@ -221,8 +220,7 @@ discard block |
||
| 221 | 220 | /** |
| 222 | 221 | * {@inheritdoc} |
| 223 | 222 | */ |
| 224 | - public function getParsedBody() |
|
| 225 | - { |
|
| 223 | + public function getParsedBody() { |
|
| 226 | 224 | return $this->parsedBody; |
| 227 | 225 | } |
| 228 | 226 | |
@@ -248,8 +246,7 @@ discard block |
||
| 248 | 246 | /** |
| 249 | 247 | * {@inheritdoc} |
| 250 | 248 | */ |
| 251 | - public function getAttribute(string $name, $default = null) |
|
| 252 | - { |
|
| 249 | + public function getAttribute(string $name, $default = null) { |
|
| 253 | 250 | return isset($this->attributes[$name]) ? $this->attributes[$name] : $default; |
| 254 | 251 | } |
| 255 | 252 | |
@@ -301,8 +298,7 @@ discard block |
||
| 301 | 298 | * @param object|array<string|int, mixed>|mixed|null $data the parsed body |
| 302 | 299 | * @return mixed |
| 303 | 300 | */ |
| 304 | - protected function filterParsedBody($data) |
|
| 305 | - { |
|
| 301 | + protected function filterParsedBody($data) { |
|
| 306 | 302 | if ($data !== null && !is_array($data) && !is_object($data)) { |
| 307 | 303 | throw new InvalidArgumentException('Invalid parsed body! Parsed body must be an array or an object'); |
| 308 | 304 | } |
@@ -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 | |