AwsConfigContextTrait   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
overloadEnvironmentVariables() 0 1 ?
B getAwsServiceConfig() 0 13 5
1
<?php
2
3
namespace AbacaphiliacFeature\AwsSdk\ClaimCheck\Bootstrap\ContextTrait;
4
5
trait AwsConfigContextTrait
6
{
7
    /**
8
     * @return mixed[]
9
     */
10
    abstract public function overloadEnvironmentVariables();
11
    
12
    /**
13
     * @return mixed[]
14
     */
15
    public function getAwsServiceConfig()
16
    {
17
        $this->overloadEnvironmentVariables();
18
        
19
        return [
20
            'region' => getenv('AWS_REGION') ?: 'us-west-2',
21
            'version' => getenv('AWS_VERSION') ?: 'latest',
22
            'credentials' => [
23
                'key' => getenv('AWS_KEY') ?: 'foo',
24
                'secret' => getenv('AWS_SECRET') ?: 'bar',
25
            ],
26
        ];
27
    }
28
}
29