src/ResourceValidationsTrait.php
protected function cleanBooleanValue($val)
    {
        if ($val !== null) {
            if ($val === 1 || $val === '1' || $val === 0 || $val === '0') {
                $val = (bool)$val;
            } elseif (is_string($val) && trim($val) === '') {
                $val = null;
            }
        }
        return $val;
    }
protected function cleanBooleanValue($val)
    {
        if ($val !== null) {
            if ($val === 1 || $val === '1' || $val === 0 || $val === '0') {
                $val = (bool)$val;
            } elseif (is_string($val) && trim($val) === '') {
                $val = null;
            }
        }
        return $val;
    }
protected function cleanBooleanValue ( $ val ) { if ( $ val !== null ) { if ( $ val === 1 || $ val === '1' || $ val === 0 || $ val === '0' ) { $ val = ( bool ) $ val ; } elseif ( is_string ( $ val ) && trim ( $ val ) === '' ) { $ val = null ; } } return $ val ; }
Cleans a value that is expected to be a boolean

If the value is a string or integer that can evaluate to a boolean, this coerces it into a boolean. Otherwise,
it leaves the value alone.

@param mixed $val The value to clean
@return mixed A boolean value or the original value, if not boolish
Cleans a value that is expected to be a boolean