XFrameOptionsHeaderResult   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
wmc 6
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 getHasSecureOrigin() 0 3 1
A setHasAllowFrom() 0 5 1
A setHasSecureOrigin() 0 5 1
A isSecure() 0 3 2
A hasAllowFrom() 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\Result\Result;
9
10
use nicoSWD\SecHeaderCheck\Domain\Result\AbstractParsedHeader;
11
12
final class XFrameOptionsHeaderResult extends AbstractParsedHeader
13
{
14
    private $hasSecureOrigin = false;
15
    private $hasAllowFrom = false;
16
17
    public function isSecure(): bool
18
    {
19
        return $this->getHasSecureOrigin() || $this->hasAllowFrom();
20
    }
21
22 6
    public function getHasSecureOrigin(): bool
23
    {
24 6
        return $this->hasSecureOrigin;
25
    }
26
27 8
    public function setHasSecureOrigin(bool $hasSecureOrigin): self
28
    {
29 8
        $this->hasSecureOrigin = $hasSecureOrigin;
30
31 8
        return $this;
32
    }
33
34 2
    public function hasAllowFrom(): bool
35
    {
36 2
        return $this->hasAllowFrom;
37
    }
38
39 8
    public function setHasAllowFrom(bool $hasAllowFrom): self
40
    {
41 8
        $this->hasAllowFrom = $hasAllowFrom;
42
43 8
        return $this;
44
    }
45
}
46