package and depencies
This commit is contained in:
29
vendor/symfony/http-foundation/RequestStack.php
vendored
29
vendor/symfony/http-foundation/RequestStack.php
vendored
@@ -24,7 +24,7 @@ class RequestStack
|
||||
/**
|
||||
* @var Request[]
|
||||
*/
|
||||
private $requests = [];
|
||||
private array $requests = [];
|
||||
|
||||
/**
|
||||
* Pushes a Request on the stack.
|
||||
@@ -44,10 +44,8 @@ class RequestStack
|
||||
*
|
||||
* This method should generally not be called directly as the stack
|
||||
* management should be taken care of by the application itself.
|
||||
*
|
||||
* @return Request|null
|
||||
*/
|
||||
public function pop()
|
||||
public function pop(): ?Request
|
||||
{
|
||||
if (!$this->requests) {
|
||||
return null;
|
||||
@@ -56,10 +54,7 @@ class RequestStack
|
||||
return array_pop($this->requests);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Request|null
|
||||
*/
|
||||
public function getCurrentRequest()
|
||||
public function getCurrentRequest(): ?Request
|
||||
{
|
||||
return end($this->requests) ?: null;
|
||||
}
|
||||
@@ -80,20 +75,6 @@ class RequestStack
|
||||
return $this->requests[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the master request.
|
||||
*
|
||||
* @return Request|null
|
||||
*
|
||||
* @deprecated since symfony/http-foundation 5.3, use getMainRequest() instead
|
||||
*/
|
||||
public function getMasterRequest()
|
||||
{
|
||||
trigger_deprecation('symfony/http-foundation', '5.3', '"%s()" is deprecated, use "getMainRequest()" instead.', __METHOD__);
|
||||
|
||||
return $this->getMainRequest();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the parent request of the current.
|
||||
*
|
||||
@@ -102,10 +83,8 @@ class RequestStack
|
||||
* like ESI support.
|
||||
*
|
||||
* If current Request is the main request, it returns null.
|
||||
*
|
||||
* @return Request|null
|
||||
*/
|
||||
public function getParentRequest()
|
||||
public function getParentRequest(): ?Request
|
||||
{
|
||||
$pos = \count($this->requests) - 2;
|
||||
|
||||
|
Reference in New Issue
Block a user