Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b6e65ab

Browse filesBrowse files
committed
Provides a SessionFactoryInterface
1 parent 702a3ee commit b6e65ab
Copy full SHA for b6e65ab

File tree

4 files changed

+29
-2
lines changed
Filter options

4 files changed

+29
-2
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/session.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/session.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
1818
use Symfony\Component\HttpFoundation\Session\Session;
1919
use Symfony\Component\HttpFoundation\Session\SessionFactory;
20+
use Symfony\Component\HttpFoundation\Session\SessionFactoryInterface;
2021
use Symfony\Component\HttpFoundation\Session\SessionInterface;
2122
use Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler;
2223
use Symfony\Component\HttpFoundation\Session\Storage\Handler\IdentityMarshaller;
@@ -32,6 +33,7 @@
3233
use Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage;
3334
use Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorageFactory;
3435
use Symfony\Component\HttpFoundation\Session\Storage\ServiceSessionFactory;
36+
use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageFactoryInterface;
3537
use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface;
3638
use Symfony\Component\HttpKernel\EventListener\SessionListener;
3739

@@ -47,6 +49,7 @@
4749
service('session.storage.factory'),
4850
[service('session_listener'), 'onSessionUsage'],
4951
])
52+
->alias(SessionFactoryInterface::class, 'session.factory')
5053

5154
->set('session.storage.factory.native', NativeSessionStorageFactory::class)
5255
->args([
@@ -84,6 +87,7 @@
8487
service('session.storage'),
8588
])
8689
->deprecate('symfony/framework-bundle', '5.3', 'The "%service_id%" service is deprecated, use "session.storage.factory.native", "session.storage.factory.php_bridge" or "session.storage.factory.mock_file" instead.')
90+
->alias(SessionStorageFactoryInterface::class, 'session.storage.factory')
8791

8892
->set('.session.deprecated', SessionInterface::class) // to be removed in 6.0
8993
->factory([inline_service(DeprecatedSessionFactory::class)->args([service('request_stack')]), 'getSession'])

‎src/Symfony/Component/HttpFoundation/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CHANGELOG
44
5.3
55
---
66

7-
* Add the `SessionFactory`, `NativeSessionStorageFactory`, `PhpBridgeSessionStorageFactory` and `MockFileSessionStorageFactory` classes
7+
* Add the `SessionFactoryInterface` and `SessionStorageFactoryInterface`, and add the `SessionFactory`, `NativeSessionStorageFactory`, `PhpBridgeSessionStorageFactory` and `MockFileSessionStorageFactory` classes that implements these interfaces
88
* Calling `Request::getSession()` when there is no available session throws a `SessionNotFoundException`
99
* Add the `RequestStack::getSession` method
1010
* Deprecate the `NamespacedAttributeBag` class

‎src/Symfony/Component/HttpFoundation/Session/SessionFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/SessionFactory.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class_exists(Session::class);
2020
/**
2121
* @author Jérémy Derussé <jeremy@derusse.com>
2222
*/
23-
class SessionFactory
23+
class SessionFactory implements SessionFactoryInterface
2424
{
2525
private $requestStack;
2626
private $storageFactory;
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\HttpFoundation\Session;
13+
14+
/**
15+
* @author Jérémy Derussé <jeremy@derusse.com>
16+
*/
17+
interface SessionFactoryInterface
18+
{
19+
/**
20+
* Creates a new instance of SessionInterface.
21+
*/
22+
public function createSession(): SessionInterface;
23+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.