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.

ViewFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
cc 1
eloc 3
c 2
b 0
f 2
nc 1
nop 2
dl 0
loc 5
rs 9.4285
1
<?php
2
3
namespace Air\View\Mustache;
4
5
use Air\View\ViewFactory as BaseViewFactory;
6
use Air\View\View;
7
use Air\View\ViewInterface;
8
9
class ViewFactory extends BaseViewFactory
10
{
11
    /**
12
     * @var string $fileExtension The file extension to use when looking for views.
13
     */
14
    protected $fileExtension = 'mustache';
15
16
17
    /**
18
     * @param string|null $cacheDir A directory to cache rendered templates into (enables caching).
19
     * @param string|null $partialsDir A directory where static partials are stored.
20
     */
21
    public function __construct($cacheDir = null, $partialsDir = null)
22
    {
23
        $this->cacheDir = $cacheDir;
24
        $this->partialsDir = $partialsDir;
25
    }
26
27
28
    /**
29
     * @param string $fileName The name of the file to load.
30
     * @return ViewInterface A view.
31
     */
32
    public function get($fileName)
33
    {
34
        return new View(new Renderer($this->cacheDir, $this->partialsDir), $this->find($fileName));
35
    }
36
37
38
    /**
39
     * Return a mustache raw template.
40
     *
41
     * @param string $fileName The name of the file to load.
42
     * @return string The unrendered template (raw).
43
     * @throws \Exception
44
     */
45
    public function getUnrendered($fileName)
46
    {
47
        return file_get_contents($this->find($fileName));
48
    }
49
}
50