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

helpers.php ➔ locale()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 10
rs 9.4285
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