Skip to content

Commit

Permalink
Fix style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Hectorhammett committed Jun 7, 2024
1 parent cb23ba9 commit 8415d95
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 36 deletions.
1 change: 0 additions & 1 deletion src/CredentialSource/FileSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class FileSource implements ExternalAccountCredentialSourceInterface
private string $file;
private ?string $format;
private ?string $subjectTokenFieldName;
private string $cacheKey;

/**
* @param string $file The file to read the subject token from.
Expand Down
2 changes: 1 addition & 1 deletion src/CredentialSource/UrlSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ public function fetchSubjectToken(callable $httpHandler = null): string
*/
public function getCacheKey(): string
{
return $this->url . ":" . $this->subjectTokenFieldName;
return $this->url . ':' . $this->subjectTokenFieldName;
}
}
33 changes: 1 addition & 32 deletions src/Credentials/ExternalAccountCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ class ExternalAccountCredentials implements
private ?string $projectId;
private string $universeDomain;

/**
* Used to calculate the Cache Key for caching
*
* @var array<mixed>
*/
private array $jsonKey;

/**
* @param string|string[] $scope The scope of the access request, expressed either as an array
* or as a space-delimited string.
Expand Down Expand Up @@ -129,8 +122,6 @@ public function __construct(
'workforce_pool_user_project should not be set for non-workforce pool credentials.'
);
}

$this->jsonKey = $jsonKey;
}

/**
Expand Down Expand Up @@ -287,7 +278,7 @@ public function fetchAuthToken(callable $httpHandler = null)

/**
* Get the cache token key for the credentials.
* The cache token key format depends on the type of source
* The cache token key format depends on the type of source
* was used to configure these credentials.
*
* @return null|string;
Expand Down Expand Up @@ -375,26 +366,4 @@ private function isWorkforcePool(): bool
$regex = '#//iam\.googleapis\.com/locations/[^/]+/workforcePools/#';
return preg_match($regex, $this->auth->getAudience()) === 1;
}

/**
* @param array<mixed> $arr
*
* @return array<string>
*/
private function flattenJsonKey(array $arr): array
{
$result = [];

foreach($arr as $key => $val) {
if (is_array($val)) {
$result = array_merge($result, $this->flattenJsonKey($val));
} elseif ($val === '') {
continue;
} else {
array_push($result, $val);
}
}

return $result;
}
}
4 changes: 2 additions & 2 deletions src/OAuth2.php
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ public function fetchAuthToken(callable $httpHandler = null, $headers = [])

/**
* @deprecated
*
*
* Obtains a key that can used to cache the results of #fetchAuthToken.
*
* The key is derived from the scopes.
Expand All @@ -707,7 +707,7 @@ public function getCacheKey()

/**
* Gets this instance's SubjectTokenFetcher
*
*
* @return null|ExternalAccountCredentialSourceInterface
*/
public function getSubjectTokenFetcher(): null|ExternalAccountCredentialSourceInterface
Expand Down

0 comments on commit 8415d95

Please sign in to comment.