get(SessionStoreInterface::class); $service = $container->get(NotificationService::class); if (!$sessionStore instanceof SessionStoreInterface || !$service instanceof NotificationService) { return; } $sessionStore->set(self::SESSION_KEY, $service->unreadCount($userId)); } public function clear(): void { unset($_SESSION[self::SESSION_KEY]); } }