Completed
Pull Request — 1.x (#19)
by IWASAKI
04:57 queued 02:30
created

TwigEnvironmentProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A get() 0 4 1
1
<?php
2
3
namespace Madapaja\TwigModule;
4
5
use Ray\Di\Di\Named;
6
use Ray\Di\ProviderInterface;
7
use Twig_Environment;
8
9
class TwigEnvironmentProvider implements ProviderInterface
10
{
11
    private $twig;
12
13
    /**
14
     * @param Twig_Environment $twig
15
     *
16
     * @Named("original")
17
     */
18 20
    public function __construct(Twig_Environment $twig)
19
    {
20 20
        $this->twig = $twig;
21 20
    }
22
23
    /**
24
     * @return Twig_Environment
25
     */
26 20
    public function get()
27
    {
28 20
        return $this->twig;
29
    }
30
}
31