@param Request $request
@param string  $key

@return mixed
510775
public function get(Request $request, string $key)
    {
        $value = json_decode((string) $this->getSession($request)->get($key), true);

        $this->logger->info('session: get key {key}, exists {exists}', ['key' => $key, 'exists' => (bool) $value]);

        return $value;
    }
985790
protected function authenticateRequest(Request $request)
    {
        if ($this->authenticator && $this->authenticate) {
            return $this->authenticator->authenticate($request);
        }

        return $request;
    }
236277
private function send(Request $request)
    {
        $options = [
            'base_uri' => self::BASE_URI,
            'http_errors' => false,
        ];

        return $this->client->send($request, $options);
    }
267631
protected function getSortingFromRequest(Request $request)
    {
        return $this->extractValues($this->getValuesFromRequest($request), $this->getSortingPrefix());
    }
577520
public function matchRequest(Request $request) {
        $context = new RequestContext();
        $context->fromRequest($request);
        $this->setContext($context);

        return($this->match($request->getPathInfo()));
    }
1129107
public function editAction(Request $request, $key, $domain)
    {
        $translation = $this->get('asm_translation_loader.translation_manager')
            ->findTranslationBy(
                array(
                    'transKey' => $key,
                    'transLocale' => $request->getLocale(),
                    'messageDomain' => $domain,
                )
            );
                
        $entity = new Translation();
        $entity->setKey($translation->getTransKey());
        $entity->setDomain($domain);
        foreach ($this->getParameter('a2lix_translation_form.locales') as $k => $loc) {
            
            $translation = $this->get('asm_translation_loader.translation_manager')
                ->findTranslationBy(
                    array(
                        'transKey' => $key,
                        'transLocale' => $loc,
                        'messageDomain' => $domain,
                    )
                );
            if($translation){
                $trans = new TranslationTranslation();
                $trans->setLocale($loc);
                $trans->setValue($translation->getTranslation());
                $entity->addTranslation($trans);
            }
            
        }
        
        $deleteForm = $this->createDeleteForm($key, $domain);
        $editForm = $this->createForm('CoreBundle\Form\TranslationType', $entity);
        $editForm->handleRequest($request);

        if ($editForm->isSubmitted() && $editForm->isValid()) {
            
            //Create entry in DB
            $this->updateTranslation($entity);
            
            $this->get('session')->getFlashBag()->add('success', 'translation.edited');
            
            return $this->redirectToRoute('core_translation_index');
        }

        return $this->render('CoreBundle:Translation:edit.html.twig', array(
            'entity' => $entity,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }
314338
public function getRouteForRequest(Request $request)
    {
        $routes = $this->collection->get($request->getMethod());

        return $this->check($routes, $request);
    }
1276334
private function convert($request, $key, $value)
	{
		if (is_array($value) || is_object($value))
		{
			return $this->traverse($request, $value);
		}

		if (!in_array($key, $this->keys, true))
		{
			return $value;
		}

		if (substr($value, 0, 4) == 'http')
		{
			return $value;
		}

		return rtrim(str_replace('/api', '', $request->root()), '/') . '/' . ltrim($value, '/');
	}
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);
    }
442573
public static function request($key = false) {

        if (isset($_REQUEST)) {

            if ($key) {

                return $_REQUEST[$key];
            }

            return $_REQUEST;
        }

        return false;
    }
461169
public function matchRequest(Request $request)
    {
        try {
            $parameters = parent::matchRequest($request);
            $this->matchedRouteRequest = $request;
            return $parameters;
        } catch (\Exception $e) {
            throw $e;
        }


    }
566551
public static function getResponder(Request $request)
    {
        if ($request instanceof HttpRequest) {
            return self::getHttpResponder($request);
        } else {
            $requestType = get_class($request);
            throw new \InvalidArgumentException("Requests of type '{$requestType}' are not supported.");
        }
    }
1243870
private function getFilter(Request $request)
    {
        $success = false;
        $filter = null;
        if ($request->query->has('filter')) {
            $filter = $request->query->get('filter');
            $type = 'query';
        } elseif ($request->request->has('filter')) {
            $filter = $request->request->get('filter');
            $type = 'request';
        } elseif ($request->getMethod() === 'PUT') {
            $_PUT = json_decode($request->getContent(), true);
            if (!empty($_PUT['filter'])) {
                $filter = $_PUT['filter'];
                $type = 'put';
            }
        }

        if ($filter === null) {
            if ($this->container->getParameter('kernel.environment') === 'dev') {
                $value = new Response($this->get('translator')->trans('error.requestMustHasFilter', array(), 'ApoutchikaMediaBundle'), 500);
            } else {
                $value = new Response($this->get('translator')->trans('error.requestMustHasFilterProd', array(), 'ApoutchikaMediaBundle'), 500);
            }
        } elseif (!$this->get('apoutchika_media.filter')->has($filter)) {
            if ($this->container->getParameter('kernel.environment') === 'dev') {
                $value = new Response($this->get('translator')->trans('error.requestMustHasCorrectFilter', array(), 'ApoutchikaMediaBundle'), 500);
            } else {
                $value = new Response($this->get('translator')->trans('error.requestMustHasCorrectFilterProd', array(), 'ApoutchikaMediaBundle'), 500);
            }
        } else {
            $success = true;
            $value = $this->get('apoutchika_media.filter')->get($filter);
        }

        return array(
            'success' => $success,
            'value' => $value,
            'crypted' => $filter,
        );
    }
918145
public function execute(Request $request): Response
    {
        $method = $request->getMethod();
        list($resp, $grpcStatus) = $request->getClient()->$method(
            $request->getMessage(),
            $request->getMetadata(),
            $request->getOptions()
        )->wait();

        $headers = new HeaderCollection();

        if (is_null($grpcStatus)) { // in the very bad case even this fails to return
            $status = new Error\Status(\Grpc\STATUS_UNKNOWN, '', $headers);
        } else {
            $metadata = $grpcStatus->metadata;
            foreach ($metadata as $k => $v) {
                if (is_array($v)) {
                    foreach ($v as $v2) {
                        $headers->add($k, $v2);
                    }
                } else {
                    $headers->add($k, $v);
                }
            }
            $status = new Error\Status(intval($grpcStatus->code), strval($grpcStatus->details), $headers);
        }

        if (is_null($resp)) {
            $request->fail($status);
        }

        return $request->succeed($resp, $status);
    }
569355
public function request($key = null)
    {
        if ($key) {

            if (!isset($_REQUEST[$key])) {
                throw new \InvalidArgumentException(sprintf(
                    '%s ist not a valid key for $_POST', $key
                ));
            }

            return $_REQUEST[$key];

        }

        return $_REQUEST;
    }
1055017
public function cgetAction(Request $request)
    {
        if (null !== $request->get('fields')) {
            return $this->cgetContent($request);
        }

        return $this->cgetNodes($request);
    }
1050194
public function handle(Request $request)
	{
		// execute response
		$response = $this->next($request);

		// only do this if user wants it expanded
		if (!$expand = $request->getVar('expand', null))
		{
			return $response;
		}

		// normalize keys
		$expandKeys = $this->normalizeExpandKeys($expand);

		// only do on json data
		if (!$response->isJson())
		{
			return $response;
		}

		// get the response content and json decode
		$content = json_decode($response->getContent());

		// make sure to handle array different then a single object
		if (is_array($content))
		{
			// loop through each item in array and covert dates
			foreach ($content as $key => $value)
			{
				$content[$key] = $this->convertExpandKeysInObjects($expandKeys, $value);
			}
		}
		else
		{
			// convert single object dates
			$content = $this->convertExpandKeysInObjects($expandKeys, $content);
		}

		// set the response content to modified content
		$response->setContent(json_encode($content));

		// return response
		return $response;
	}