KernelTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 7
dl 0
loc 13
rs 10
c 2
b 1
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A loadKernel() 0 8 2
1
<?php
2
3
namespace PiedWeb\CMSBundle\Utils;
4
5
use Symfony\Component\HttpKernel\KernelInterface;
6
7
trait KernelTrait
8
{
9
    public static $appKernel;
10
    protected $kernel;
11
12
    public static function loadKernel(KernelInterface $kernel)
13
    {
14
        if (null === static::$appKernel) {
15
            $kernelClass = \get_class($kernel);
16
            static::$appKernel = new $kernelClass('dev', true);
17
            //static::$appKernel = clone $kernel;
18
            // NOTE: If we clone, it's take too much time in dev mod
19
            static::$appKernel->boot();
20
        }
21
    }
22
}
23