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