DotEnvContextTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 26
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A loadEnvironmentVariables() 0 4 1
A overloadEnvironmentVariables() 0 4 1
A createDotEnv() 0 4 1
1
<?php
2
3
namespace AbacaphiliacFeature\AwsSdk\ClaimCheck\Bootstrap\ContextTrait;
4
5
use Dotenv\Dotenv;
6
7
trait DotEnvContextTrait
8
{
9
    /**
10
     * @return mixed[]
11
     */
12
    public function loadEnvironmentVariables()
13
    {
14
        return $this->createDotEnv()->load();
15
    }
16
17
    /**
18
     * @return mixed[]
19
     */
20
    public function overloadEnvironmentVariables()
21
    {
22
        return $this->createDotEnv()->overload();
23
    }
24
25
    /**
26
     * @return Dotenv
27
     */
28
    private function createDotEnv()
29
    {
30
        return new Dotenv(__DIR__ . '/../../../', '.env');
31
    }
32
}
33