class AnonymousUserResponseSubscriber implements EventSubscriberInterface (View source)

Response subscriber to handle finished responses for the anonymous user.

Properties

protected AccountInterface $currentUser

The current user.

Methods

__construct(AccountInterface $current_user)

Constructs an AnonymousUserResponseSubscriber object.

onRespond(FilterResponseEvent $event)

Adds a cache tag if the 'user.permissions' cache context is present.

static array
getSubscribedEvents()

Registers the methods in this class that should be listeners.

Details

__construct(AccountInterface $current_user)

Constructs an AnonymousUserResponseSubscriber object.

Parameters

AccountInterface $current_user

The current user.

onRespond(FilterResponseEvent $event)

Adds a cache tag if the 'user.permissions' cache context is present.

Parameters

FilterResponseEvent $event

The event to process.

static array getSubscribedEvents()

Registers the methods in this class that should be listeners.

Return Value

array

An array of event listener definitions.