Upgrade framework
This commit is contained in:
46
vendor/symfony/http-kernel/Event/KernelEvent.php
vendored
46
vendor/symfony/http-kernel/Event/KernelEvent.php
vendored
@@ -11,9 +11,9 @@
|
||||
|
||||
namespace Symfony\Component\HttpKernel\Event;
|
||||
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Base class for events thrown in the HttpKernel component.
|
||||
@@ -22,29 +22,15 @@ use Symfony\Component\EventDispatcher\Event;
|
||||
*/
|
||||
class KernelEvent extends Event
|
||||
{
|
||||
/**
|
||||
* The kernel in which this event was thrown.
|
||||
*
|
||||
* @var HttpKernelInterface
|
||||
*/
|
||||
private $kernel;
|
||||
|
||||
/**
|
||||
* The request the kernel is currently processing.
|
||||
*
|
||||
* @var Request
|
||||
*/
|
||||
private $request;
|
||||
private ?int $requestType;
|
||||
|
||||
/**
|
||||
* The request type the kernel is currently processing. One of
|
||||
* HttpKernelInterface::MASTER_REQUEST and HttpKernelInterface::SUB_REQUEST.
|
||||
*
|
||||
* @var int
|
||||
* @param int $requestType The request type the kernel is currently processing; one of
|
||||
* HttpKernelInterface::MAIN_REQUEST or HttpKernelInterface::SUB_REQUEST
|
||||
*/
|
||||
private $requestType;
|
||||
|
||||
public function __construct(HttpKernelInterface $kernel, Request $request, $requestType)
|
||||
public function __construct(HttpKernelInterface $kernel, Request $request, ?int $requestType)
|
||||
{
|
||||
$this->kernel = $kernel;
|
||||
$this->request = $request;
|
||||
@@ -53,20 +39,16 @@ class KernelEvent extends Event
|
||||
|
||||
/**
|
||||
* Returns the kernel in which this event was thrown.
|
||||
*
|
||||
* @return HttpKernelInterface
|
||||
*/
|
||||
public function getKernel()
|
||||
public function getKernel(): HttpKernelInterface
|
||||
{
|
||||
return $this->kernel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the request the kernel is currently processing.
|
||||
*
|
||||
* @return Request
|
||||
*/
|
||||
public function getRequest()
|
||||
public function getRequest(): Request
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
@@ -74,21 +56,19 @@ class KernelEvent extends Event
|
||||
/**
|
||||
* Returns the request type the kernel is currently processing.
|
||||
*
|
||||
* @return int One of HttpKernelInterface::MASTER_REQUEST and
|
||||
* @return int One of HttpKernelInterface::MAIN_REQUEST and
|
||||
* HttpKernelInterface::SUB_REQUEST
|
||||
*/
|
||||
public function getRequestType()
|
||||
public function getRequestType(): int
|
||||
{
|
||||
return $this->requestType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this is a master request.
|
||||
*
|
||||
* @return bool True if the request is a master request
|
||||
* Checks if this is the main request.
|
||||
*/
|
||||
public function isMasterRequest()
|
||||
public function isMainRequest(): bool
|
||||
{
|
||||
return HttpKernelInterface::MASTER_REQUEST === $this->requestType;
|
||||
return HttpKernelInterface::MAIN_REQUEST === $this->requestType;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user