Skip to content

Commit

Permalink
SCA
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentBean committed Feb 13, 2025
1 parent 4596292 commit f435d00
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/OAuth/KeyStore/DatabaseKeyStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function get(string $connection): array
/** @var ?OAuthKey $key */
$key = OAuthKey::query()->firstWhere('magento_connection', '=', $connection);

return $key?->keys ?? [];
return $key->keys ?? [];
}

public function set(string $connection, array $data): void
Expand Down
10 changes: 5 additions & 5 deletions src/OAuth/MagentoServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function createTemporaryCredentials($body): TemporaryCredentials
{
parse_str($body, $data);

if (! $data || ! is_array($data)) {
if (! $data ) {
throw new CredentialsException('Unable to parse temporary credentials response.');
}

Expand Down Expand Up @@ -80,13 +80,13 @@ public function userUid($data, TokenCredentials $tokenCredentials): int
return 0;
}

public function userEmail($data, TokenCredentials $tokenCredentials)
public function userEmail($data, TokenCredentials $tokenCredentials): ?string
{
//
return null;
}

public function userScreenName($data, TokenCredentials $tokenCredentials)
public function userScreenName($data, TokenCredentials $tokenCredentials): ?string
{
//
return null;
}
}
4 changes: 2 additions & 2 deletions tests/OAuth/KeyStore/FileKeyStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function it_can_get_data(): void
/** @var FileKeyStore $store */
$store = KeyStore::instance();

/** @var string $encoded */
/** @var non-empty-string $encoded */
$encoded = json_encode($content);

Storage::disk($store->disk)->put($store->path.'/default.json', $encoded);
Expand Down Expand Up @@ -61,7 +61,7 @@ public function it_can_merge_data(): void
'key' => 'value',
];

/** @var string $encoded */
/** @var non-empty-string $encoded */
$encoded = json_encode($content);

/** @var FileKeyStore $store */
Expand Down

0 comments on commit f435d00

Please sign in to comment.