GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

RequestListener   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
eloc 9
c 2
b 0
f 2
dl 0
loc 18
rs 10
wmc 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A onKernelRequest() 0 13 5
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Odiseo\SyliusMailchimpPlugin\EventListener;
6
7
use Symfony\Component\HttpKernel\Event\RequestEvent;
8
9
final class RequestListener
10
{
11
    /**
12
     * @param RequestEvent $event
13
     */
14
    public function onKernelRequest(RequestEvent $event): void
15
    {
16
        if (!$event->isMasterRequest()) {
17
            return;
18
        }
19
20
        $request = $event->getRequest();
21
22
        $session = $request->getSession();
23
        if ($session !== null) {
24
            if (!$session->get('campaingId')) {
25
                if ($request->get('mc_cid')) {
26
                    $session->set('campaingId', $request->get('mc_cid'));
27
                }
28
            }
29
        }
30
    }
31
}
32