|
11 | 11 |
|
12 | 12 | class HttpClient implements HttpClientInterface |
13 | 13 | { |
14 | | - /** |
15 | | - * @var ClientInterface |
16 | | - */ |
17 | | - private $client; |
18 | | - |
19 | | - /** |
20 | | - * @var string |
21 | | - */ |
22 | | - private $baseUrl; |
23 | | - |
24 | | - /** |
25 | | - * @var string|null |
26 | | - */ |
27 | | - private $username; |
28 | | - |
29 | | - /** |
30 | | - * @var string|null |
31 | | - */ |
32 | | - private $password; |
33 | | - |
34 | | - /** |
35 | | - * @var RequestFactoryInterface |
36 | | - */ |
37 | | - private $requestFactory; |
38 | | - |
39 | | - /** |
40 | | - * @var ErrorHandlerInterface |
41 | | - */ |
42 | | - private $errorHandler; |
43 | | - |
44 | 14 | public function __construct( |
45 | | - ClientInterface $client, |
46 | | - RequestFactoryInterface $requestFactory, |
47 | | - ErrorHandlerInterface $errorHandler, |
48 | | - string $baseUrl, |
49 | | - ?string $username = null, |
50 | | - ?string $password = null |
| 15 | + private readonly ClientInterface $client, |
| 16 | + private readonly RequestFactoryInterface $requestFactory, |
| 17 | + private readonly ErrorHandlerInterface $errorHandler, |
| 18 | + private readonly string $baseUrl, |
| 19 | + private readonly ?string $username = null, |
| 20 | + private readonly ?string $password = null |
51 | 21 | ) { |
52 | | - $this->client = $client; |
53 | | - $this->baseUrl = $baseUrl; |
54 | | - $this->username = $username; |
55 | | - $this->password = $password; |
56 | | - $this->requestFactory = $requestFactory; |
57 | | - $this->errorHandler = $errorHandler; |
58 | 22 | } |
59 | 23 |
|
60 | 24 | /** |
@@ -98,12 +62,11 @@ private function createRequest( |
98 | 62 | /** |
99 | 63 | * @param array<string,mixed> $body |
100 | 64 | * @param array<string,mixed> $queryParams |
101 | | - * @return mixed |
102 | 65 | * @throws ClientExceptionInterface |
103 | 66 | * @throws SchemaRegistryExceptionInterface |
104 | 67 | * @throws JsonException |
105 | 68 | */ |
106 | | - public function call(string $method, string $uri, array $body = [], array $queryParams = []) |
| 69 | + public function call(string $method, string $uri, array $body = [], array $queryParams = []): mixed |
107 | 70 | { |
108 | 71 | $request = $this->createRequest($method, $uri, $body, $queryParams); |
109 | 72 |
|
|
0 commit comments