Completed
Push — master ( 2c86a7...690ed0 )
by
unknown
36:26 queued 28:50
created

KernelRequestListener::onKernelRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Victoire\Bundle\I18nBundle\Listener;
4
5
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
6
7
/**
8
 * KernelRequestListener add the available locas as global twig variable.
9
 *
10
 * @author Paul Andrieux <[email protected]>
11
 */
12
class KernelRequestListener
13
{
14
    protected $twig;
15
    protected $availableLocales;
16
17
    public function __construct(\Twig_Environment $twig, $availableLocales)
18
    {
19
        $this->twig = $twig;
20
        $this->availableLocales = $availableLocales;
21
    }
22
23
    public function onKernelRequest(GetResponseEvent $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...
24
    {
25
        $this->twig->addGlobal('victoire_i18n_available_locales', $this->availableLocales);
26
    }
27
}
28