| 1 | <?php |
||
| 11 | class BooleanValidator extends AbstractFormatValidator |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Validate that the input is a valid boolean. |
||
| 15 | * This accepts: |
||
| 16 | * 1 and 0 |
||
| 17 | * "1" and "0" |
||
| 18 | * "on" or "ON" and "off" or "OFF" |
||
| 19 | * "yes" or "YES" and "no" or "NO" |
||
| 20 | * true and false |
||
| 21 | * |
||
| 22 | * @return boolean Whether the input is valid. |
||
| 23 | */ |
||
| 24 | 16 | protected function formatDefault() |
|
| 30 | } |
||
| 31 |