@@ -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; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | { |
63 | 63 | // Informational 1xx: |
64 | 64 | public const INFORMATIONAL = 100; |
65 | - public const CONTINUE = 100; |
|
65 | + public const continue = 100; |
|
66 | 66 | public const SWITCHING_PROTOCOLS = 101; |
67 | 67 | |
68 | 68 | // Successful 2xx: |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | public const SERVER_ERROR_END = 600; |
119 | 119 | |
120 | 120 | public const REASON_PHRASES = [ |
121 | - self::CONTINUE => 'Continue', |
|
121 | + self::continue => 'Continue', |
|
122 | 122 | self::SWITCHING_PROTOCOLS => 'Switching Protocols', |
123 | 123 | |
124 | 124 | self::OK => 'OK', |
@@ -271,8 +271,8 @@ |
||
271 | 271 | */ |
272 | 272 | public function contentType(string $contentType): self |
273 | 273 | { |
274 | - // If this is a multipart request and boundary was not defined, |
|
275 | - // we define a boundary as this is required for multipart requests. |
|
274 | + // If this is a multipart request and boundary was not defined, |
|
275 | + // we define a boundary as this is required for multipart requests. |
|
276 | 276 | if (stripos($contentType, 'multipart/') !== false) { |
277 | 277 | if (stripos($contentType, 'boundary') === false) { |
278 | 278 | $contentType .= sprintf('; boundary="%s"', uniqid((string) time())); |
@@ -519,7 +519,7 @@ |
||
519 | 519 | protected function send($ch): HttpResponse |
520 | 520 | { |
521 | 521 | $responseHeaders = []; |
522 | - curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use (&$responseHeaders) { |
|
522 | + curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$responseHeaders) { |
|
523 | 523 | if (strpos($header, ':') !== false) { |
524 | 524 | list($name, $value) = explode(':', $header); |
525 | 525 | if (array_key_exists($name, $responseHeaders) === false) { |
@@ -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 |
@@ -52,8 +52,7 @@ |
||
52 | 52 | * @class HttpMethod |
53 | 53 | * @package Platine\Framework\Http\Client |
54 | 54 | */ |
55 | -class HttpMethod |
|
56 | -{ |
|
55 | +class HttpMethod { |
|
57 | 56 | public const HEAD = 'HEAD'; |
58 | 57 | public const GET = 'GET'; |
59 | 58 | public const PUT = 'PUT'; |