3636 *
3737 * @author Johannes M. Schmitt <[email protected] > 3838 * @author Tobias Schultze <http://tobion.de>
39- *
40- * @internal
4139 */
4240abstract class AbstractSessionListener implements EventSubscriberInterface, ResetInterface
4341{
4442 public const NO_AUTO_CACHE_CONTROL_HEADER = 'Symfony-Session-NoAutoCacheControl ' ;
4543
44+
45+ /**
46+ * @internal
47+ */
4648 protected $ container ;
4749 private $ sessionUsageStack = [];
4850 private $ debug ;
@@ -52,13 +54,19 @@ abstract class AbstractSessionListener implements EventSubscriberInterface, Rese
5254 */
5355 private $ sessionOptions ;
5456
57+ /**
58+ * @internal
59+ */
5560 public function __construct (ContainerInterface $ container = null , bool $ debug = false , array $ sessionOptions = [])
5661 {
5762 $ this ->container = $ container ;
5863 $ this ->debug = $ debug ;
5964 $ this ->sessionOptions = $ sessionOptions ;
6065 }
6166
67+ /**
68+ * @internal
69+ */
6270 public function onKernelRequest (RequestEvent $ event )
6371 {
6472 if (!$ event ->isMainRequest ()) {
@@ -94,6 +102,9 @@ public function onKernelRequest(RequestEvent $event)
94102 $ this ->sessionUsageStack [] = $ session instanceof Session ? $ session ->getUsageIndex () : 0 ;
95103 }
96104
105+ /**
106+ * @internal
107+ */
97108 public function onKernelResponse (ResponseEvent $ event )
98109 {
99110 if (!$ event ->isMainRequest () || (!$ this ->container ->has ('initialized_session ' ) && !$ event ->getRequest ()->hasSession ())) {
@@ -222,13 +233,19 @@ public function onKernelResponse(ResponseEvent $event)
222233 }
223234 }
224235
236+ /**
237+ * @internal
238+ */
225239 public function onFinishRequest (FinishRequestEvent $ event )
226240 {
227241 if ($ event ->isMainRequest ()) {
228242 array_pop ($ this ->sessionUsageStack );
229243 }
230244 }
231245
246+ /**
247+ * @internal
248+ */
232249 public function onSessionUsage (): void
233250 {
234251 if (!$ this ->debug ) {
@@ -264,6 +281,9 @@ public function onSessionUsage(): void
264281 throw new UnexpectedSessionUsageException ('Session was used while the request was declared stateless. ' );
265282 }
266283
284+ /**
285+ * @internal
286+ */
267287 public static function getSubscribedEvents (): array
268288 {
269289 return [
@@ -274,6 +294,9 @@ public static function getSubscribedEvents(): array
274294 ];
275295 }
276296
297+ /**
298+ * @internal
299+ */
277300 public function reset (): void
278301 {
279302 if (\PHP_SESSION_ACTIVE === session_status ()) {
@@ -291,6 +314,8 @@ public function reset(): void
291314 /**
292315 * Gets the session object.
293316 *
317+ * @internal
318+ *
294319 * @return SessionInterface|null
295320 */
296321 abstract protected function getSession ();
0 commit comments