Skip to content

Commit 6dd9352

Browse files
committed
ISSUE-345: phpcs fix
1 parent 9fde739 commit 6dd9352

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/EventSubscriber/UnauthorizedSubscriber.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PhpList\WebFrontend\EventSubscriber;
46

57
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

src/Service/ApiClient.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use GuzzleHttp\Client;
1010
use GuzzleHttp\Exception\GuzzleException;
1111
use JsonException;
12+
use RuntimeException;
1213

1314
class ApiClient
1415
{
@@ -28,7 +29,7 @@ public function __construct(string $baseUrl)
2829

2930
/**
3031
* @throws GuzzleException
31-
* @throws JsonException
32+
* @throws RuntimeException|JsonException
3233
*/
3334
public function authenticate(string $username, string $password): array
3435
{
@@ -41,13 +42,13 @@ public function authenticate(string $username, string $password): array
4142
]);
4243

4344
if (!isset($response['key'])) {
44-
throw new \RuntimeException('Authentication failed: No token received');
45+
throw new RuntimeException('Authentication failed: No token received');
4546
}
4647

4748
return $response;
4849
} catch (GuzzleException $e) {
4950
if ($e->getCode() === 401) {
50-
throw new \RuntimeException('Invalid credentials', 401, $e);
51+
throw new RuntimeException('Invalid credentials', 401, $e);
5152
}
5253
throw $e;
5354
}

0 commit comments

Comments
 (0)