class KernelEvent extends Event (View source)

Symfony 6 bridge.

This is a copy of Symfony\Component\HttpKernel\Event\KernelEvent with two changes: adding an ::isMainRequest() method for forward compatibility with Symfony 5.3+, and issuing a deprecation message from ::isMasterRequest().

Methods

__construct(HttpKernelInterface $kernel, Request $request, int|null $requestType)

No description

HttpKernelInterface
getKernel()

Returns the kernel in which this event was thrown.

Request
getRequest()

Returns the request the kernel is currently processing.

int
getRequestType()

Returns the request type the kernel is currently processing.

bool
isMasterRequest()

Checks if this is a master request.

bool
isMainRequest()

Checks if this is a main request.

Details

__construct(HttpKernelInterface $kernel, Request $request, int|null $requestType)

No description

Parameters

HttpKernelInterface $kernel
Request $request
int|null $requestType

The request type the kernel is currently processing; one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST

HttpKernelInterface getKernel()

Returns the kernel in which this event was thrown.

Return Value

HttpKernelInterface

Request getRequest()

Returns the request the kernel is currently processing.

Return Value

Request

int getRequestType()

Returns the request type the kernel is currently processing.

Return Value

int

One of HttpKernelInterface::MASTER_REQUEST and HttpKernelInterface::SUB_REQUEST

bool isMasterRequest()

Checks if this is a master request.

Return Value

bool

True if the request is a master request

bool isMainRequest()

Checks if this is a main request.

Return Value

bool

True if the request is a main request