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.

Noodle::isValidEngine()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
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\Parser\Template\Adapters;
15
16
// ------------------------------------------------------------------------
17
18
use O2System\Parser\Template\Abstracts\AbstractAdapter;
19
20
/**
21
 * Class Noodle
22
 *
23
 * @package O2System\Parser\Template\Adapters
24
 */
25
class Noodle extends AbstractAdapter
26
{
27
    /**
28
     * Noodle::initialize
29
     *
30
     * @param array $config
31
     *
32
     * @return static
33
     */
34
    public function initialize(array $config = [])
35
    {
36
        $config = array_merge($this->config, $config);
37
38
        if (empty($this->engine)) {
39
            $this->engine = new \O2System\Parser\Template\Engines\Noodle($config);
40
        }
41
42
        return $this;
43
    }
44
45
    // ------------------------------------------------------------------------
46
47
    /**
48
     * Noodle::parse
49
     *
50
     * @param array $vars Variable to be parsed.
51
     *
52
     * @return string
53
     */
54
    public function parse(array $vars = [])
55
    {
56
        return $this->engine->parseString($this->string, $vars);
57
    }
58
59
    // ------------------------------------------------------------------------
60
61
    /**
62
     * Noodle::isSupported
63
     *
64
     * Checks if this template engine is supported on this system.
65
     *
66
     * @return bool
67
     */
68
    public function isSupported()
69
    {
70
        if (class_exists('\O2System\Parser\Template\Engines\Noodle')) {
71
            return true;
72
        }
73
74
        return false;
75
    }
76
77
    // ------------------------------------------------------------------------
78
79
    /**
80
     * Noodle::isValidEngine
81
     *
82
     * Checks if is a valid Object Engine.
83
     *
84
     * @param object $engine Engine Object Resource.
85
     *
86
     * @return bool
87
     */
88
    protected function isValidEngine($engine)
89
    {
90
        if ($engine instanceof \O2System\Parser\Template\Engines\Noodle) {
91
            return true;
92
        }
93
94
        return false;
95
    }
96
}