Passed
Push — feature/twig-extention-support ( 275975...b08649 )
by IWASAKI
05:45
created

OriginalTwigEnvironmentProvider::setOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Madapaja\TwigModule;
4
5
use Ray\Di\Di\Named;
6
use Ray\Di\ProviderInterface;
7
use Twig_LoaderInterface;
8
use Twig_Environment;
9
10
class OriginalTwigEnvironmentProvider implements ProviderInterface
11
{
12
    private $loader;
13
    private $options = [];
14
15
    /**
16
     * @Named("loader=twig_loader,options=Madapaja\TwigModule\Annotation\TwigOptions")
17
     */
18 21
    public function __construct(Twig_LoaderInterface $loader, array $options = [])
19
    {
20 21
        $this->loader = $loader;
21 21
        $this->options = $options;
22 21
    }
23
24
    /**
25
     * @return Twig_Environment
26
     */
27 21
    public function get()
28
    {
29 21
        return new Twig_Environment($this->loader, $this->options);
30
    }
31
}
32