Passed
Push — master ( f54e31...ad3cee )
by Thierry
09:31 queued 04:37
created

App::getScript()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace Jaxon\Features;
4
5
trait App
0 ignored issues
show
Coding Style introduced by
Missing doc comment for trait App
Loading history...
6
{
7
    /**
8
     * Get the Jaxon application bootstrapper.
9
     *
10
     * @return \Jaxon\App\Bootstrap
11
     */
12
    protected function bootstrap()
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 0 found
Loading history...
13
    {
14
        return jaxon()->di()->getBootstrap();
15
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
16
17
    /**
18
     * Get the Jaxon response.
19
     *
20
     * @return \Jaxon\Response\Response
21
     */
22
    public function ajaxResponse()
23
    {
24
        return jaxon()->getResponse();
25
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
26
27
    /**
28
     * Get an instance of a registered class
29
     *
30
     * @param string        $sClassName         The class name
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter type; 8 found
Loading history...
Coding Style introduced by
Expected 1 spaces after parameter name; 9 found
Loading history...
31
     *
32
     * @return mixed
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use object|null.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
33
     */
34
    public function instance($sClassName)
35
    {
36
        return jaxon()->instance($sClassName);
37
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
38
39
    /**
40
     * Get a request to a registered class
41
     *
42
     * @param string        $sClassName         The class name
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter type; 8 found
Loading history...
Coding Style introduced by
Expected 1 spaces after parameter name; 9 found
Loading history...
43
     *
44
     * @return \Jaxon\Request\Factory\CallableClass\Request
45
     */
46
    public function request($sClassName)
47
    {
48
        return jaxon()->request($sClassName);
49
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
50
51
    /**
52
     * Get the request callback manager
53
     *
54
     * @return \Jaxon\Request\Handler\Callback
55
     */
56
    public function callback()
57
    {
58
        return jaxon()->callback();
59
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
60
61
    /**
62
     * Determine if a call is a Jaxon request.
63
     *
64
     * @return boolean
65
     */
66
    public function canProcessRequest()
67
    {
68
        return jaxon()->canProcessRequest();
69
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
70
71
    /**
72
     * Get the HTTP response
73
     *
74
     * @param string    $code       The HTTP response code
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter type; 4 found
Loading history...
Coding Style introduced by
Expected 1 spaces after parameter name; 7 found
Loading history...
75
     *
76
     * @return mixed
77
     */
78
    abstract public function httpResponse($code = '200');
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
79
80
    /**
81
     * Process an incoming Jaxon request, and return the response.
82
     *
83
     * @return mixed
84
     */
85
    abstract public function processRequest();
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
86
87
    /**
88
     * Get the HTML tags to include Jaxon CSS code and files into the page.
89
     *
90
     * @return string  the javascript code
91
     */
92
    public function css()
93
    {
94
        return jaxon()->getCss();
95
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
96
97
    /**
98
     * Get the HTML tags to include Jaxon CSS code and files into the page.
99
     *
100
     * @return string  the javascript code
101
     */
102
    public function getCss()
103
    {
104
        return jaxon()->getCss();
105
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
106
107
    /**
108
     * Get the HTML tags to include Jaxon javascript files into the page.
109
     *
110
     * @return string  the javascript code
111
     */
112
    public function js()
113
    {
114
        return jaxon()->getJs();
115
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
116
117
    /**
118
     * Get the HTML tags to include Jaxon javascript files into the page.
119
     *
120
     * @return string  the javascript code
121
     */
122
    public function getJs()
123
    {
124
        return jaxon()->getJs();
125
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
126
127
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $bIncludeJs should have a doc-comment as per coding-style.
Loading history...
Coding Style introduced by
Parameter $bIncludeCss should have a doc-comment as per coding-style.
Loading history...
128
     * Get the javascript code to be sent to the browser.
129
     *
130
     * @return string  the javascript code
131
     */
132
    public function script($bIncludeJs = false, $bIncludeCss = false)
133
    {
134
        return jaxon()->getScript($bIncludeJs, $bIncludeCss);
135
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
136
137
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $bIncludeJs should have a doc-comment as per coding-style.
Loading history...
Coding Style introduced by
Parameter $bIncludeCss should have a doc-comment as per coding-style.
Loading history...
138
     * Get the javascript code to be sent to the browser.
139
     *
140
     * @return string  the javascript code
141
     */
142
    public function getScript($bIncludeJs = false, $bIncludeCss = false)
143
    {
144
        return jaxon()->getScript($bIncludeJs, $bIncludeCss);
145
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
146
147
    /**
148
     * Get the view renderer
149
     *
150
     * @return \Jaxon\Utils\View\Renderer
151
     */
152
    public function view()
153
    {
154
        return jaxon()->view();
155
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
156
157
    /**
158
     * Get the session manager
159
     *
160
     * @return \Jaxon\Contracts\Session
161
     */
162
    public function session()
163
    {
164
        return jaxon()->session();
165
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
166
}
167