Passed
Push — master ( b8ef91...1702ae )
by Thierry
02:46
created

Package::readyEnabled()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
cc 1
nc 1
nop 0
rs 10
1
<?php
2
3
/**
4
 * Generator.php - Code generator interface
5
 *
6
 * Any class generating css or js code must implement this interface.
7
 *
8
 * @package jaxon-core
0 ignored issues
show
Coding Style introduced by
Package name "jaxon-core" is not valid; consider "Jaxoncore" instead
Loading history...
9
 * @author Thierry Feuzeu <[email protected]>
10
 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
11
 * @link https://github.com/jaxon-php/jaxon-core
12
 */
0 ignored issues
show
Coding Style introduced by
PHP version not specified
Loading history...
Coding Style introduced by
Missing @category tag in file comment
Loading history...
13
14
namespace Jaxon\Plugin;
15
16
abstract class Package implements Code\Contracts\Generator
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class Package
Loading history...
17
{
18
    /**
19
     * The configuration options of the package
20
     *
21
     * @var array
22
     */
23
    protected $aOptions = [];
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line(s) before first member var; 0 found
Loading history...
24
25
    /**
26
     * Whether to include the getReadyScript() in the generated code.
27
     *
28
     * @var boolean
29
     */
30
    protected $bReadyEnabled = false;
31
32
    /**
33
     * Get package options.
34
     *
35
     * @return array
36
     */
37
    public function getOptions()
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
38
    {
39
        return $this->aOptions;
40
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
41
42
    /**
43
     * Get the view renderer
44
     *
45
     * @return \Jaxon\Utils\View\Renderer
46
     */
47
    public function view()
48
    {
49
        return jaxon()->view();
50
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
51
52
    /**
53
     * Get the path to the config file
54
     *
55
     * @return string
56
     */
57
    abstract public static function getConfigFile();
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
58
59
    /**
60
     * Include the getReadyScript() in the generated code.
61
     *
62
     * @return void
63
     */
64
    public function ready()
65
    {
66
        $this->bReadyEnabled = true;
67
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
68
69
    /**
70
     * @inheritDoc
71
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
72
    public function readyEnabled()
73
    {
74
        return $this->bReadyEnabled;
75
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
76
77
    /**
78
     * @inheritDoc
79
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
80
    public final function getHash()
81
    {
82
        // Packages do not generate hash on their own. So we make this method final.
83
        return '';
84
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
85
86
    /**
87
     * @inheritDoc
88
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
89
    public function getCss()
90
    {
91
        return '';
92
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
93
94
    /**
95
     * @inheritDoc
96
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
97
    public function getJs()
98
    {
99
        return '';
100
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
101
102
    /**
103
     * @inheritDoc
104
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
105
    public final function getScript()
106
    {
107
        // Packages do not generate script. So we make this method final.
108
        return '';
109
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
110
111
    /**
112
     * Get the HTML code of the package home page
113
     *
114
     * @return string
115
     */
116
    abstract public function getHtml();
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
117
}
118