Passed
Push — feature/active-node ( 87efcf...5b1cae )
by Fike
03:18
created

Context::setIgnoreIllegal()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace AmaTeam\TreeAccess\Locator;
4
5
class Context
6
{
7
    /**
8
     * @var bool
9
     */
10
    private $ignoreIllegal = false;
11
    /**
12
     * @var bool
13
     */
14
    private $ignoreMissing = false;
15
16
    /**
17
     * @param bool $ignoreIllegal
18
     * @param bool $ignoreMissing
19
     */
20 17
    public function __construct($ignoreIllegal = false, $ignoreMissing = false)
21
    {
22 17
        $this->ignoreIllegal = $ignoreIllegal;
23 17
        $this->ignoreMissing = $ignoreMissing;
24 17
    }
25
26
    /**
27
     * @return bool
28
     */
29 1
    public function shouldIgnoreIllegal()
30
    {
31 1
        return $this->ignoreIllegal;
32
    }
33
34
    /**
35
     * @param bool $ignoreIllegal
36
     * @return $this
37
     */
38
    public function setIgnoreIllegal($ignoreIllegal)
39
    {
40
        $this->ignoreIllegal = $ignoreIllegal;
41
        return $this;
42
    }
43
44
    /**
45
     * @return bool
46
     */
47 3
    public function shouldIgnoreMissing()
48
    {
49 3
        return $this->ignoreMissing;
50
    }
51
52
    /**
53
     * @param bool $ignoreMissing
54
     * @return $this
55
     */
56
    public function setIgnoreMissing($ignoreMissing)
57
    {
58
        $this->ignoreMissing = $ignoreMissing;
59
        return $this;
60
    }
61
}
62