Conditions | 4 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
46 | public function isTrue($val, $return_null = false) |
||
47 | { |
||
48 | $boolval = (bool)$val; |
||
49 | |||
50 | if (is_string($val)) { |
||
51 | $boolval = filter_var($val, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); |
||
52 | } |
||
53 | |||
54 | if ($boolval === null && !$return_null) { |
||
55 | return false; |
||
56 | } |
||
57 | |||
58 | return $boolval; |
||
59 | } |
||
61 |