Loader.php ➔ route()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Luthier loader
5
 *
6
 * @author    Anderson Salas <[email protected]>
7
 * @copyright 2017
8
 * @license   GNU-3.0
9
 *
10
 */
11
12
namespace Luthier\Core;
13
14
class Loader
15
{
16
17
    /**
18
     * Returns the Luthier required hooks
19
     *
20
     * @return array
21
     *
22
     * @access public
23
     * @static
24
     */
25
    public static function init()
26
    {
27
        return [
28
            'pre_system' =>
29
                [
30
                    function()
31
                    {
32
                        function route($name, $args = NULL)
33
                        {
34
                            return Route::getRouteByName($name, $args);
35
                        }
36
                    }
37
                ],
38
            'post_controller_constructor' =>
39
                [
40
                    function()
41
                    {
42
                        Middleware::init();
43
                    }
44
                ],
45
46
        ];
47
    }
48
}