AbstractItem::setReturnValueIfIsDisabledToFalse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @author stev leibelt <[email protected]>
4
 * @since 2013-09-30
5
 */
6
7
namespace Net\Bazzline\Component\Requirement;
8
9
/**
10
 * Class AbstractItem
11
 *
12
 * @package Net\Bazzline\Component\Requirement
13
 * @author stev leibelt <[email protected]>
14
 * @since 2013-09-30
15
 */
16
abstract class AbstractItem implements ItemInterface
17
{
18
    /**
19
     * @var bool
20
     * @author stev leibelt <[email protected]>
21
     * @since 2013-09-30
22
     */
23
    protected $isDisabled;
24
25
    /**
26
     * @var bool
27
     * @author stev leibelt <[email protected]>
28
     * @since 2013-09-30
29
     */
30
    private $returnValueIfIsDisabled;
31
32
    /**
33
     * @author stev leibelt <[email protected]>
34
     * @since 2013-09-30
35
     */
36
    public function __construct()
37
    {
38
        $this->isDisabled = false;
39
        $this->setReturnValueIfIsDisabledToTrue();
40
    }
41
42
    /**
43
     * @return bool
44
     * @author stev leibelt <[email protected]>
45
     * @since 2013-09-29
46
     */
47
    public function isDisabled()
48
    {
49
        return $this->isDisabled;
50
    }
51
52
    /**
53
     * @return $this
54
     * @author stev leibelt <[email protected]>
55
     * @since 2013-09-29
56
     */
57
    public function disable()
58
    {
59
        $this->isDisabled = true;
60
61
        return $this;
62
    }
63
64
    /**
65
     * @return bool
66
     * @author stev leibelt <[email protected]>
67
     * @since 2013-09-30
68
     */
69
    protected function getReturnValueIfIsDisabled()
70
    {
71
        return $this->isDisabled;
72
    }
73
74
    /**
75
     * @author stev leibelt <[email protected]>
76
     * @since 2013-09-30
77
     */
78
    protected function setReturnValueIfIsDisabledToFalse()
79
    {
80
        $this->returnValueIfIsDisabled = false;
81
    }
82
83
    /**
84
     * @author stev leibelt <[email protected]>
85
     * @since 2013-09-30
86
     */
87
    protected function setReturnValueIfIsDisabledToTrue()
88
    {
89
        $this->returnValueIfIsDisabled = true;
90
    }
91
}