Completed
Push — master ( 1ba115...baab82 )
by Nico
02:35
created

XXSSProtectionHeaderResult   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 88.24%

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 1
dl 0
loc 47
ccs 15
cts 17
cp 0.8824
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A isSecure() 0 4 2
A protectionIsOn() 0 4 1
A setProtectionIsOn() 0 6 1
A isBlocking() 0 4 1
A setIsBlocking() 0 6 1
A hasReportUri() 0 4 1
A setHasReportUri() 0 6 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 XXSSProtectionHeaderResult extends AbstractParsedHeader
13
{
14
    private $protectionIsOn = false;
15
    private $isBlocking = false;
16
    private $hasReportUri = false;
17
18
    public function isSecure(): bool
19
    {
20
        return $this->protectionIsOn() && $this->isBlocking();
21
    }
22
23 8
    public function protectionIsOn(): bool
24
    {
25 8
        return $this->protectionIsOn;
26
    }
27
28 8
    public function setProtectionIsOn(bool $protectionIsOn): self
29
    {
30 8
        $this->protectionIsOn = $protectionIsOn;
31
32 8
        return $this;
33
    }
34
35 8
    public function isBlocking(): bool
36
    {
37 8
        return $this->isBlocking;
38
    }
39
40 8
    public function setIsBlocking(bool $isBlocking): self
41
    {
42 8
        $this->isBlocking = $isBlocking;
43
44 8
        return $this;
45
    }
46
47 8
    public function hasReportUri(): bool
48
    {
49 8
        return $this->hasReportUri;
50
    }
51
52 8
    public function setHasReportUri(bool $hasReportUri): self
53
    {
54 8
        $this->hasReportUri = $hasReportUri;
55
56 8
        return $this;
57
    }
58
}
59