Xpressengine\Support\Caster::castBool PHP Method

castBool() protected static method

To boolean cast a value
protected static castBool ( mixed $v ) : boolean | null
$v mixed original value
return boolean | null
    protected static function castBool($v)
    {
        if ($v === true || $v === 'true') {
            return true;
        } elseif ($v === false || $v === 'false') {
            return false;
        }
        return null;
    }