classes/Input.php
public function load(...$sources)
    {
        if (!$sources) {
            throw new \RuntimeException('Sources must not be empty');
        }

        $this->clear();
        foreach ($sources as $source) {
            switch ($source) {
                case 'query':
                case 'post':
                case 'files':
                case 'cookie':
                    $this->data = array_merge($this->data, $this->request->$source());
                    break;
                default:
                    throw new \RuntimeException('Unknown source: ' . $source);
            }
        }

        if ($session = $this->session->get('input')) {
            $this->session->unset('input');
            if (!$this->data) {
                $this->data   = $session['data'] ?? [];
                $this->errors = $session['errors'] ?? [];
            }
        }
    }
public function load(...$sources)
    {
        if (!$sources) {
            throw new \RuntimeException('Sources must not be empty');
        }

        $this->clear();
        foreach ($sources as $source) {
            switch ($source) {
                case 'query':
                case 'post':
                case 'files':
                case 'cookie':
                    $this->data = array_merge($this->data, $this->request->$source());
                    break;
                default:
                    throw new \RuntimeException('Unknown source: ' . $source);
            }
        }

        if ($session = $this->session->get('input')) {
            $this->session->unset('input');
            if (!$this->data) {
                $this->data   = $session['data'] ?? [];
                $this->errors = $session['errors'] ?? [];
            }
        }
    }
public function load ( ... $ sources ) { if ( ! $ sources ) { throw new \ RuntimeException ( 'Sources must not be empty' ) ; } $ this -> clear ( ) ; foreach ( $ sources as $ source ) { switch ( $ source ) { case 'query' : case 'post' : case 'files' : case 'cookie' : $ this -> data = array_merge ( $ this -> data , $ this -> request -> $ source ( ) ) ; break ; default : throw new \ RuntimeException ( 'Unknown source: ' . $ source ) ; } } if ( $ session = $ this -> session -> get ( 'input' ) ) { $ this -> session -> unset ( 'input' ) ; if ( ! $ this -> data ) { $ this -> data = $ session [ 'data' ] ?? [ ] ; $ this -> errors = $ session [ 'errors' ] ?? [ ] ; } } }
Load input from the requested sources and the session

Flushes all previously applied filters and validations

@param array $sources
Load input from the requested sources and the session