| Conditions | 6 |
| Paths | 6 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function parseBool($var, $strict) |
||
| 40 | { |
||
| 41 | if ($strict) { |
||
| 42 | if (preg_match('/^(true|yes|on|1|y)$/i', $var)) { |
||
| 43 | return true; |
||
| 44 | } else if (preg_match('/^(false|no|off|0|n)$/i', $var)) { |
||
| 45 | return false; |
||
| 46 | } |
||
| 47 | |||
| 48 | } else { |
||
| 49 | if (preg_match('/^(true|yes|on)$/i', $var)) { |
||
| 50 | return true; |
||
| 51 | } else if (preg_match('/^(false|no|off)$/i', $var)) { |
||
| 52 | return false; |
||
| 53 | } |
||
| 54 | |||
| 55 | } |
||
| 56 | |||
| 57 | return $var; |
||
| 58 | } |
||
| 75 | } |