Método protegido que faz a validação das requisições.

@method getData()

@param Request
@param array
@param bool

@return bool
964799
protected static function getData($request, &$data = [], $upper = true)
    {
        if (!empty($request)) {
            foreach ($request as $key => $value) {
                if (empty($key)) {
                    continue;
                }

                if (self::$require) {
                    if (in_array($key, self::$require)) {
                        if (Validator::blank($value)) {
                            self::$error[] = $key;
                        }
                    }
                }

                if (strpos($key, '|')) {
                    $key = str_replace('|','.',$key);
                }

                if (!is_array($value)) {
                    $data[$key] = ($upper) ? mb_strtoupper(addslashes(trim($value)), 'UTF-8') : addslashes(trim($value));
                } else {
                    $data[$key] = $value;
                }
            }

            if ($request['request_data']) {
                parse_str_to_array($request['request_data'], $data_rd);

                foreach ($data_rd as $key => $value) {
                    if (empty($key)) {
                        continue;
                    }

                    if (strpos($key, '|')) {
                        $key = str_replace('|','.',$key);
                    }

                    if (!is_array($value)) {
                        $data_rd[$key] = ($upper) ? mb_strtoupper(addslashes(trim($value)), 'UTF-8') : addslashes(trim($value));
                    } else {
                        $data_rd[$key] = $value;
                    }
                }

                $data = array_merge($data, $data_rd);

                unset($data['request_data']);
            }
        } else {
            // nenhuma requisição passada sem nenhum retorno de dados.
            return false;
        }

        // todo request foi verificado e teve retorno de dados.
        return true;
    }
204472
public function doRequest($request)
    {
        $inputStream = fopen('php://memory', 'r+');
        $content = $request->getContent();
        if ($content !== null) {
            fwrite($inputStream, $content);
            rewind($inputStream);
        }

        $queryParams = [];
        $postParams = [];
        $queryString = parse_url($request->getUri(), PHP_URL_QUERY);
        if ($queryString != '') {
            parse_str($queryString, $queryParams);
        }
        if ($request->getMethod() !== 'GET') {
            $postParams = $request->getParameters();
        }

        $serverParams = $request->getServer();
        if (!isset($serverParams['SCRIPT_NAME'])) {
            //required by WhoopsErrorHandler
            $serverParams['SCRIPT_NAME'] = 'Codeception';
        }
        
        $cookies = $request->getCookies();
        $headers = $this->extractHeaders($request);

        //set cookie header because dflydev/fig-cookies reads cookies from header
        if (!empty($cookies)) {
            $headers['cookie'] = implode(';', array_map(function ($key, $value) {
                return "$key=$value";
            }, array_keys($cookies), $cookies));
        }

        $zendRequest = new ServerRequest(
            $serverParams,
            $this->convertFiles($request->getFiles()),
            $request->getUri(),
            $request->getMethod(),
            $inputStream,
            $headers,
            $cookies,
            $queryParams,
            $postParams
        );

        $this->request = $zendRequest;

        $cwd = getcwd();
        chdir(codecept_root_dir());

        if ($this->config['recreateApplicationBetweenRequests'] === true || $this->application === null) {
            $application = $this->initApplication();
        } else {
            $application = $this->application;
        }

        if (method_exists($application, 'handle')) {
            //Zend Expressive v3
            $response = $application->handle($zendRequest);
        } else {
            //Older versions
            $application->run($zendRequest);
            $response = $this->responseCollector->getResponse();
            $this->responseCollector->clearResponse();
        }

        chdir($cwd);

        return new Response(
            (string)$response->getBody(),
            $response->getStatusCode(),
            $response->getHeaders()
        );
    }
415284
function(request, data){
  request.source_endpoint = data[1];
  request.type = data[2];
  parseType(request, data);
}
237428
public function matches(array $conditions, ServerRequestInterface $request)
    {
        foreach ($conditions as $condition) {
            $inputSourceData = $this->getInputSource($condition);
            $matcherData = $this->getMatcher($condition);

            $inputValue = $inputSourceData->getInstance()->getValue(
                $request,
                $inputSourceData->getArgument()
            );

            if ($matcherData->getInstance()->match($inputValue, $matcherData->getArgument())) {
                return true;
            }
        }

        return false;
    }
726548
public function execute($params = array(), $request = array()) {
        //$passableParams = $this->httpRequest->getParameters();
        //remove the uri
        // array_shift($passableParams);

        $this->getQueryBuilder()->where($params);
        $query = '';
        if ($this->entity instanceof AbstractI18nEntity) {
            $query = $this->getQueryBuilder()->getQuery($this->entity, QueryBuilder::GET_ITEM_QUERY, QueryBuilder::PARENT_AND_CHILD);
        } else {
            $query = $this->getQueryBuilder()->getQuery($this->entity, QueryBuilder::GET_ITEM_QUERY);
        }

        $firstResult = $this->query($query);
        $entityName = get_class($this->entity);

        if (is_array($firstResult) && count($firstResult) > 0) {

            $this->loadI18nValues($firstResult, $params);

            $this->loadChildTableParams($firstResult, $params);

            $this->loadOneToOneJoinTables($firstResult);

            $this->loadOneToManyJoinTables($firstResult, $params);


        }

        return array($entityName => is_array($firstResult) ? current($firstResult) : array());
    }
762810
public function handleRequest($request = null)
    {
        $this->submitted = true;

        $requestData = $this->requestHandler->handleRequest($this, $request);

        $validRequestData = $this->checkFieldsSubmitted($this->fields, $requestData);

        if ($this->submitted === true && !empty($validRequestData)) {
            $this->data = $validRequestData;
            $this->setRequiredFieldErrors();
        }
        else {
            $this->submitted = false;
        }

        if (isset($this->restoreDataHandler)) {
            if ($this->isSubmitted()) {
                $this->restoreDataHandler->setRestorableData($this, $this->data, $request);
            }
            else {
                $restoredData = $this->restoreDataHandler->restoreData($this, $request);

                if (is_array($restoredData) && !empty($restoredData)) {
                    $this->data = $restoredData;
                }
            }
        }

        if (isset($this->eventDispatcher)) {
            $event = new FormHandlerRequestEvent($this, $request, $this->data);
            $this->eventDispatcher->dispatch('form_handler.request', $event);
            $this->data = $event->getFormData();
        }
    }
1243185
private function checkParamsGet(Request $request, $params)
    {
        if(empty($params))
        {
            return true;
        }
        return Imi::checkCompareRules($params, function($name) use($request){
            return $request->get($name);
        });
        return true;
    }
1374378
protected function resolveRequestData($request): array
    {
        $params = $request->all();

        if ($request instanceof Request) {
            $routeParams = $request->route()->parameters();
            $params = array_merge($params, $routeParams);
        }

        return $params;
    }
799386
private function getValuesFromRequest(Request $request)
    {
        $values = array_merge($request->query->all(), $request->request->all());
        $contentValues = json_decode($request->getContent(), true);
        if (is_array($contentValues)) {
            $values = array_merge($values, $contentValues);
        }

        return $values;
    }
721315
function(request) {
  var options = {};

  if (request.getQueryParameters()) {
    options.query = request.getQueryParameters();
  }

  if (
    request.getHeaders() &&
    request.getHeaders()['Content-Type'] === 'application/json'
  ) {
    options.data = JSON.stringify(request.getBodyParameters());
  } else if (request.getBodyParameters()) {
    options.data = request.getBodyParameters();
  }

  if (request.getHeaders()) {
    options.headers = request.getHeaders();
  }
  return options;
}
666576
public function cgetAction(Request $request)
    {
        $locale = $this->getRequestParameter($request, 'locale', true);
        $fieldDescriptors = $this->getFieldDescriptors($locale, false);
        $types = array_filter(explode(',', $request->get('types')));
        $listBuilder = $this->getListBuilder($request, $fieldDescriptors, $types);
        $listBuilder->setParameter('locale', $locale);
        $listResponse = $listBuilder->execute();
        $count = $listBuilder->count();

        for ($i = 0, $length = count($listResponse); $i < $length; ++$i) {
            $format = $this->getFormatManager()->getFormats(
                $listResponse[$i]['id'],
                $listResponse[$i]['name'],
                $listResponse[$i]['storageOptions'],
                $listResponse[$i]['version'],
                $listResponse[$i]['subVersion'],
                $listResponse[$i]['mimeType']
            );

            if (0 < count($format)) {
                $listResponse[$i]['thumbnails'] = $format;
            }

            $listResponse[$i]['url'] = $this->getMediaManager()->getUrl(
                $listResponse[$i]['id'],
                $listResponse[$i]['name'],
                $listResponse[$i]['version']
            );
        }

        $ids = $listBuilder->getIds();
        if (null != $ids) {
            $result = [];
            foreach ($listResponse as $item) {
                $result[array_search($item['id'], $ids)] = $item;
            }
            ksort($result);
            $listResponse = array_values($result);
        }

        $list = new ListRepresentation(
            $listResponse,
            self::$entityKey,
            'cget_media',
            $request->query->all(),
            $listBuilder->getCurrentPage(),
            $listBuilder->getLimit(),
            $count
        );

        $view = $this->view($list, 200);

        return $this->handleView($view);
    }
295307
private function getParsedBody(Request $request): array
    {
        $contentType = \explode(';', (string) $request->headers->get('content-type'), 2)[0];

        // JSON object
        switch ($contentType) {
            case static::CONTENT_TYPE_JSON:
                $parsedBody = \json_decode($request->getContent(), true);

                if (\JSON_ERROR_NONE !== \json_last_error()) {
                    throw new BadRequestHttpException('POST body sent invalid JSON');
                }
                break;

            case static::CONTENT_TYPE_FORM_DATA:
                $parsedBody = $this->handleUploadedFiles($request->request->all(), $request->files->all());
                break;

            default:
                throw new BadRequestHttpException(\sprintf(
                    'Batching parser only accepts "%s" or "%s" content-type but got %s.',
                    static::CONTENT_TYPE_JSON,
                    static::CONTENT_TYPE_FORM_DATA,
                    \json_encode($contentType)
                ));
        }

        return $parsedBody;
    }
1164894
public static function each(ORM &$model, Request $request, $data = null)
    {
        if (!is_null($data)) {
            foreach ($data as $key) {
                $model->$key = $request->$$key;
            }
        } else {
            foreach ($request->all() as $key => $value) {
                if (in_array($key, $model->_columns)) {
                    $model->$key = $request->$key;
                }
            }
        }
    }
685630
private function getRequestBody(Request $request): array
    {
        $contentType = $request->headers->get('CONTENT_TYPE', '');
        $semicolonPosition = strpos($contentType, ';');

        if ($semicolonPosition !== false) {
            $contentType = substr($contentType, 0, $semicolonPosition);
        }

        try {
            switch ($contentType) {
                case 'application/vnd.api+json':
                    return $this->serializer->decode($request->getContent(), 'jsonapi');
                case 'application/json':
                    return $request->request->all();
            }
        } catch (InvalidArgumentException | UnexpectedValueException $exception) {
            throw new BadRequestHttpException($exception->getMessage());
        }

        throw new UnsupportedMediaTypeHttpException(sprintf('The Content-Type "%s" is unsupported.', $contentType));
    }
818094
public function hasValidData(\Psr\Http\Message\ServerRequestInterface $request, $key = null)
    {
        if (! in_array($request->getMethod(), ['POST', 'PATCH', 'PUT', 'DELETE'])) {
            return false;
        }
        if (! $this->check($request)) {
            return false;
        }
        $data = $request->getParsedBody();
        return ! isset($key) or isset($data[$key]);
    }
354129
public function checks(Request $request)
    {
        $defaults = [
            'pass' => ['php' => [], 'system' => []],
            'fail' => ['php' => [], 'system' => []],
        ];
        $checks = MutableBag::fromRecursive([
            'requirements'    => $defaults,
            'recommendations' => $defaults,
        ]);
        /** @var RequirementCollection $baseReqs */
        $baseReqs = $this->app['requirements'];

        foreach ($baseReqs->getRequirements() as $requirement) {
            $result = $requirement->isFulfilled() ? 'pass' : 'fail';
            if ($requirement instanceof PhpConfigRequirement) {
                $checks->get('requirements')->get($result)->get('php')->add($requirement);

                continue;
            }
            $checks->get('requirements')->get($result)->get('system')->add($requirement);
        }
        foreach ($baseReqs->getRecommendations() as $recommendation) {
            $result = $recommendation->isFulfilled() ? 'pass' : 'fail';
            if ($recommendation instanceof PhpConfigRequirement) {
                $checks->get('recommendations')->get($result)->get('php')->add($recommendation);

                continue;
            }
            $checks->get('recommendations')->get($result)->get('system')->add($recommendation);
        }
        $showAll = $request->query->getBoolean('all');

        return $this->render('@bolt/checks/checks.twig', ['checks' => $checks, 'show_all' => $showAll]);
    }
1010721
function process_request (&$request)
    {
        if(isset($request->user) && !$request->user->isAnonymous()){
            return false;
        }
        if (! isset($request->SERVER['PHP_AUTH_USER'])) {
            return false;
        }
        
        $auth = array(
                'login' => $request->SERVER['PHP_AUTH_USER'],
                'password' => $request->SERVER['PHP_AUTH_PW']
        );
        foreach (Pluf::f('auth_backends', 
                array(
                        'User_Auth_ModelBackend'
                )) as $backend) {
            $user = call_user_func(
                    array(
                            $backend,
                            'authenticate'
                    ), $auth);
            if ($user !== false) {
                break;
            }
        }
        if($user){
            $request->user = $user;
        }
        return false;
    }