@param \Symfony\Component\HttpFoundation\Request $request

@return bool

@throws \EzSystems\EzPlatformAdminUi\Exception\InvalidArgumentException
334295
protected function isAdminSiteAccess(Request $request): bool
    {
        return (new IsAdmin($this->siteAccessGroups))->isSatisfiedBy($request->attributes->get('siteaccess'));
    }
700266
protected function validateRequest(Request $request)
    {
        if (php_sapi_name() === 'cli') {
            return false;
        }
        $route   = call_user_func($request->getRouteResolver());
        $ignored = $this->container->make('config')->get('antares/ui-components::ignore');
        $action  = $route->getAction();


        if (isset($action['uses']) and $action['uses'] instanceof Closure) {
            return true;
        }

        $resource = array_get($action, 'controller');

        foreach ($ignored as $controller => $actions) {
            foreach ($actions as $action) {
                if ($resource === "$controller@$action") {
                    return true;
                }
            }
        }

        return !( $request->method() !== 'GET' or ! empty($request->query()));
    }
947600
public function moveAction(Request $request): Response
    {
        $form = $this->formFactory->moveLocation(
            new LocationMoveData()
        );
        $form->handleRequest($request);

        $location = $form->getData()->getLocation();

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (LocationMoveData $data) {
                $location = $data->getLocation();
                $newParentLocation = $data->getNewParentLocation();

                if (!$newParentLocation->getContent()->getContentType()->isContainer) {
                    throw new InvalidArgumentException(
                        '$newParentLocation',
                        'Cannot move location to a parent that is not a container'
                    );
                }

                $this->locationService->moveSubtree($location, $newParentLocation);

                $this->notificationHandler->success(
                    $this->translator->trans(
                        /** @Desc("'%name%' moved to '%location%'") */
                        'location.move.success',
                        ['%name%' => $location->getContentInfo()->name, '%location%' => $newParentLocation->getContentInfo()->name],
                        'location'
                    )
                );

                return new RedirectResponse($this->generateUrl('_ezpublishLocation', [
                    'locationId' => $location->id,
                ]));
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        return $this->redirect($this->generateUrl('_ezpublishLocation', [
            'locationId' => $location->id,
        ]));
    }
848152
public function meetsConstraints(Request $request)
    {
        foreach ($this->constraints as $constraint) {
            if (!$constraint($request)) {
                return false;
            }
        }

        return true;
    }
428992
public function validateAuthorizationHeader(Request $request)
    {
        try {
            return parent::validateAuthorizationHeader($request);
        } catch (BadRequestHttpException $exception) {
            if (empty($request->query('token', ''))) {
                throw $exception;
            }
        }

        return true;
    }
1134060
private function validateSubscriber(Request $request)
    {
        /** @var string[] $invalidFields */
        $invalidFields = [];
        if (filter_var($request->get('email'), FILTER_VALIDATE_EMAIL) === false) {
            $invalidFields[] = 'email';
        }

        $booleanFields = ['confirmed', 'blacklisted', 'html_email', 'disabled'];
        foreach ($booleanFields as $fieldKey) {
            if ($request->get($fieldKey) !== null && !is_bool($request->get($fieldKey))) {
                $invalidFields[] = $fieldKey;
            }
        }

        if (!empty($invalidFields)) {
            throw new UnprocessableEntityHttpException(
                'Some fields invalid:' . implode(', ', $invalidFields),
                null,
                1513446736
            );
        }
    }
791238
private function mustRedirect(ServerRequestInterface $request): bool
    {
        if ($this->redirect === false) {
            return false;
        }

        return !$this->checkHttpsForward || (
            $request->getHeaderLine('X-Forwarded-Proto') !== 'https' &&
            $request->getHeaderLine('X-Forwarded-Port') !== '443'
        );
    }
163204
public static function useHttps(Request $request): bool
    {
        $checks = [
            'HTTPS',
            'SERVER_PORT',
            'HTTP_X_FORWARDED_SSL',
            'HTTP_X_FORWARDED_PROTO',
        ];
        foreach ($checks as $check) {
            if (call_user_func([__CLASS__, sprintf('check%s', Text::toCamelCase($check))], $request)) {
                return true;
            }
        }

        return false;
    }
310796
public function verify(Request $request)
    {
        if ($request->route('id') != $request->user()->getKey()) {
            throw new AuthorizationException();
        }

        if ($request->user()->hasVerifiedEmail()) {
            return redirect($this->redirectPath());
        }

        if ($request->user()->markEmailAsVerified()) {
            event(new Verified($request->user()));
        }

        return redirect($this->redirectPath())->with('verified', true);
    }
1164836
public function isActive(Request $request)
    {
        // Check request arguments
        $debugger = $request ? $request->get($key = 'pdebug', $default = null, $includeCookies = true) : false;

        // Reload status
        $this->setActive(self::$active || $debugger || $this->app->getEnvironment() == 'development');

        return self::$active;
    }
1243698
public function isAjaxRequest(Request $request)
    {
        $result = false;
        $requestedWith = $request->server->get('HTTP_X_REQUESTED_WITH');
        if (is_string($requestedWith) && strcasecmp($requestedWith, 'XMLHttpRequest') === 0) {
            $result = true;
        }

        return $result;
    }
797970
private static function isValidOrigin(RequestInterface $request): bool
    {
        if (!self::compareHeaderUrl($request, 'Origin')) {
            return false;
        }

        if (!self::compareHeaderUrl($request, 'Referer')) {
            return false;
        }

        return true;
    }
501514
private function isTokenInRequest(Request $request)
    {
        return $request->query->has($this->tokenParam) ||
            $request->attributes->has($this->tokenParam) ||
            $request->request->has($this->tokenParam);
    }
821840
public function entryAction(Request $request)
    {
		if(!$request->request->has('eventkey')) {
			throw new InvalidArgumentException("Missing eventKey parameter");
		}

		if(!$request->request->has('eventvalue')) {
			throw new InvalidArgumentException("Missing eventValue parameter");
		}

		$eventkey 	= $request->get('eventKey');
		$eventvalue = $request->get('eventValue');

		$this->get('event_dispatcher')->dispatch(DispatcherEventName::API_DISPATCHER_ENTRY, new DispatcherEntryEvent($eventkey, $eventvalue));

		return new JsonResponse();
    }
83420
public static function canBeUsedForRequest(Request $request)
    {
        return $request->has(self::CHUNK_NUMBER_INDEX) && $request->has(self::TOTAL_CHUNKS_INDEX) &&
            $request->has(self::CHUNK_UUID_INDEX);
    }
619942
public function validate(Request $request)
    {
        $this->validateUsername($request);
        $this->validatePassword($request);
        $this->validateEmail($request);
        $this->validateGender($request);

        return $this->isValid;
    }
683956
public static function isPagingRequest(Request $request)
    {
        $matches = [];
        $found = preg_match('/page_[A-Za-z0-9_]+=(?!1\b)\d+/', $request->getRequestUri(), $matches);

        return (bool) $found;
    }