protected function getRequestParams(&$source, $key = null, $default = null)
    {
        // If $key is NULL, it means that the whole $source is requested
        if (!isset($key) || $key == null) {
            $key = array_keys($source);
        }

        if (is_array($key)) {
            $output = [];
            foreach ($key as $k) {
                $output[$k] = $this->getRequestParams($source, $k);
            }

            return $output;
        }

        if (isset($source[$key])) {
            $value = $source[$key];
        } else {
            return $default;
        }

        return $value;
    }
protected function getRequestParams(&$source, $key = null, $default = null)
    {
        // If $key is NULL, it means that the whole $source is requested
        if (!isset($key) || $key == null) {
            $key = array_keys($source);
        }

        if (is_array($key)) {
            $output = [];
            foreach ($key as $k) {
                $output[$k] = $this->getRequestParams($source, $k);
            }

            return $output;
        }

        if (isset($source[$key])) {
            $value = $source[$key];
        } else {
            return $default;
        }

        return $value;
    }
protected function getRequestParams ( & $ source , $ key = null , $ default = null ) { // If $key is NULL, it means that the whole $source is requested if ( ! isset ( $ key ) || $ key == null ) { $ key = array_keys ( $ source ) ; } if ( is_array ( $ key ) ) { $ output = [ ] ; foreach ( $ key as $ k ) { $ output [ $ k ] = $ this -> getRequestParams ( $ source , $ k ) ; } return $ output ; } if ( isset ( $ source [ $ key ] ) ) { $ value = $ source [ $ key ] ; } else { return $ default ; } return $ value ; }
Internal method used to retrieve values from given arrays.

@param  array $source
@param  mixed $key
@param  mixed $default
@return mixed
Internal method used to retrieve values from given arrays .