public function asArray(array $filters = [], $default = null) : array
    {
        $array = Validate::asArray($this->params[$this->key] ?? $this->params, []);

        foreach ($filters as $key => $dataType) {
            $dataType = 'as' . ucfirst($dataType);
            $array[$key] = Validate::$dataType($array[$key] ?? null, $default);
        }

        return $array;
    }
public function asArray(array $filters = [], $default = null) : array
    {
        $array = Validate::asArray($this->params[$this->key] ?? $this->params, []);

        foreach ($filters as $key => $dataType) {
            $dataType = 'as' . ucfirst($dataType);
            $array[$key] = Validate::$dataType($array[$key] ?? null, $default);
        }

        return $array;
    }
public function asArray ( array $ filters = [ ] , $ default = null ) : array { $ array = Validate :: asArray ( $ this -> params [ $ this -> key ] ?? $ this -> params , [ ] ) ; foreach ( $ filters as $ key => $ dataType ) { $ dataType = 'as' . ucfirst ( $ dataType ) ; $ array [ $ key ] = Validate :: $ dataType ( $ array [ $ key ] ?? null , $ default ) ; } return $ array ; }
Data sanitation and return as array.

@since 2.0.0

@param array $filters → associative array with data type for each key
@param mixed $default → default value for non-existent or incorrect keys
Data sanitation and return as array .