From defe22922966026c580bf4bf3007d4f064c93494 Mon Sep 17 00:00:00 2001 From: Florian Merle Date: Thu, 14 Dec 2023 14:10:16 +0100 Subject: [PATCH] [HttpKernel] Move @internal from AbstractSessionListener class to its methods and properties --- .../EventListener/AbstractSessionListener.php | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php b/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php index cb994cd77d6f..979154be9a7b 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php @@ -36,13 +36,15 @@ * * @author Johannes M. Schmitt * @author Tobias Schultze - * - * @internal */ abstract class AbstractSessionListener implements EventSubscriberInterface, ResetInterface { public const NO_AUTO_CACHE_CONTROL_HEADER = 'Symfony-Session-NoAutoCacheControl'; + + /** + * @internal + */ protected $container; private $sessionUsageStack = []; private $debug; @@ -52,6 +54,9 @@ abstract class AbstractSessionListener implements EventSubscriberInterface, Rese */ private $sessionOptions; + /** + * @internal + */ public function __construct(ContainerInterface $container = null, bool $debug = false, array $sessionOptions = []) { $this->container = $container; @@ -59,6 +64,9 @@ public function __construct(ContainerInterface $container = null, bool $debug = $this->sessionOptions = $sessionOptions; } + /** + * @internal + */ public function onKernelRequest(RequestEvent $event) { if (!$event->isMainRequest()) { @@ -94,6 +102,9 @@ public function onKernelRequest(RequestEvent $event) $this->sessionUsageStack[] = $session instanceof Session ? $session->getUsageIndex() : 0; } + /** + * @internal + */ public function onKernelResponse(ResponseEvent $event) { if (!$event->isMainRequest() || (!$this->container->has('initialized_session') && !$event->getRequest()->hasSession())) { @@ -222,6 +233,9 @@ public function onKernelResponse(ResponseEvent $event) } } + /** + * @internal + */ public function onFinishRequest(FinishRequestEvent $event) { if ($event->isMainRequest()) { @@ -229,6 +243,9 @@ public function onFinishRequest(FinishRequestEvent $event) } } + /** + * @internal + */ public function onSessionUsage(): void { if (!$this->debug) { @@ -264,6 +281,9 @@ public function onSessionUsage(): void throw new UnexpectedSessionUsageException('Session was used while the request was declared stateless.'); } + /** + * @internal + */ public static function getSubscribedEvents(): array { return [ @@ -274,6 +294,9 @@ public static function getSubscribedEvents(): array ]; } + /** + * @internal + */ public function reset(): void { if (\PHP_SESSION_ACTIVE === session_status()) { @@ -291,6 +314,8 @@ public function reset(): void /** * Gets the session object. * + * @internal + * * @return SessionInterface|null */ abstract protected function getSession();