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

ResponderTrait::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 9
ccs 0
cts 4
cp 0
rs 9.6666
cc 1
eloc 5
nc 1
nop 2
crap 2
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