class RequestFilter (View source)

A RequestFilter is configured to match specific ActionRequests and call a InterceptorInterface if needed.

Properties

protected RequestPatternInterface $pattern
protected InterceptorInterface $securityInterceptor

Methods

__construct(RequestPatternInterface $pattern, InterceptorInterface $securityInterceptor)

Constructor.

getRequestPattern()

Returns the set request pattern

getSecurityInterceptor()

Returns the set security interceptor

bool
filterRequest(ActionRequest $request)

Tries to match the given request against this filter and calls the set security interceptor on success.

Details

__construct(RequestPatternInterface $pattern, InterceptorInterface $securityInterceptor)

Constructor.

Parameters

RequestPatternInterface $pattern

The pattern this filter matches

InterceptorInterface $securityInterceptor

The interceptor called on pattern match

RequestPatternInterface getRequestPattern()

Returns the set request pattern

Return Value

RequestPatternInterface

The set request pattern

InterceptorInterface getSecurityInterceptor()

Returns the set security interceptor

Return Value

InterceptorInterface

The set security interceptor

bool filterRequest(ActionRequest $request)

Tries to match the given request against this filter and calls the set security interceptor on success.

Parameters

ActionRequest $request

The request to be matched

Return Value

bool

Returns true if the filter matched, false otherwise

Exceptions

AccessDeniedException
AuthenticationRequiredException
NoTokensAuthenticatedException