@@ -29,7 +29,7 @@ |
||
29 | 29 | #[Override] |
30 | 30 | public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise |
31 | 31 | { |
32 | - return $next($request)->then(static function (ResponseInterface $response): ResponseInterface { |
|
32 | + return $next($request)->then(static function(ResponseInterface $response): ResponseInterface { |
|
33 | 33 | $status = $response->getStatusCode(); |
34 | 34 | |
35 | 35 | if ($status >= 400 && $status < 600) { |
@@ -33,7 +33,8 @@ |
||
33 | 33 | private LimiterInterface $rateLimiter, |
34 | 34 | private int $tokens = 1, |
35 | 35 | private ?float $maxTime = null |
36 | - ) {} |
|
36 | + ) { |
|
37 | +} |
|
37 | 38 | |
38 | 39 | /** |
39 | 40 | * @throws MaxWaitDurationExceededException if $maxTime is set and the process needs to wait longer than its value |
@@ -58,7 +58,7 @@ |
||
58 | 58 | public function __construct( |
59 | 59 | private readonly Builder $httpClientBuilder = new Builder(), |
60 | 60 | private readonly bool $throttle = false, |
61 | - private readonly ?array $throttleOptions = null, |
|
61 | + private readonly ? array $throttleOptions = null, |
|
62 | 62 | ) { |
63 | 63 | $this->responseHistory = new History(); |
64 | 64 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | * |
27 | 27 | * @throws Exception |
28 | 28 | */ |
29 | - public function sendRequest(array|string $ip, string $format = 'json'): string |
|
29 | + public function sendRequest(array | string $ip, string $format = 'json'): string |
|
30 | 30 | { |
31 | 31 | $response = $this->get($ip, $format); |
32 | 32 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * |
39 | 39 | * @throws Exception |
40 | 40 | */ |
41 | - protected function get(array|string $query, string $format = 'json'): ResponseInterface |
|
41 | + protected function get(array | string $query, string $format = 'json'): ResponseInterface |
|
42 | 42 | { |
43 | 43 | return $this->client->getHttpClient()->get($this->prepareUri($query, $format)); |
44 | 44 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @throws InvalidArgumentException If an invalid format, invalid IP address, or too many IP's are provided. |
50 | 50 | */ |
51 | - private function prepareUri(array|string $query, string $format): string |
|
51 | + private function prepareUri(array | string $query, string $format): string |
|
52 | 52 | { |
53 | 53 | if (\is_array($query)) { |
54 | 54 | $query = implode(',', $query); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @throws InvalidArgumentException If an invalid IP address or too many IP's are provided. |
70 | 70 | */ |
71 | - private function validateIpAddresses(array|string $ip): void |
|
71 | + private function validateIpAddresses(array | string $ip): void |
|
72 | 72 | { |
73 | 73 | if (!\is_array($ip)) { |
74 | 74 | $ip = str_contains($ip, ',') ? explode(',', $ip) : [$ip]; |
@@ -30,7 +30,9 @@ |
||
30 | 30 | /** |
31 | 31 | * Create a new API instance. |
32 | 32 | */ |
33 | - public function __construct(private readonly Client $client) {} |
|
33 | + public function __construct(private readonly Client $client) |
|
34 | + { |
|
35 | +} |
|
34 | 36 | |
35 | 37 | /** |
36 | 38 | * @param array<string>|string $query |