/home/techb158/immovalet.com/vendor/symfony/http-foundation
NameSizeModeActions
Exception/-0755rm
File/-0755rm
RateLimiter/-0755rm
Session/-0755rm
Test/-0755rm
AcceptHeader.php36390644editdlrm
AcceptHeaderItem.php34080644editdlrm
BinaryFileResponse.php124950644editdlrm
CHANGELOG.md153390644editdlrm
composer.json11220644editdlrm
Cookie.php116490644editdlrm
ExpressionRequestMatcher.php13540644editdlrm
FileBag.php39790644editdlrm
HeaderBag.php73790644editdlrm
HeaderUtils.php94330644editdlrm
InputBag.php41360644editdlrm
IpUtils.php55620644editdlrm
JsonResponse.php75890644editdlrm
LICENSE10650644editdlrm
ParameterBag.php60290644editdlrm
README.md5260644editdlrm
RedirectResponse.php30720644editdlrm
Request.php684290644editdlrm
RequestMatcher.php48950644editdlrm
RequestMatcherInterface.php6870644editdlrm
RequestStack.php31500644editdlrm
Response.php372720644editdlrm
ResponseHeaderBag.php79770644editdlrm
ServerBag.php40040644editdlrm
StreamedResponse.php31370644editdlrm
UrlHelper.php30940644editdlrm
Edit: /home/techb158/immovalet.com/vendor/symfony/http-foundation/RequestStack.php (3150B)
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation; use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException; use Symfony\Component\HttpFoundation\Session\SessionInterface; /** * Request stack that controls the lifecycle of requests. * * @author Benjamin Eberlei */ class RequestStack { /** * @var Request[] */ private $requests = []; /** * Pushes a Request on the stack. * * This method should generally not be called directly as the stack * management should be taken care of by the application itself. */ public function push(Request $request) { $this->requests[] = $request; } /** * Pops the current request from the stack. * * This operation lets the current request go out of scope. * * 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() { if (!$this->requests) { return null; } return array_pop($this->requests); } /** * @return Request|null */ public function getCurrentRequest() { return end($this->requests) ?: null; } /** * Gets the main request. * * Be warned that making your code aware of the main request * might make it un-compatible with other features of your framework * like ESI support. */ public function getMainRequest(): ?Request { if (!$this->requests) { return null; } 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. * * Be warned that making your code aware of the parent request * might make it un-compatible with other features of your framework * like ESI support. * * If current Request is the main request, it returns null. * * @return Request|null */ public function getParentRequest() { $pos = \count($this->requests) - 2; return $this->requests[$pos] ?? null; } /** * Gets the current session. * * @throws SessionNotFoundException */ public function getSession(): SessionInterface { if ((null !== $request = end($this->requests) ?: null) && $request->hasSession()) { return $request->getSession(); } throw new SessionNotFoundException(); } }