src/Schema.php
protected function validateBoolean(&$value, array $field, Validation $validation) {
        if (is_bool($value)) {
            $validType = true;
        } else {
            $bools = [
                '0' => false, 'false' => false, 'no' => false, 'off' => false,
                '1' => true,  'true'  => true, 'yes' => true,  'on'  => true
            ];
            if ((is_string($value) || is_numeric($value)) && isset($bools[$value])) {
                $value = $bools[$value];
                $validType = true;
            } else {
                $validType = false;
            }
        }
        return $validType;
    }
protected function validateBoolean(&$value, array $field, Validation $validation) {
        if (is_bool($value)) {
            $validType = true;
        } else {
            $bools = [
                '0' => false, 'false' => false, 'no' => false, 'off' => false,
                '1' => true,  'true'  => true, 'yes' => true,  'on'  => true
            ];
            if ((is_string($value) || is_numeric($value)) && isset($bools[$value])) {
                $value = $bools[$value];
                $validType = true;
            } else {
                $validType = false;
            }
        }
        return $validType;
    }
Validate a boolean value.

@param mixed &$value The value to validate.
@param array $field The field definition.
@param Validation $validation The validation results to add.
@return bool Returns true if {@link $value} is valid or false otherwise.