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

AdminSubscriber   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 25
ccs 0
cts 14
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSubscribedEvents() 0 6 1
A __construct() 0 4 1
A kernelRequest() 0 5 1
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