@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | const E_SAFE_METHODS_WITH_BODY = 'failed to open stream: you should not set the message body with safe HTTP methods'; |
33 | 33 | |
34 | 34 | protected UriInterface $uri; |
35 | - protected HttpMethod|string $method; |
|
35 | + protected HttpMethod | string $method; |
|
36 | 36 | protected string $requestTarget = ''; |
37 | 37 | |
38 | 38 | /** |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function __construct( |
50 | 50 | HttpMethod $method, |
51 | - string|UriInterface $uri, |
|
52 | - string|iterable|null $body = null, |
|
51 | + string | UriInterface $uri, |
|
52 | + string | iterable | null $body = null, |
|
53 | 53 | array $headers = []) |
54 | 54 | { |
55 | 55 | $this->uri = $uri instanceof UriInterface ? $uri : new Uri($uri); |
@@ -151,9 +151,9 @@ |
||
151 | 151 | $instance = parent::withProtocolVersion($version); |
152 | 152 | $instance->options[CURLOPT_HTTP_VERSION] = |
153 | 153 | ['2' => CURL_HTTP_VERSION_2_0, |
154 | - '2.0' => CURL_HTTP_VERSION_2_0, |
|
155 | - '1.1' => CURL_HTTP_VERSION_1_1, |
|
156 | - '1.0' => CURL_HTTP_VERSION_1_0][$version]; |
|
154 | + '2.0' => CURL_HTTP_VERSION_2_0, |
|
155 | + '1.1' => CURL_HTTP_VERSION_1_1, |
|
156 | + '1.0' => CURL_HTTP_VERSION_1_0][$version]; |
|
157 | 157 | return $instance; |
158 | 158 | } |
159 | 159 |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | |
57 | 57 | public function __construct( |
58 | 58 | HttpMethod $method, |
59 | - string|UriInterface $uri, |
|
60 | - string|iterable|null $body = null, |
|
59 | + string | UriInterface $uri, |
|
60 | + string | iterable | null $body = null, |
|
61 | 61 | array $headers = []) |
62 | 62 | { |
63 | 63 | parent::__construct($method, $uri, $body, $headers); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | return $instance; |
158 | 158 | } |
159 | 159 | |
160 | - protected function createResource(): \CurlHandle|bool |
|
160 | + protected function createResource(): \CurlHandle | bool |
|
161 | 161 | { |
162 | 162 | return curl_init((string)$this->getUri()); |
163 | 163 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | string $message, |
16 | 16 | int $code, |
17 | 17 | RequestInterface $request, |
18 | - Throwable|null $previous = null) |
|
18 | + Throwable | null $previous = null) |
|
19 | 19 | { |
20 | 20 | parent::__construct($message, $code, $previous); |
21 | 21 | $this->request = $request; |
@@ -58,8 +58,8 @@ |
||
58 | 58 | |
59 | 59 | public function __construct( |
60 | 60 | HttpMethod $method, |
61 | - string|UriInterface $uri, |
|
62 | - string|iterable|null $body = null, |
|
61 | + string | UriInterface $uri, |
|
62 | + string | iterable | null $body = null, |
|
63 | 63 | array $headers = []) |
64 | 64 | { |
65 | 65 | parent::__construct($method, $uri, $body, $headers); |
@@ -206,7 +206,7 @@ |
||
206 | 206 | 'Please provide a valid URI', |
207 | 207 | HttpStatus::BAD_REQUEST); |
208 | 208 | } |
209 | - $this->port = (int) ($parts['port'] ?? 443); |
|
209 | + $this->port = (int)($parts['port'] ?? 443); |
|
210 | 210 | unset($parts['port']); |
211 | 211 | foreach ($parts as $k => $v) { |
212 | 212 | $this->$k = trim($v); |
@@ -177,7 +177,7 @@ |
||
177 | 177 | * |
178 | 178 | * @return void |
179 | 179 | */ |
180 | - protected function normalizeHeader(string $name, array|string $value, bool $skipKey): void |
|
180 | + protected function normalizeHeader(string $name, array | string $value, bool $skipKey): void |
|
181 | 181 | { |
182 | 182 | $name = str_replace(["\r", "\n", "\t"], '', trim($name)); |
183 | 183 | if (false === $skipKey) { |
@@ -319,7 +319,7 @@ |
||
319 | 319 | * @return Response|null Should return a NULL if validation has passed, |
320 | 320 | * or a Response object with status code 400 and explanation what failed |
321 | 321 | */ |
322 | - public function validate(HttpInputValidator $validator, ?Data &$input = null): ?Response; |
|
322 | + public function validate(HttpInputValidator $validator, ?Data & $input = null): ?Response; |
|
323 | 323 | } |
324 | 324 | |
325 | 325 |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | { |
96 | 96 | $SUT = new class(HttpMethod::GET, 'http://example.com') extends CurlClient |
97 | 97 | { |
98 | - protected function createResource(): \CurlHandle|bool |
|
98 | + protected function createResource(): \CurlHandle | bool |
|
99 | 99 | { |
100 | 100 | return false; |
101 | 101 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | { |
114 | 114 | $SUT = new class(HttpMethod::GET, 'http://example.com') extends CurlClient |
115 | 115 | { |
116 | - protected function createResource(): \CurlHandle|bool |
|
116 | + protected function createResource(): \CurlHandle | bool |
|
117 | 117 | { |
118 | 118 | throw new \Exception('Exception message'); |
119 | 119 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | try { |
73 | 73 | $client->sendRequest($request); |
74 | 74 | } catch (\Exception $e) { |
75 | - $this->assertInstanceOf(Psr18Exception::class, $e);; |
|
75 | + $this->assertInstanceOf(Psr18Exception::class, $e); ; |
|
76 | 76 | $this->assertSame($request, $e->getRequest()); |
77 | 77 | } |
78 | 78 | } |