app()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
use Gravatalonga\Container;
4
5
if (!function_exists('env')) {
6
    function env($name, $default = null)
7
    {
8
        if ($value = getenv($name)) {
9
            return $value;
10
        }
11
        return $default;
12
    }
13
}
14
15
if (!function_exists('dd')) {
16
    function dd() {
17
        array_map(function ($x) {
18
            dump($x);
19
        }, func_get_args());
20
        die;
0 ignored issues
show
Best Practice introduced by
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
21
    }
22
}
23
24
if (!function_exists('app')) {
25
    function app()
26
    {
27
        return Container::getInstance();
28
    }
29
}
30
31
if (!function_exists('path')) {
32
    function path($folder = '')
33
    {
34
        return rtrim(app()->get('settings')['base_path'] . '/' . $folder, '/');
35
    }
36
}
37