Completed
Push — master ( cd59e7...630f46 )
by Nicolas
02:46
created

helpers.php ➔ on_route()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
if (! function_exists('on_route')) {
4
    function on_route($route)
5
    {
6
        return Route::current() ? Route::is($route) : false;
7
    }
8
}
9
10
if (! function_exists('locale')) {
11
    function locale($locale = null)
12
    {
13
        if (is_null($locale)) {
14
            return app()->getLocale();
15
        }
16
17
        app()->setLocale($locale);
18
19
        return app()->getLocale();
20
    }
21
}
22
23
if (! function_exists('is_module_enabled')) {
24
    function is_module_enabled($module)
25
    {
26
        return array_key_exists($module, app('modules')->enabled());
27
    }
28
}
29