AbstractAuthentication   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A addHeader() 0 5 1
A getHeaders() 0 3 1
1
<?php
2
3
4
namespace Dolibarr\Client\Security\Authentication;
5
6
use Dolibarr\Client\Domain\Authentication\Header;
7
8
/**
9
 * @author Laurent De Coninck <[email protected]>
10
 */
11
abstract class AbstractAuthentication implements Authentication
12
{
13
14
    /**
15
     * @var Header[]|array
16
     */
17
    private $headers;
18
19
    public function __construct()
20
    {
21
        $this->headers = [];
22
    }
23
24
    /**
25
     * @param string $headerKey
26
     * @param string $headerValue
27
     *
28
     * @return $this
29
     */
30
    protected function addHeader($headerKey, $headerValue)
31
    {
32
        $this->headers[$headerKey] = new Header($headerKey, $headerValue);
33
34
        return $this;
35
    }
36
37
    /**
38
     * @return array|Header[]
39
     */
40
    public function getHeaders()
41
    {
42
        return $this->headers;
43
    }
44
}
45