Include/exclude optional parameters

The exclusion/inclusion is based on current request resource

@access protected
@param  RequestInterface $request
@return array
555083
protected function getOAuthParameters(RequestInterface $request)
    {
        $params = $this->filterOAuthParameters(array('oauth_token', 'oauth_version'));

        if ($this->isEndpointRequested(self::ENDPOINT_REQUEST_TOKEN, $request)) {
            $params = $this->filterOAuthParameters(array('oauth_callback'));
        } elseif ($this->isEndpointRequested(self::ENDPOINT_ACCESS_TOKEN, $request)) {
            $params = $this->filterOAuthParameters(array('oauth_token', 'oauth_verifier'));
        }

        return $params;
    }
69287
private function appendHeaders(RequestInterface $request)
    {
        $headers = $this->auth->getHeaders();
        foreach ($headers as $key => $value) {
            $request = $request->withHeader($key, $value);
        }
        return $request;
    }
123355
public function enter(RequestInterface $request = null)
    {
        $this->starts = [
            'wt' => microtime(true),
            'mu' => memory_get_usage(),
            'pmu' => memory_get_peak_usage(),
        ];

        if ($request) {
            $this->request = [
                'method' => $request->getMethod(),
                'url' => (string)$request->getUri(),
                'headers' => $request->getHeaders(),
                'body' => (string)$request->getBody()
            ];
        }
    }
106025
public function applyToRequest(RequestInterface $request)
    {
        $body = $this->streamFactory->createStream((string) $this->queryHelper);

        return $request
            ->withBody($body)
            ->withHeader('Content-Type', 'application/x-www-form-urlencoded');
    }
1156790
private function getSortOrders(RequestInterface $request)
    {
        $sortOrders = [];

        if ($request->getSortOrders()) {
            $sortOrders = $this->sortOrderBuilder->buildSortOrders($request->getSortOrders());
        }

        return $sortOrders;
    }
1299228
public function setRequest(RequestInterface $request)
    {
        $this->setParam('request', $request);
        $this->request = $request;

        return $this;
    }
193555
protected function setDataFromRequest(RequestInterface $request)
    {
        $keys = $this->validDataFromRequest();
        $data = $request->getParams($keys);

        if (isset($data['obj_type'])) {
            $this->objType = filter_var($data['obj_type'], FILTER_SANITIZE_STRING);
        }

        if (isset($data['obj_id'])) {
            $this->objId = filter_var($data['obj_id'], FILTER_SANITIZE_STRING);
        }

        if (isset($data['property'])) {
            $this->propertyIdent = filter_var($data['property'], FILTER_SANITIZE_STRING);
        }

        if (isset($data['assets'])) {
            $this->showAssets = !!$data['assets'];
        }

        if (isset($data['callback'])) {
            $this->callbackIdent = filter_var($data['callback'], FILTER_SANITIZE_STRING);
        }

        if (isset($this->elfinderConfig['translations'])) {
            $this->setLocalizations(array_replace_recursive(
                $this->defaultLocalizations(),
                $this->elfinderConfig['translations']
            ));
        }

        return true;
    }
898066
protected function composeUrlParameters(SearchRequest $request, FilterInterface $filter = null, $exclude = [])
    {
        $out = [];

        $and = [];

        if ($filter) {
            $and[] = $filter->getResetRelation();
        }

        if (!empty($exclude)) {
            $and[] = new ExcludeRelation($exclude);
        }

        /** @var FilterState[] $states */
        $states = new FilterIterator(new \IteratorIterator($request), new AndRelation($and));

        foreach ($states as $state) {
            $out = array_merge($out, $state->getUrlParameters());
        }

        return $out;
    }
1317593
function withRequestOnMatch(RequestInterface $request)
    {
        $requestTarget = $request->getRequestTarget();
        $requestTarget = new StdString($requestTarget);
        $requestTarget = $requestTarget->stripPrefix( rtrim($this->_stripPrefix, '/') );
        $request       = $request->withRequestTarget( (string) $requestTarget );

        return $request;
    }
259623
public function handle(RequestInterface $request): RequestInterface
    {
        return
            $request->withHeader(
                'Authorization',
                sprintf('Basic %s', base64_encode(sprintf('%s:%s', $this->user, $this->password)))
            );
    }
690485
protected function _makeOptions(ApiRequestInterface $request)
  {
    $headers = $options = [];

    if($request->getVerb() == HttpVerb::POST)
    {
      $options['json'] = $request->getPostData();
    }

    if($this->_accessToken !== null)
    {
      $headers['Authorization'] = 'Bearer ' . $this->_accessToken;
    }

    if($this->_orgFid !== null)
    {
      $headers['X-Fortifi-Org'] = $this->_orgFid;
    }

    if($this->_disableNesting)
    {
      $headers['Disable-Nesting'] = "true";
    }

    if($this->_disableLogging)
    {
      $headers['Disable-Logging'] = "true";
    }

    if($this->_shortNesting)
    {
      $headers['Short-Nesting'] = "true";
    }

    if(!empty($headers))
    {
      $options['headers'] = $headers;
    }

    return $options;
  }
449510
public function methodNotAllowedResponse(RequestInterface $request)
    {
        if ($this->methodNotAllowedChain) {
            return $this->methodNotAllowedChain->execute(
                [$this->server, $request],
                $this->middlewares
            );
        }
        return Response::make('<html><head><title>405 Method Not Allowed</title></head><body bgcolor="white"><h1>405 Method Not Allowed</h1></body></html>', 405);
    }
601340
public function filterRequest(RequestInterface $request)
    {
        if ($this->pattern->matchRequest($request)) {
            $this->securityInterceptor->invoke();
            return true;
        }
        return false;
    }
430297
public function request(RequestInterface $request)
    {
        $response = $this->httpClient->sendRequest($request);
        $data = $this->decodeResponse($response);
        $this->detectError($data);

        return $data;
    }
272365
public function parseFractalIncludes(Request $request)
    {
        $includes = $request->input($this->includeKey);

        if (! is_array($includes)) {
            $includes = array_map('trim', array_filter(explode($this->includeSeparator, $includes)));
        }

        $this->fractal->parseIncludes($includes);
    }
661176
public static function determineAcceptedMediaTypes(RequestInterface $request): array
    {
        $rawValues = $request->getHeader('Accept');
        if (empty($rawValues) || !is_string($rawValues)) {
            return ['*/*'];
        }
        $acceptedMediaTypes = self::parseContentNegotiationQualityValues($rawValues);

        return $acceptedMediaTypes;
    }
1009164
private function getHeadersAsCommandOptions(RequestInterface $request)
    {
        $command = '';
        foreach ($request->getHeaders() as $name => $values) {
            if ('host' === strtolower($name) && $values[0] === $request->getUri()->getHost()) {
                continue;
            }

            if ('user-agent' === strtolower($name)) {
                $command .= sprintf(' -A %s', escapeshellarg($values[0]));

                continue;
            }

            $command .= sprintf(' -H %s', escapeshellarg($name.': '.$request->getHeaderLine($name)));
        }

        return $command;
    }