Passed
Pull Request — master (#43)
by Baptiste
02:06
created

Configuration   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 37
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setStatus() 0 4 1
A getStatus() 0 4 1
A getRequestHeaders() 0 4 1
A getResponseHeaders() 0 4 1
1
<?php declare(strict_types=1);
2
namespace Behapi\Debug;
3
4
/**
5
 * Object containing the debug configuration (status, headers)
6
 *
7
 * @author Baptiste Clavié <[email protected]>
8
 */
9
final class Configuration
10
{
11
    /** @var bool */
12
    private $status = false;
13
14
    /** @var string[] Request headers to print when debugging */
15
    private $requestHeaders = [];
16
17
    /** @var string[] Response headers to print when debugging */
18
    private $responseHeaders = [];
19
20
    public function __construct(array $requestHeaders, array $responseHeaders)
21
    {
22
        $this->requestHeaders = $requestHeaders;
23
        $this->responseHeaders = $responseHeaders;
24
    }
25
26
    public function setStatus(bool $status)
27
    {
28
        $this->status = $status;
29
    }
30
31
    public function getStatus(): bool
32
    {
33
        return $this->status;
34
    }
35
36
    public function getRequestHeaders(): array
37
    {
38
        return $this->requestHeaders;
39
    }
40
41
    public function getResponseHeaders(): array
42
    {
43
        return $this->responseHeaders;
44
    }
45
}
46