OriginalTwigEnvironmentProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A get() 0 4 1
1
<?php
2
/**
3
 * This file is part of the Madapaja.TwigModule package.
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace Madapaja\TwigModule;
8
9
use Ray\Di\Di\Named;
10
use Ray\Di\ProviderInterface;
11
use Twig_Environment;
12
use Twig_LoaderInterface;
13
14
class OriginalTwigEnvironmentProvider implements ProviderInterface
15
{
16
    private $loader;
17
    private $options = [];
18
19
    /**
20
     * @Named("loader=twig_loader,options=Madapaja\TwigModule\Annotation\TwigOptions")
21
     */
22 22
    public function __construct(Twig_LoaderInterface $loader, array $options = [])
23
    {
24 22
        $this->loader = $loader;
25 22
        $this->options = $options;
26 22
    }
27
28
    /**
29
     * @return Twig_Environment
30
     */
31 22
    public function get()
32
    {
33 22
        return new Twig_Environment($this->loader, $this->options);
34
    }
35
}
36