Skip to content

Commit ec24528

Browse files
docs(storage-api-client): add PHPStan type annotations for authType
Add @phpstan-var annotation for the authType property and @phpstan-param annotation for the constructor config array to ensure type safety with the AUTH_TYPE_* constants. Co-Authored-By: Tomáš Fejfar <tomas.fejfar@keboola.com>
1 parent 9626364 commit ec24528

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/Keboola/StorageApi/Client.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ class Client
7676
// Token string
7777
public $token;
7878

79-
// Authentication type: AUTH_TYPE_STORAGE_TOKEN (default) or AUTH_TYPE_BEARER
79+
/**
80+
* @phpstan-var self::AUTH_TYPE_* Authentication type
81+
*/
8082
private string $authType = self::AUTH_TYPE_STORAGE_TOKEN;
8183

8284
// current run id sent with all request
@@ -152,7 +154,8 @@ class Client
152154
* - logger: instance of Psr\Log\LoggerInterface
153155
* - jobPollRetryDelay: callable method which determines wait period for job polling
154156
* - handler: custom Guzzle handler, allows mocking responses in tests
155-
* - authType: authentication type, either 'storage-token' (default) or 'bearer'
157+
* - authType: authentication type (AUTH_TYPE_STORAGE_TOKEN or AUTH_TYPE_BEARER)
158+
* @phpstan-param array{token: string, url: string, userAgent?: string, backoffMaxTries?: int, retryOnMaintenance?: bool, awsRetries?: int, logger?: \Psr\Log\LoggerInterface, jobPollRetryDelay?: callable, handler?: mixed, authType?: self::AUTH_TYPE_*} $config
156159
*/
157160
public function __construct(array $config = [])
158161
{

0 commit comments

Comments
 (0)