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.
Passed
Push — master ( a1835d...10e84a )
by
unknown
02:48
created

Layout   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 53
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
A getPartials() 0 3 1
A getContents() 0 3 1
1
<?php
2
/**
3
 * This file is part of the O2System Framework package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author         Steeve Andrian Salim
9
 * @copyright      Copyright (c) Steeve Andrian Salim
10
 */
11
12
// ------------------------------------------------------------------------
13
14
namespace O2System\Framework\Containers\Modules\DataStructures\Module\Theme;
15
16
// ------------------------------------------------------------------------
17
18
use O2System\Framework\Containers\Modules\DataStructures\Module\Theme\Layout\Partials;
19
use O2System\Spl\Info\SplFileInfo;
20
21
/**
22
 * Class Layout
23
 *
24
 * @package O2System\Framework\Containers\Modules\DataStructures\Module\Theme
25
 */
26
class Layout extends SplFileInfo
27
{
28
    /**
29
     * Layout::$partials
30
     *
31
     * @var \O2System\Framework\Containers\Modules\DataStructures\Module\Theme\Layout\Partials
32
     */
33
    protected $partials;
34
35
    // ------------------------------------------------------------------------
36
37
    /**
38
     * Layout::__construct
39
     *
40
     * @param string $filePath
41
     */
42
    public function __construct($filePath)
43
    {
44
        parent::__construct($filePath);
45
46
        $this->partials = new Partials();
47
48
        $filenameParts = explode('.', pathinfo($filePath, PATHINFO_BASENAME));
49
        array_shift($filenameParts);
50
51
        $this->partials
52
            ->setPath($this->getPath() . DIRECTORY_SEPARATOR . 'partials' . DIRECTORY_SEPARATOR)
53
            ->setExtension(implode('.', $filenameParts))
54
            ->autoload();
55
    }
56
57
    // ------------------------------------------------------------------------
58
59
    /**
60
     * Layout::getPartials
61
     *
62
     * @return \O2System\Framework\Containers\Modules\DataStructures\Module\Theme\Layout\Partials
63
     */
64
    public function getPartials()
65
    {
66
        return $this->partials;
67
    }
68
69
    // ------------------------------------------------------------------------
70
71
    /**
72
     * Layout::getContents
73
     *
74
     * @return false|string
75
     */
76
    public function getContents()
77
    {
78
        return file_get_contents($this->getRealPath());
79
    }
80
}