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

Partials::addPartial()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
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\Http\Presenter\Repositories;
15
16
// ------------------------------------------------------------------------
17
18
use O2System\Psr\Patterns\Structural\Repository\AbstractRepository;
19
20
/**
21
 * Class Partials
22
 *
23
 * @package O2System\Framework\Http\Presenter\Repositories
24
 */
25
class Partials extends AbstractRepository
26
{
27
    /**
28
     * Partials::hasPartial
29
     *
30
     * @param string $partialOffset
31
     *
32
     * @return bool
33
     */
34
    public function hasPartial($partialOffset)
35
    {
36
        return $this->__isset($partialOffset);
37
    }
38
39
    // ------------------------------------------------------------------------
40
41
    /**
42
     * Partials::addPartial
43
     *
44
     * @param string $partialOffset
45
     * @param string $partialFilePath
46
     */
47
    public function addPartial($partialOffset, $partialFilePath)
48
    {
49
        $this->store($partialOffset, $partialFilePath);
50
    }
51
52
    // ------------------------------------------------------------------------
53
54
    /**
55
     * Partials::get
56
     *
57
     * @param string $partial
58
     *
59
     * @return mixed
60
     */
61
    public function get($partial)
62
    {
63
        $partialContent = parent::get($partial);
64
65
        if (is_file($partialContent)) {
66
            parser()->loadFile($partialContent);
67
68
            return parser()->parse();
69
        } elseif (is_string($partialContent)) {
70
            return $partialContent;
71
        }
72
73
        return null;
74
    }
75
}