Completed
Push — master ( b7f544...05e48a )
by Mike
05:04
created

Environment::getEnvironment()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
5
namespace Xervice\Config\Business\Environment;
6
7
8
class Environment
9
{
10
    public const ENV_ENVIRONMENT = 'APPLICATION_ENV';
11
    public const ENV_SCOPE = 'APPLICATION_SCOPE';
12
13
    /**
14
     * @return string
15
     */
16 10
    public function getEnvironment() : string
17
    {
18 10
        return getenv(self::ENV_ENVIRONMENT, true) ?: 'production';
19
    }
20
21
    /**
22
     * @return string
23
     */
24 8
    public function getScope() : string
25
    {
26 8
        return getenv(self::ENV_SCOPE, true) ?: 'main';
27
    }
28
}
29