Completed
Pull Request — master (#40)
by
unknown
01:33
created

server.php ➔ env()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
$dotenv = new Dotenv\Dotenv(__DIR__);
3
$dotenv->overload();
4
5
/**
6
 * Get Environment variable
7
 *
8
 * @param string $key
9
 * @param null   $default
10
 * @return string/null
0 ignored issues
show
Documentation introduced by
The doc-type string/null could not be parsed: Unknown type name "string/null" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
11
 */
12
function env($key = '', $default = null)
13
{
14
    return $_ENV[$key] != '' ? $_ENV[$key] : $default;
15
}
16
17
if (env('APP_DEBUG') === 'true') {
18
    error_reporting(E_ALL);
19
    ini_set('display_errors', 1);
20
}
21
22