ReferrerPolicyHeaderResult   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
wmc 5
eloc 10
dl 0
loc 32
c 0
b 0
f 0
ccs 10
cts 12
cp 0.8333
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A mayLeakOrigin() 0 3 1
A doesNotLeakReferrer() 0 3 1
A isSecure() 0 3 1
A setDoesNotLeakReferrer() 0 5 1
A setMayLeakOrigin() 0 5 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\Result\Result;
9
10
use nicoSWD\SecHeaderCheck\Domain\Result\AbstractParsedHeader;
11
12
final class ReferrerPolicyHeaderResult extends AbstractParsedHeader
13
{
14
    private $mayLeakOrigin = true;
15
    private $doesNotLeakReferrer = false;
16
17
    public function isSecure(): bool
18
    {
19
        return $this->doesNotLeakReferrer();
20
    }
21
22 2
    public function mayLeakOrigin(): bool
23
    {
24 2
        return $this->mayLeakOrigin;
25
    }
26
27 4
    public function setMayLeakOrigin(bool $mayLeakOrigin): self
28
    {
29 4
        $this->mayLeakOrigin = $mayLeakOrigin;
30
31 4
        return $this;
32
    }
33
34 2
    public function doesNotLeakReferrer(): bool
35
    {
36 2
        return $this->doesNotLeakReferrer;
37
    }
38
39 4
    public function setDoesNotLeakReferrer(bool $doesNotLeakReferrer): self
40
    {
41 4
        $this->doesNotLeakReferrer = $doesNotLeakReferrer;
42
43 4
        return $this;
44
    }
45
}
46