Skip to content

Commit f435d00

Browse files
committed
SCA
1 parent 4596292 commit f435d00

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/OAuth/KeyStore/DatabaseKeyStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function get(string $connection): array
1111
/** @var ?OAuthKey $key */
1212
$key = OAuthKey::query()->firstWhere('magento_connection', '=', $connection);
1313

14-
return $key?->keys ?? [];
14+
return $key->keys ?? [];
1515
}
1616

1717
public function set(string $connection, array $data): void

src/OAuth/MagentoServer.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function createTemporaryCredentials($body): TemporaryCredentials
4848
{
4949
parse_str($body, $data);
5050

51-
if (! $data || ! is_array($data)) {
51+
if (! $data ) {
5252
throw new CredentialsException('Unable to parse temporary credentials response.');
5353
}
5454

@@ -80,13 +80,13 @@ public function userUid($data, TokenCredentials $tokenCredentials): int
8080
return 0;
8181
}
8282

83-
public function userEmail($data, TokenCredentials $tokenCredentials)
83+
public function userEmail($data, TokenCredentials $tokenCredentials): ?string
8484
{
85-
//
85+
return null;
8686
}
8787

88-
public function userScreenName($data, TokenCredentials $tokenCredentials)
88+
public function userScreenName($data, TokenCredentials $tokenCredentials): ?string
8989
{
90-
//
90+
return null;
9191
}
9292
}

tests/OAuth/KeyStore/FileKeyStoreTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function it_can_get_data(): void
2828
/** @var FileKeyStore $store */
2929
$store = KeyStore::instance();
3030

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

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

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

6767
/** @var FileKeyStore $store */

0 commit comments

Comments
 (0)