Completed
Push — master ( f63aaf...b18312 )
by Alex
05:51
created

TwigDefaultExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 17
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 2
1
<?php
2
3
namespace AlexMasterov\EquipTwig\Configuration;
4
5
use AlexMasterov\EquipTwig\Configuration\TwigExtensionSet;
6
use AlexMasterov\EquipTwig\Extension\SessionExtension;
7
use Equip\SessionInterface;
8
9
class TwigDefaultExtension extends TwigExtensionSet
10
{
11
    /**
12
     * @param array $extensions
13
     */
14 1
    public function __construct(array $extensions = [])
15
    {
16 1
        $defaults = [];
17
18
        // equip/session
19 1
        if (interface_exists(SessionInterface::class)) {
20 1
            $defaults[] = SessionExtension::class;
21
        }
22
23 1
        parent::__construct(array_merge($defaults, $extensions));
24 1
    }
25
}
26