Completed
Push — master ( 809003...c51d85 )
by Gabriel
02:17
created

helpers.php ➔ config()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 2
dl 0
loc 11
ccs 0
cts 5
cp 0
crap 12
rs 9.9
c 0
b 0
f 0
1
<?php
2
3
if (!function_exists('config')) {
4
    /**
5
     * Get / set the specified configuration value.
6
     *
7
     * If an array is passed as the key, we will assume you want to set an array of values.
8
     *
9
     * @param  array|string $key
10
     * @param  mixed $default
11
     * @return \Nip\Config\Config|mixed
12
     */
13
    function config($key = null, $default = null)
14
    {
15
        if (is_null($key)) {
16
            return app('config');
17
        }
18
        if (is_array($key)) {
19
            return app('config')->set($key);
20
        }
21
22
        return app('config')->get($key, $default);
23
    }
24
}
25