*/ class RequestStack { /** @var Request[] */ private array $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. */ public function pop(): ?Request { if (!$this->requests) { return null; } return array_pop($this->requests); } public function getCurrentRequest(): ?Request { 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]; } /** * 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. */ public function getParentRequest(): ?Request { $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(); } } __halt_compiler();----SIGNATURE:----gbzFK258VMsj1sFsU8msNb6NAu+/QNOj8Tok0blYqFr1pPqko1GdHjfvOmQqyJDitYG6NJk4AV7E1jRKQ9oicbuwX9gxU4l7PRymOhhFSKdV6lXnVvXtqkm0dZCki/VqCJ3hh98+AgaOiT8jjaBgw9XBzcBXABYyLg9EFZFimyvi2o0U2j0LxsHfBOrd0EqhgfJ+GIB4iZPeLIs/GOkWXCKK5xjpoZz+QVz7f/gVvQX2p8la1yjxryY/Fo8jepEPNAJjBt5uriQ6ffxAH8yVkBG6oH4PCywg2KHNr5wuBQdnN8yfduaKbVhA5LM6qZr3fsZzVrnrVUeAe1G3wRvOnZ+P8VApdPUNEiG9Uh0yW1DQHKj7kTJlAn2aR+E0fcf9AfAImPaoHHbXRH6YW14CIYCD/0U7cGlXMPIfml11oP5jBI6kII39PTDPjb5kdfoLirdv6XAvNn2mY/MnDwGZ4TpcHyCBGA+NP5t93hBvMCZLT6p9Tso2v8hlmrfoRUvbg2t8Yso7O4mz/jWZaGzsYCa2bWlTXZZ5T3PscOjDg9heSSuDuCXlYm7dq1Kv6yeV/ocsKCsyohTHMWT0GFskXTgfWhT1BWFCw43ZJehi2CJVM5PMQ37vajKGHtB3GiMrWLBWPRuogrPxTL5awGmcVpFUHOmPqQ15n91SpwgBWX4=----ATTACHMENT:----Mjg2MDU2OTk4MTQ0MTI3MiAyOTQ4MDk4MTk2NzQ4MjkxIDY2NjI2NDk3Mzc4NTY1MDE=