Skip to content

Commit 9a5fa99

Browse files
authored
chore: fix client phpdoc (#2568)
1 parent ab9bfc3 commit 9a5fa99

File tree

1 file changed

+60
-39
lines changed

1 file changed

+60
-39
lines changed

src/Client.php

Lines changed: 60 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -105,47 +105,84 @@ class Client
105105
/**
106106
* Construct the Google Client.
107107
*
108-
* @param array $config
108+
* @param array $config {
109+
* An array of required and optional arguments.
110+
*
111+
* @type string $application_name
112+
* The name of your application
113+
* @type string $base_path
114+
* The base URL for the service. This is only accounted for when calling
115+
* {@see Client::authorize()} directly.
116+
* @type string $client_id
117+
* Your Google Cloud client ID found in https://developers.google.com/console
118+
* @type string $client_secret
119+
* Your Google Cloud client secret found in https://developers.google.com/console
120+
* @type string|array|CredentialsLoader $credentials
121+
* Can be a path to JSON credentials or an array representing those
122+
* credentials (@see Google\Client::setAuthConfig), or an instance of
123+
* {@see CredentialsLoader}.
124+
* @type string|array $scopes
125+
* {@see Google\Client::setScopes}
126+
* @type string $quota_project
127+
* Sets X-Goog-User-Project, which specifies a user project to bill
128+
* for access charges associated with the request.
129+
* @type string $redirect_uri
130+
* @type string $state
131+
* @type string $developer_key
132+
* Simple API access key, also from the API console. Ensure you get
133+
* a Server key, and not a Browser key.
134+
* @type bool $use_application_default_credentials
135+
* For use with Google Cloud Platform
136+
* fetch the ApplicationDefaultCredentials, if applicable
137+
* {@see https://developers.google.com/identity/protocols/application-default-credentials}
138+
* @type string $signing_key
139+
* @type string $signing_algorithm
140+
* @type string $subject
141+
* @type string $hd
142+
* @type string $prompt
143+
* @type string $openid
144+
* @type bool $include_granted_scopes
145+
* @type string $login_hint
146+
* @type string $request_visible_actions
147+
* @type string $access_type
148+
* @type string $approval_prompt
149+
* @type array $retry
150+
* Task Runner retry configuration
151+
* {@see \Google\Task\Runner}
152+
* @type array $retry_map
153+
* @type CacheItemPoolInterface $cache
154+
* Cache class implementing {@see CacheItemPoolInterface}. Defaults
155+
* to {@see MemoryCacheItemPool}.
156+
* @type array $cache_config
157+
* Cache config for downstream auth caching.
158+
* @type callable $token_callback
159+
* Function to be called when an access token is fetched. Follows
160+
* the signature `function (string $cacheKey, string $accessToken)`.
161+
* @type \Firebase\JWT $jwt
162+
* Service class used in {@see Client::verifyIdToken()}. Explicitly
163+
* pass this in to avoid setting {@see \Firebase\JWT::$leeway}
164+
* @type bool $api_format_v2
165+
* Setting api_format_v2 will return more detailed error messages
166+
* from certain APIs.
167+
* }
109168
*/
110169
public function __construct(array $config = [])
111170
{
112171
$this->config = array_merge([
113172
'application_name' => '',
114-
115-
// Don't change these unless you're working against a special development
116-
// or testing environment.
117173
'base_path' => self::API_BASE_PATH,
118-
119-
// https://developers.google.com/console
120174
'client_id' => '',
121175
'client_secret' => '',
122-
123-
// Can be a path to JSON credentials or an array representing those
124-
// credentials (@see Google\Client::setAuthConfig), or an instance of
125-
// Google\Auth\CredentialsLoader.
126176
'credentials' => null,
127-
// @see Google\Client::setScopes
128177
'scopes' => null,
129-
// Sets X-Goog-User-Project, which specifies a user project to bill
130-
// for access charges associated with the request
131178
'quota_project' => null,
132-
133179
'redirect_uri' => null,
134180
'state' => null,
135-
136-
// Simple API access key, also from the API console. Ensure you get
137-
// a Server key, and not a Browser key.
138181
'developer_key' => '',
139-
140-
// For use with Google Cloud Platform
141-
// fetch the ApplicationDefaultCredentials, if applicable
142-
// @see https://developers.google.com/identity/protocols/application-default-credentials
143182
'use_application_default_credentials' => false,
144183
'signing_key' => null,
145184
'signing_algorithm' => null,
146185
'subject' => null,
147-
148-
// Other OAuth2 parameters.
149186
'hd' => '',
150187
'prompt' => '',
151188
'openid.realm' => '',
@@ -154,28 +191,12 @@ public function __construct(array $config = [])
154191
'request_visible_actions' => '',
155192
'access_type' => 'online',
156193
'approval_prompt' => 'auto',
157-
158-
// Task Runner retry configuration
159-
// @see Google\Task\Runner
160194
'retry' => [],
161195
'retry_map' => null,
162-
163-
// Cache class implementing Psr\Cache\CacheItemPoolInterface.
164-
// Defaults to Google\Auth\Cache\MemoryCacheItemPool.
165196
'cache' => null,
166-
// cache config for downstream auth caching
167197
'cache_config' => [],
168-
169-
// function to be called when an access token is fetched
170-
// follows the signature function ($cacheKey, $accessToken)
171198
'token_callback' => null,
172-
173-
// Service class used in Google\Client::verifyIdToken.
174-
// Explicitly pass this in to avoid setting JWT::$leeway
175199
'jwt' => null,
176-
177-
// Setting api_format_v2 will return more detailed error messages
178-
// from certain APIs.
179200
'api_format_v2' => false
180201
], $config);
181202

0 commit comments

Comments
 (0)