Conditions | 4 |
Paths | 4 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare( strict_types=1 ); |
||
14 | protected function getEnvironmentVariable ( string $variableName, $default, $castingFunctionName = null ) |
||
15 | { |
||
16 | if ( !empty( $castingFunctionName ) ) { |
||
17 | return array_key_exists( $variableName, $_ENV ) ? call_user_func( $castingFunctionName, |
||
18 | $_ENV[$variableName] ) : $default; |
||
19 | } |
||
20 | |||
21 | return array_key_exists( $variableName, $_ENV ) ? $_ENV[$variableName] : $default; |
||
22 | } |
||
24 |