Completed
Push — dev ( 5c06f5...dcd39b )
by Arnaud
09:19
created

AdminSubscriber::kernelRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 0
cts 4
cp 0
rs 9.4285
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace LAG\AdminBundle\Event\Subscriber;
4
5
use LAG\AdminBundle\Admin\Factory\AdminFactory;
6
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
7
use Symfony\Component\HttpKernel\Event\KernelEvent;
8
use Symfony\Component\HttpKernel\KernelEvents;
9
10
class AdminSubscriber implements EventSubscriberInterface
11
{
12
    /**
13
     * @var AdminFactory
14
     */
15
    protected $adminFactory;
16
17
    public static function getSubscribedEvents()
18
    {
19
        return [
20
            KernelEvents::REQUEST => 'kernelRequest'
21
        ];
22
    }
23
24
    public function __construct(AdminFactory $adminFactory)
25
    {
26
        $this->adminFactory = $adminFactory;
27
    }
28
29
    public function kernelRequest(KernelEvent $event)
0 ignored issues
show
Unused Code introduced by
The parameter $event is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
30
    {
31
        // init admin factory
32
        $this->adminFactory->init();
33
    }
34
}
35