10000 feature #42286 [HttpFoundation] Add `SessionFactoryInterface` (kbond) · symfony/symfony@fcd3a0c · GitHub
[go: up one dir, main page]

Skip to content

Commit fcd3a0c

Browse files
committed
feature #42286 [HttpFoundation] Add SessionFactoryInterface (kbond)
This PR was merged into the 5.4 branch. Discussion ---------- [HttpFoundation] Add `SessionFactoryInterface` | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #41443 | License | MIT | Doc PR | - Assuming `@jderusse`'s [solution](#41443 (comment)) in #41443 is the best way to add custom session bags by a 3rd party bundle, there should really be a `SessionFactoryInterface` to make decorating the `SessionFactory` easier. Commits ------- 2079eb5 add SessionFactoryInterface
2 parents d2e2fd4 + 2079eb5 commit fcd3a0c

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

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

Lines 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;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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 Kevin Bond <kevinbond@gmail.com>
16+
*/
17+
interface SessionFactoryInterface
18+
{
19+
public function createSession(): SessionInterface;
20+
}

0 commit comments

Comments
 (0)
0