Skip to content

Commit 0244cc1

Browse files
committed
Fix: style
1 parent e18b4cc commit 0244cc1

4 files changed

Lines changed: 7 additions & 10 deletions

File tree

src/Controller/DashboardController.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,13 @@
44

55
namespace PhpList\WebFrontend\Controller;
66

7-
use PhpList\RestApiClient\Endpoint\AuthClient;
87
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
98
use Symfony\Component\HttpFoundation\Request;
109
use Symfony\Component\HttpFoundation\Response;
1110
use Symfony\Component\Routing\Attribute\Route;
1211

1312
class DashboardController extends AbstractController
1413
{
15-
public function __construct(AuthClient $apiClient)
16-
{
17-
$this->apiClient = $apiClient;
18-
}
19-
2014
#[Route('/', name: 'home', methods: ['GET'])]
2115
public function index(Request $request): Response
2216
{

src/Controller/SubscribersController.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ public function __construct(private readonly SubscribersClient $subscribersClien
2020
{
2121
}
2222

23+
/**
24+
* @SuppressWarnings("CyclomaticComplexity")
25+
* @SuppressWarnings("NPathComplexity")
26+
*/
2327
#[Route('/subscribers', name: 'subscribers', methods: ['GET'])]
2428
public function index(Request $request): JsonResponse|Response
2529
{

src/EventSubscriber/AuthGateSubscriber.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ public function onKernelRequest(RequestEvent $event): void
4242
}
4343

4444
$session = $request->getSession();
45-
if (!$session || !$session->has('auth_token')) {
45+
if (!$session->has('auth_token')) {
4646
$loginUrl = $this->urlGenerator->generate('login');
4747
$event->setResponse(new RedirectResponse($loginUrl));
4848
}
4949
}
5050

5151
private function isPublicPath(Request $request): bool
5252
{
53-
$path = $request->getPathInfo() ?? '/';
53+
$path = $request->getPathInfo();
5454

5555
// Public login route
5656
if ($path === '/login' || str_starts_with($path, '/login')) {

src/EventSubscriber/UnauthorizedSubscriber.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ public function onKernelException(ExceptionEvent $event): void
3232
{
3333
$exception = $event->getThrowable();
3434

35-
if (
36-
($exception instanceof ClientException && $exception->getCode() === 401) ||
35+
if (($exception instanceof ClientException && $exception->getCode() === 401) ||
3736
$exception instanceof AuthenticationException
3837
) {
3938
$request = $event->getRequest();

0 commit comments

Comments
 (0)