Total Complexity | 5 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class Boolean extends Generic |
||
6 | { |
||
7 | /** @var mixed */ |
||
8 | protected $trueValue = 1; |
||
9 | |||
10 | /** @var mixed */ |
||
11 | protected $falseValue = 0; |
||
12 | |||
13 | /** |
||
14 | * @param $value |
||
15 | * @return $this |
||
16 | */ |
||
17 | public function trueValue($value) |
||
18 | { |
||
19 | $this->trueValue = $value; |
||
20 | |||
21 | return $this; |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @param $value |
||
26 | * @return $this |
||
27 | */ |
||
28 | public function falseValue($value) |
||
29 | { |
||
30 | $this->falseValue = $value; |
||
31 | |||
32 | return $this; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @return bool |
||
37 | */ |
||
38 | public function isTrue() |
||
39 | { |
||
40 | return $this->value() === $this->trueValue; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @return array |
||
45 | */ |
||
46 | public function onIndex() |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @return array |
||
53 | */ |
||
54 | public function onView() |
||
57 | } |
||
58 | } |
||
59 |