ReferrerPolicyHeaderResult::mayLeakOrigin()   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\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