DoctrineExtensionsListener   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 3
dl 0
loc 14
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A onLateKernelRequest() 0 4 1
1
<?php
2
3
namespace AppBundle\EventListener;
4
5
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
6
use Gedmo\Translatable\TranslatableListener;
7
8
class DoctrineExtensionsListener
9
{
10
    private $translatable;
11
12
    public function __construct(TranslatableListener $translatable)
13
    {
14
        $this->translatable = $translatable;
15
    }
16
17
    public function onLateKernelRequest(GetResponseEvent $event)
18
    {
19
        $this->translatable->setTranslatableLocale($event->getRequest()->getLocale());
20
    }
21
}
22