AbstractHeaderParser::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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