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.

Haanga   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 40
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 21 2
A reunite() 0 6 1
1
<?php
2
/**
3
 * View
4
 *
5
 * @copyright Copyright (c)  Gjero Krsteski (http://krsteski.de)
6
 * @license   http://opensource.org/licenses/MIT MIT License
7
 */
8
9
namespace Pimf\View;
10
11
use Pimf\Contracts\Reunitable;
12
use Pimf\View;
13
use Pimf\Config;
14
15
/**
16
 * A view for HAANGA template engine that uses Django syntax - fast and secure template engine for PHP.
17
 *
18
 * For use please add the following code to the end of the config.app.php file:
19
 *
20
 * <code>
21
 *
22
 * 'view' => array(
23
 *
24
 *   'haanga' => array(
25
 *     'cache'       => true,  // if compilation caching should be used
26
 *     'debug'       => false, // if set to true, you can display the generated nodes
27
 *     'auto_reload' => true,  // useful to recompile the template whenever the source code changes
28
 *  ),
29
 *
30
 * ),
31
 *
32
 * </code>
33
 *
34
 * @link    http://haanga.org/documentation
35
 * @package View
36
 * @author  Gjero Krsteski <[email protected]>
37
 * @codeCoverageIgnore
38
 */
39
class Haanga extends View implements Reunitable
40
{
41
    /**
42
     * @param string $template
43
     * @param array  $data
44
     */
45
    public function __construct($template, array $data = array())
46
    {
47
        parent::__construct($template, $data);
48
49
        $conf = Config::get('view.haanga');
50
51
        $options = [
52
            'debug'        => $conf['debug'],
53
            'template_dir' => $this->path,
54
            'autoload'     => $conf['auto_reload'],
55
56
        ];
57
58
        if ($conf['cache'] === true) {
59
            $options['cache_dir'] = $this->path . '/haanga_cache';
60
        }
61
62
        require_once BASE_PATH . "Haanga/lib/Haanga.php";
63
64
        \Haanga::configure($options);
65
    }
66
67
    /**
68
     * Puts the template an the variables together.
69
     *
70
     * @return NULL|string|void
71
     */
72
    public function reunite()
73
    {
74
        return \Haanga::Load(
75
            $this->template, $this->data->getArrayCopy()
76
        );
77
    }
78
}
79