AbstractAuthentication::addHeader()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
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