GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

TemplateRenderer::__construct()   A
last analyzed

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
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of the php-phantomjs.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
namespace JonnyW\PhantomJs\Template;
10
11
/**
12
 * PHP PhantomJs
13
 *
14
 * @author Jon Wenmoth <[email protected]>
15
 */
16
class TemplateRenderer implements TemplateRendererInterface
17
{
18
    /**
19
     * Twig environment instance.
20
     *
21
     * @var \Twig_Environment
22
     * @access protected
23
     */
24
    protected $twig;
25
26
    /**
27
     * Internal constructor.
28
     *
29
     * @access public
30
     * @param \Twig_Environment $twig
31
     */
32 15
    public function __construct(\Twig_Environment $twig)
33
    {
34 15
        $this->twig = $twig;
35 15
    }
36
37
    /**
38
     * Render template.
39
     *
40
     * @access public
41
     * @param  string $template
42
     * @param  array  $context  (default: array())
43
     * @return string
44
     */
45 54
    public function render($template, array $context = array())
46
    {
47 54
        $template = $this->twig->createTemplate($template);
48
49 54
        return $template->render($context);
50
    }
51
}
52