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

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

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

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

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

@since 2.0.0

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