Skip to content

Commit f1e89ab

Browse files
authored
chore: Use #[\SensitiveParameter] (#112)
1 parent 0164be2 commit f1e89ab

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/Anthropic/Platform/Anthropic.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
public function __construct(
1818
HttpClientInterface $httpClient,
19-
private string $apiKey,
19+
#[\SensitiveParameter] private string $apiKey,
2020
) {
2121
$this->httpClient = $httpClient instanceof EventSourceHttpClient ? $httpClient : new EventSourceHttpClient($httpClient);
2222
}

src/OpenAI/Platform/Azure.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct(
1818
private string $baseUrl,
1919
private string $deployment,
2020
private string $apiVersion,
21-
private string $key,
21+
#[\SensitiveParameter] private string $apiKey,
2222
) {
2323
$this->httpClient = $httpClient instanceof EventSourceHttpClient ? $httpClient : new EventSourceHttpClient($httpClient);
2424
}
@@ -29,7 +29,7 @@ protected function rawRequest(string $endpoint, array $body): ResponseInterface
2929

3030
return $this->httpClient->request('POST', $url, [
3131
'headers' => [
32-
'api-key' => $this->key,
32+
'api-key' => $this->apiKey,
3333
'Content-Type' => 'application/json',
3434
],
3535
'query' => ['api-version' => $this->apiVersion],

src/OpenAI/Platform/OpenAI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
public function __construct(
1717
HttpClientInterface $httpClient,
18-
private string $apiKey,
18+
#[\SensitiveParameter] private string $apiKey,
1919
) {
2020
$this->httpClient = $httpClient instanceof EventSourceHttpClient ? $httpClient : new EventSourceHttpClient($httpClient);
2121
}

src/Store/Azure/SearchStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
public function __construct(
2020
private HttpClientInterface $httpClient,
2121
private string $endpointUrl,
22-
private string $apiKey,
22+
#[\SensitiveParameter] private string $apiKey,
2323
private string $indexName,
2424
private string $apiVersion,
2525
private string $vectorFieldName = 'vector',

src/Voyage/Platform/Voyage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{
1212
public function __construct(
1313
private HttpClientInterface $httpClient,
14-
private string $apiKey,
14+
#[\SensitiveParameter] private string $apiKey,
1515
) {
1616
}
1717

0 commit comments

Comments
 (0)