ApiConfiguration   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 32
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getParameters() 0 6 1
A getHeaders() 0 4 1
A getApiKey() 0 7 2
1
<?php namespace GameScan\WoW;
2
3
use GameScan\Core\Request\Api\ApiConfigurationInterface;
4
use GameScan\Core\Tools\Environment;
5
6
class ApiConfiguration implements ApiConfigurationInterface
7
{
8
    private $apiKey = null;
9
10
    /**
11
     * Get parameters mandatory for request an api
12
     * @return array
13
     */
14
    public function getParameters()
15
    {
16
        return [
17
            "apikey" => $this->getApiKey()
18
        ];
19
    }
20
21
    /**
22
     * Get headers mandatory for request an api
23
     * @return array
24
     */
25
    public function getHeaders()
26
    {
27
        return array();
28
    }
29
30
    private function getApiKey()
31
    {
32
        if ($this->apiKey === null) {
33
            $this->apiKey = (new Environment())->get("WOW_API_KEY");
34
        }
35
        return $this->apiKey;
36
    }
37
}
38