Completed
Pull Request — master (#90)
by Arnaud
05:26
created

ResponderTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 23
ccs 0
cts 4
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 9 1
1
<?php
2
3
namespace LAG\AdminBundle\Action\Responder;
4
5
use Symfony\Component\HttpFoundation\Response;
6
use Twig_Environment;
7
8
trait ResponderTrait
9
{
10
    /**
11
     * @var Twig_Environment
12
     */
13
    protected $twig;
14
    
15
    /**
16
     * @param       $template
17
     * @param array $context
18
     *
19
     * @return Response
20
     */
21
    public function render($template, array $context = [])
22
    {
23
        $content =  $this
24
            ->twig
25
            ->render($template, $context)
26
        ;
27
    
28
        return new Response($content);
29
    }
30
}
31