AbstractHeaderParser   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 22
c 0
b 0
f 0
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 3 1
A getValue() 0 3 1
1
<?php declare(strict_types=1);
2
3
/**
4
 * @license  http://opensource.org/licenses/mit-license.php MIT
5
 * @link     https://github.com/nicoSWD
6
 * @author   Nicolas Oelgart <[email protected]>
7
 */
8
namespace nicoSWD\SecHeaderCheck\Domain\Validator;
9
10
use nicoSWD\SecHeaderCheck\Domain\Header\HttpHeader;
11
use nicoSWD\SecHeaderCheck\Domain\Result\AbstractParsedHeader;
12
13
abstract class AbstractHeaderParser
14
{
15
    private $name = '';
16
    private $value = '';
17
18 40
    public function __construct(HttpHeader $header)
19
    {
20 40
        $this->name = $header->name();
21 40
        $this->value = $header->value();
22 40
    }
23
24
    /** @return AbstractParsedHeader */
25
    abstract public function parse();
26
27 40
    public function getName(): string
28
    {
29 40
        return $this->name;
30
    }
31
32 40
    public function getValue(): string
33
    {
34 40
        return $this->value;
35
    }
36
}
37