Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Hectorhammett committed Jun 6, 2024
1 parent ef8ac52 commit 98fce26
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Credentials/ExternalAccountCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public function fetchAuthToken(callable $httpHandler = null)

public function getCacheKey()
{
return implode(":", $this->flattenJsonKey($this->jsonKey)) . ':' . $this->auth->getFormattedScopeOrAudience();
return implode(':', $this->flattenJsonKey($this->jsonKey)) . ':' . $this->auth->getFormattedScopeOrAudience();
}

public function getLastReceivedToken()
Expand Down Expand Up @@ -367,7 +367,7 @@ private function flattenJsonKey($arr): array
{
$result = [];

foreach($arr as $key => $val){
foreach($arr as $key => $val) {
if (is_array($val)) {
$result = array_merge($result, $this->flattenJsonKey($val));
} elseif ($val === '') {
Expand Down
2 changes: 1 addition & 1 deletion src/Credentials/ServiceAccountJwtAccessCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function fetchAuthToken(callable $httpHandler = null)
*/
public function getCacheKey()
{
return $this->auth->getIssuer() . ":" . $this->auth->getFormattedScopeOrAudience();
return $this->auth->getIssuer() . ':' . $this->auth->getFormattedScopeOrAudience();
}

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/Credentials/ExternalAccountCredentialsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -524,12 +524,12 @@ public function testFetchAuthTokenWithWorkforcePoolCredentials()
public function testCacheKeyFormat()
{
$credentials = new ExternalAccountCredentials('scope1', $this->baseCreds);
$cacheKey = $credentials->getCacheKey();
$cacheKey = $credentials->getCacheKey();

// I decided to hand craft this manually to avoid reusing the flattenJsonKey method
// inside the ExternalAccountCredentials class and make
// inside the ExternalAccountCredentials class and make
// sure the flat function works properly
$expectedKey = 'external_account:token-url.com:sts-url.com:scope1';
$expectedKey = 'external_account:token-url.com:sts-url.com:scope1';
$this->assertEquals($expectedKey, $cacheKey);
}

Expand Down

0 comments on commit 98fce26

Please sign in to comment.