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

Environment   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 19
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getScope() 0 3 2
A getEnvironment() 0 3 2
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