Passed
Push — master ( b5906b...3dcb1c )
by Thierry
02:45
created

Jaxon::getDefaultOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 34

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 34
rs 9.376
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Jaxon.php - Jaxon class
5
 *
6
 * The Jaxon class uses a modular plug-in system to facilitate the processing
7
 * of special Ajax requests made by a PHP page.
8
 * It generates Javascript that the page must include in order to make requests.
9
 * It handles the output of response commands (see <Jaxon\Response\Response>).
10
 * Many flags and settings can be adjusted to effect the behavior of the Jaxon class
11
 * as well as the client-side javascript.
12
 *
13
 * @package jaxon-core
0 ignored issues
show
Coding Style introduced by
Package name "jaxon-core" is not valid; consider "Jaxoncore" instead
Loading history...
14
 * @author Jared White
0 ignored issues
show
Coding Style introduced by
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
15
 * @author J. Max Wilson
0 ignored issues
show
Coding Style introduced by
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
16
 * @author Joseph Woolley
0 ignored issues
show
Coding Style introduced by
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
17
 * @author Steffen Konerow
0 ignored issues
show
Coding Style introduced by
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
18
 * @author Thierry Feuzeu <[email protected]>
19
 * @copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
0 ignored issues
show
Coding Style introduced by
@copyright tag must contain a year and the name of the copyright holder
Loading history...
20
 * @copyright Copyright (c) 2008-2010 by Joseph Woolley, Steffen Konerow, Jared White  & J. Max Wilson
0 ignored issues
show
Coding Style introduced by
@copyright tag must contain a year and the name of the copyright holder
Loading history...
21
 * @copyright 2016 Thierry Feuzeu <[email protected]>
22
 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
23
 * @link https://github.com/jaxon-php/jaxon-core
24
 */
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...
25
26
namespace Jaxon;
27
28
use Jaxon\Plugin\Plugin;
29
use Jaxon\Plugin\Package;
30
use Jaxon\Utils\DI\Container;
31
use Jaxon\Utils\Config\Reader as ConfigReader;
32
33
use Psr\Log\LoggerInterface;
34
use Psr\Log\NullLogger;
35
use Psr\Log\LoggerAwareTrait;
36
use Psr\Log\LoggerAwareInterface;
37
38
class Jaxon implements LoggerAwareInterface
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class Jaxon
Loading history...
39
{
40
    use Features\Config;
41
    use Features\Translator;
42
    use LoggerAwareTrait;
43
44
    /**
45
     * Package version number
46
     *
47
     * @var string
48
     */
49
    private $sVersion = 'Jaxon 3.1.3';
50
51
    /*
52
     * Plugin types
53
     */
0 ignored issues
show
Coding Style introduced by
Empty line required after block comment
Loading history...
54
    // Response plugin
55
    const PLUGIN_RESPONSE = 'ResponsePlugin';
56
    // Request plugin
57
    const PLUGIN_REQUEST = 'RequestPlugin';
58
    // Package plugin
59
    const PLUGIN_PACKAGE = 'PackagePlugin';
60
61
    /*
62
     * Request plugins
63
     */
0 ignored issues
show
Coding Style introduced by
Empty line required after block comment
Loading history...
64
    const CALLABLE_CLASS = 'CallableClass';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
65
    const CALLABLE_DIR = 'CallableDir';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
66
    const CALLABLE_FUNCTION = 'CallableFunction';
67
    // For uploaded files.
68
    const FILE_UPLOAD = 'FileUpload';
69
    // For compatibility with previous versions
70
    const CALLABLE_OBJECT = 'CallableClass'; // Same as CALLABLE_CLASS
71
    const USER_FUNCTION = 'CallableFunction'; // Same as CALLABLE_FUNCTION
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
72
73
    /**
74
     * A static instance on this class
75
     *
76
     * @var Jaxon
77
     */
78
    private static $xInstance = null;
79
80
    /**
81
     * The DI container
82
     *
83
     * @var Container
84
     */
85
    private static $xContainer = null;
86
87
    /**
88
     * Get the static instance
89
     *
90
     * @return Jaxon
91
     */
92
    public static function getInstance()
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
93
    {
94
        if(self::$xInstance == null)
95
        {
96
            self::$xInstance = new Jaxon();
97
        }
98
        return self::$xInstance;
99
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
100
101
    /**
102
     * The constructor
103
     */
104
    public function __construct()
105
    {
106
        // Set the default logger
107
        $this->setLogger(new NullLogger());
108
109
        if(self::$xContainer == null)
110
        {
111
            self::$xContainer = new Container($this->getDefaultOptions());
112
            /*
0 ignored issues
show
Coding Style introduced by
Empty line required before block comment
Loading history...
113
            * Register the Jaxon request and response plugins
0 ignored issues
show
Coding Style introduced by
First line of comment not aligned correctly; expected 13 spaces but found 12
Loading history...
114
            */
0 ignored issues
show
Coding Style introduced by
Last line of comment aligned incorrectly; expected 13 spaces but found 12
Loading history...
Coding Style introduced by
Empty line required after block comment
Loading history...
115
            $this->di()->getPluginManager()->registerRequestPlugins();
116
            $this->di()->getPluginManager()->registerResponsePlugins();
117
        }
118
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
119
120
    /**
121
     * Get the DI container
122
     *
123
     * @return Container
124
     */
125
    public function di()
126
    {
127
        return self::$xContainer;
128
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
129
130
    /**
131
     * The current Jaxon version
132
     *
133
     * @return string
134
     */
135
    public function getVersion()
136
    {
137
        return $this->sVersion;
138
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
139
140
    /**
141
     * Get the logger
142
     *
143
     * @return LoggerInterface
144
     */
145
    public function logger()
146
    {
147
        return $this->logger;
148
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
149
150
    /**
151
     * Get the config reader
152
     *
153
     * @return ConfigReader
154
     */
155
    public function config()
156
    {
157
        return $this->di()->get(ConfigReader::class);
158
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
159
160
    /**
161
     * Get the default options of all components of the library
162
     *
163
     * @return array
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use array<string,string|boolean|integer>.

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...
164
     */
165
    private function getDefaultOptions()
166
    {
167
        // The default configuration settings.
168
        return [
169
            'core.version'                      => $this->getVersion(),
170
            'core.language'                     => 'en',
171
            'core.encoding'                     => 'utf-8',
172
            'core.decode_utf8'                  => false,
173
            'core.prefix.function'              => 'jaxon_',
174
            'core.prefix.class'                 => 'Jaxon',
175
            // 'core.request.uri'               => '',
176
            'core.request.mode'                 => 'asynchronous',
177
            'core.request.method'               => 'POST', // W3C: Method is case sensitive
178
            'core.response.send'                => true,
179
            'core.response.merge.ap'            => true,
180
            'core.response.merge.js'            => true,
181
            'core.debug.on'                     => false,
182
            'core.debug.verbose'                => false,
183
            'core.process.exit'                 => true,
184
            'core.process.clean'                => false,
185
            'core.process.timeout'              => 6000,
186
            'core.error.handle'                 => false,
187
            'core.error.log_file'               => '',
188
            'core.jquery.no_conflict'           => false,
189
            'js.lib.output_id'                  => 0,
190
            'js.lib.queue_size'                 => 0,
191
            'js.lib.load_timeout'               => 2000,
192
            'js.lib.show_status'                => false,
193
            'js.lib.show_cursor'                => true,
194
            'js.app.dir'                        => '',
195
            'js.app.minify'                     => true,
196
            'js.app.options'                    => '',
197
        ];
198
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
199
200
    /**
201
     * Get the Global Response object
202
     *
203
     * @return \Jaxon\Response\Response
204
     */
205
    public function getResponse()
206
    {
207
        return $this->di()->getResponse();
208
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
209
210
    /**
211
     * Create a new Jaxon response object
212
     *
213
     * @return \Jaxon\Response\Response
214
     */
215
    public function newResponse()
216
    {
217
        return $this->di()->newResponse();
218
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
219
220
    /**
221
     * Register a plugin
222
     *
223
     * Below is a table for priorities and their description:
224
     * - 0 thru 999: Plugins that are part of or extensions to the jaxon core
225
     * - 1000 thru 8999: User created plugins, typically, these plugins don't care about order
226
     * - 9000 thru 9999: Plugins that generally need to be last or near the end of the plugin list
227
     *
228
     * @param Plugin    $xPlugin        An instance of a plugin
0 ignored issues
show
Coding Style introduced by
Expected 2 spaces after parameter type; 4 found
Loading history...
Coding Style introduced by
Expected 3 spaces after parameter name; 8 found
Loading history...
229
     * @param integer   $nPriority      The plugin priority, used to order the plugins
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter type; 3 found
Loading history...
Coding Style introduced by
Expected 1 spaces after parameter name; 6 found
Loading history...
230
     *
231
     * @return void
232
     */
233
    public function registerPlugin(Plugin $xPlugin, $nPriority = 1000)
234
    {
235
        $this->di()->getPluginManager()->registerPlugin($xPlugin, $nPriority);
236
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
237
238
    /**
239
     * Register request handlers, including functions, callable classes and directories.
240
     *
241
     * @param string        $sType            The type of request handler being registered
0 ignored issues
show
Coding Style introduced by
Expected 7 spaces after parameter type; 8 found
Loading history...
Coding Style introduced by
Expected 4 spaces after parameter name; 12 found
Loading history...
242
     *        Options include:
0 ignored issues
show
Coding Style introduced by
Parameter comment not aligned correctly; expected 40 spaces but found 8
Loading history...
243
     *        - Jaxon::CALLABLE_FUNCTION: a function declared at global scope
0 ignored issues
show
Coding Style introduced by
Parameter comment not aligned correctly; expected 40 spaces but found 8
Loading history...
244
     *        - Jaxon::CALLABLE_CLASS: a class who's methods are to be registered
0 ignored issues
show
Coding Style introduced by
Parameter comment not aligned correctly; expected 40 spaces but found 8
Loading history...
245
     *        - Jaxon::CALLABLE_DIR: a directory containing classes to be registered
0 ignored issues
show
Coding Style introduced by
Parameter comment not aligned correctly; expected 40 spaces but found 8
Loading history...
246
     *        - Jaxon::PACKAGE: a package
0 ignored issues
show
Coding Style introduced by
Parameter comment not aligned correctly; expected 40 spaces but found 8
Loading history...
247
     * @param string        $sName
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 7 spaces after parameter type; 8 found
Loading history...
248
     *        When registering a function, this is the name of the function
249
     *        When registering a callable class, this is the class name
250
     *        When registering a callable directory, this is the full path to the directory
251
     *        When registering a package or a plugin, this is the corresponding class name
252
     * @param array|string  $xOptions   The related options
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter type; 2 found
Loading history...
Coding Style introduced by
Expected 1 spaces after parameter name; 3 found
Loading history...
253
     *
254
     * @return void
255
     */
256
    public function register($sType, $sName, $xOptions = [])
257
    {
258
        switch($sType)
259
        {
260
        case self::CALLABLE_DIR:
261
        case self::CALLABLE_CLASS:
262
        case self::CALLABLE_FUNCTION:
263
            $this->di()->getPluginManager()->registerCallable($sType, $sName, $xOptions);
264
            break;
265
        /*case self::PLUGIN_RESPONSE:
0 ignored issues
show
Coding Style introduced by
Block comment text must start on a new line
Loading history...
266
            $this->di()->getPluginManager()->registerRequestPlugin($sName, $xOptions);
267
            break;
268
        case self::PLUGIN_REQUEST:
269
            $this->di()->getPluginManager()->registerResponsePlugin($sName, $xOptions);
270
            break;*/
271
        case self::PLUGIN_PACKAGE:
272
            $this->di()->getPluginManager()->registerPackage($sName, $xOptions);
0 ignored issues
show
Bug introduced by
It seems like $xOptions defined by parameter $xOptions on line 256 can also be of type string; however, Jaxon\Plugin\Manager::registerPackage() does only seem to accept array, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
273
            break;
274
        }
275
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
276
277
    /**
278
     * Get an instance of a registered class
279
     *
280
     * @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...
281
     *
282
     * @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...
283
     */
284
    public function instance($sClassName)
285
    {
286
        $xCallable = $this->di()->getCallableRegistry()->getCallableObject($sClassName);
287
        return ($xCallable) ? $xCallable->getRegisteredObject() : null;
288
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
289
290
    /**
291
     * Get a request to a registered class
292
     *
293
     * @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...
294
     *
295
     * @return \Jaxon\Request\Factory\CallableClass\Request
296
     */
297
    public function request($sClassName)
298
    {
299
        $xInstance = $this->instance($sClassName);
300
        return ($xInstance) ? $xInstance->rq() : null;
301
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
302
303
    /**
304
     * Returns the Jaxon Javascript header and wrapper code to be printed into the page
305
     *
306
     * The javascript code returned by this function is dependent on the plugins
307
     * that are included and the functions and classes that are registered.
308
     *
309
     * @param boolean        $bIncludeJs            Also get the JS files
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter type; 8 found
Loading history...
Coding Style introduced by
Expected 2 spaces after parameter name; 12 found
Loading history...
310
     * @param boolean        $bIncludeCss        Also get the CSS files
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; 8 found
Loading history...
311
     *
312
     * @return string
313
     */
314
    public function getScript($bIncludeJs = false, $bIncludeCss = false)
315
    {
316
        return $this->di()->getCodeGenerator()->getScript($bIncludeJs, $bIncludeCss);
317
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
318
319
    /**
320
     * Print the jaxon Javascript header and wrapper code into your page
321
     *
322
     * The javascript code returned by this function is dependent on the plugins
323
     * that are included and the functions and classes that are registered.
324
     *
325
     * @param boolean        $bIncludeJs            Also print the JS files
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter type; 8 found
Loading history...
Coding Style introduced by
Expected 2 spaces after parameter name; 12 found
Loading history...
326
     * @param boolean        $bIncludeCss        Also print the CSS files
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; 8 found
Loading history...
327
     *
328
     * @return void
329
     */
330
    public function printScript($bIncludeJs = false, $bIncludeCss = false)
331
    {
332
        print $this->getScript($bIncludeJs, $bIncludeCss);
333
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
334
335
    /**
336
     * Return the javascript header code and file includes
337
     *
338
     * @return string
339
     */
340
    public function getJs()
341
    {
342
        return $this->di()->getCodeGenerator()->getJs();
343
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
344
345
    /**
346
     * Return the CSS header code and file includes
347
     *
348
     * @return string
349
     */
350
    public function getCss()
351
    {
352
        return $this->di()->getCodeGenerator()->getCss();
353
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
354
355
    /**
356
     * Determine if a call is a jaxon request or a page load request
357
     *
358
     * @return boolean
359
     */
360
    public function canProcessRequest()
361
    {
362
        return $this->di()->getRequestHandler()->canProcessRequest();
363
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
364
365
    /**
366
     * If this is a jaxon request, call the requested PHP function, build the response and send it back to the browser
367
     *
368
     * This is the main server side engine for Jaxon.
369
     * It handles all the incoming requests, including the firing of events and handling of the response.
370
     * If your RequestURI is the same as your web page, then this function should be called before ANY
371
     * headers or HTML is output from your script.
372
     *
373
     * This function may exit after the request is processed, if the 'core.process.exit' option is set to true.
374
     *
375
     * @return void
376
     *
377
     * @see <Jaxon\Jaxon->canProcessRequest>
378
     */
379
    public function processRequest()
380
    {
381
        // Check to see if headers have already been sent out, in which case we can't do our job
382
        if(headers_sent($filename, $linenumber))
383
        {
384
            echo $this->trans('errors.output.already-sent', [
385
                'location' => $filename . ':' . $linenumber
386
            ]), "\n", $this->trans('errors.output.advice');
387
            exit();
388
        }
389
390
        $this->di()->getRequestHandler()->processRequest();
391
392
        if(($this->getOption('core.response.send')))
393
        {
394
            $this->di()->getResponseManager()->sendOutput();
395
396
            if(($this->getOption('core.process.exit')))
397
            {
398
                exit();
399
            }
400
        }
401
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
402
403
    /**
404
     * Get a registered response plugin
405
     *
406
     * @param string        $sName                The name of the plugin
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; 16 found
Loading history...
407
     *
408
     * @return \Jaxon\Plugin\Response
409
     */
410
    public function plugin($sName)
411
    {
412
        return $this->di()->getPluginManager()->getResponsePlugin($sName);
413
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
414
415
    /**
416
     * Get a package instance
417
     *
418
     * @param string        $sClassName           The package 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; 11 found
Loading history...
419
     *
420
     * @return \Jaxon\Plugin\Package
421
     */
422
    public function package($sClassName)
423
    {
424
        return $this->di()->getPluginManager()->getPackage($sClassName);
425
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
426
427
    /**
428
     * Get the upload plugin
429
     *
430
     * @return \Jaxon\Request\Plugin\FileUpload
431
     */
432
    public function upload()
433
    {
434
        return $this->di()->getPluginManager()->getRequestPlugin(self::FILE_UPLOAD);
435
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
436
437
    /**
438
     * Get the request callback manager
439
     *
440
     * @return \Jaxon\Request\Handler\Callback
441
     */
442
    public function callback()
443
    {
444
        return $this->di()->getRequestHandler()->getCallbackManager();
445
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
446
447
    /**
448
     * Get the dialog wrapper
449
     *
450
     * @return \Jaxon\Utils\Dialogs\Dialog
451
     */
452
    public function dialog()
453
    {
454
        return $this->di()->getDialog();
455
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
456
457
    /**
458
     * Get the template engine
459
     *
460
     * @return \Jaxon\Utils\Template\Engine
461
     */
462
    public function template()
463
    {
464
        return $this->di()->getTemplateEngine();
465
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
466
467
    /**
468
     * Get the App instance
469
     *
470
     * @return \Jaxon\App\App
471
     */
472
    public function app()
473
    {
474
        return $this->di()->getApp();
475
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
476
477
    /**
478
     * Get the view renderer
479
     *
480
     * @return \Jaxon\Utils\View\Renderer
481
     */
482
    public function view()
483
    {
484
        return $this->di()->getViewRenderer();
485
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
486
487
    /**
488
     * Get the session manager
489
     *
490
     * @return \Jaxon\Contracts\Session
491
     */
492
    public function session()
493
    {
494
        return $this->di()->getSessionManager();
495
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
496
}
497