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 3e209c3

Browse filesBrowse files
[HttpKernel] Fix advertizing deprecations for *TestSessionListener
1 parent 4ae613e commit 3e209c3
Copy full SHA for 3e209c3

File tree

Expand file treeCollapse file tree

4 files changed

+8
-13
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+8
-13
lines changed

‎UPGRADE-5.4.md

Copy file name to clipboardExpand all lines: UPGRADE-5.4.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ FrameworkBundle
4343
HttpKernel
4444
----------
4545

46-
* Deprecate `AbstractTestSessionListener::getSession` inject a session in the request instead
46+
* Deprecate `AbstractTestSessionListener` and `TestSessionListener`, use `AbstractSessionListener` and `SessionListener` instead
4747

4848
HttpFoundation
4949
--------------

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

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

77
* Add the ability to enable the profiler using a request query parameter, body parameter or attribute
8-
* Deprecate `AbstractTestSessionListener::getSession` inject a session in the request instead
8+
* Deprecate `AbstractTestSessionListener` and `TestSessionListener`, use `AbstractSessionListener` and `SessionListener` instead
99
* Deprecate the `fileLinkFormat` parameter of `DebugHandlersListener`
1010
* Add support for configuring log level, and status code by exception class
1111
* Allow ignoring "kernel.reset" methods that don't exist with "on_invalid" attribute

‎src/Symfony/Component/HttpKernel/EventListener/AbstractTestSessionListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/EventListener/AbstractTestSessionListener.php
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
use Symfony\Component\HttpKernel\Event\ResponseEvent;
2020
use Symfony\Component\HttpKernel\KernelEvents;
2121

22+
trigger_deprecation('symfony/http-kernel', '5.4', '"%s" is deprecated use "%s" instead.', AbstractTestSessionListener::class, AbstractSessionListener::class);
23+
2224
/**
2325
* TestSessionListener.
2426
*
@@ -29,7 +31,7 @@
2931
*
3032
* @internal
3133
*
32-
* @deprecated the TestSessionListener use the default SessionListener instead
34+
* @deprecated since Symfony 5.4, use AbstractSessionListener instead
3335
*/
3436
abstract class AbstractTestSessionListener implements EventSubscriberInterface
3537
{
@@ -39,8 +41,6 @@ abstract class AbstractTestSessionListener implements EventSubscriberInterface
3941
public function __construct(array $sessionOptions = [])
4042
{
4143
$this->sessionOptions = $sessionOptions;
42-
43-
trigger_deprecation('symfony/http-kernel', '5.4', 'The %s is deprecated use the %s instead.', __CLASS__, AbstractSessionListener::class);
4444
}
4545

4646
public function onKernelRequest(RequestEvent $event)
@@ -114,8 +114,6 @@ public static function getSubscribedEvents(): array
114114
/**
115115
* Gets the session object.
116116
*
117-
* @deprecated since Symfony 5.4, will be removed in 6.0.
118-
*
119117
* @return SessionInterface|null
120118
*/
121119
abstract protected function getSession();

‎src/Symfony/Component/HttpKernel/EventListener/TestSessionListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/EventListener/TestSessionListener.php
+3-6Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
use Psr\Container\ContainerInterface;
1515
use Symfony\Component\HttpFoundation\Session\SessionInterface;
1616

17+
trigger_deprecation('symfony/http-kernel', '5.4', '"%s" is deprecated, use "%s" instead.', TestSessionListener::class, SessionListener::class);
18+
1719
/**
1820
* Sets the session in the request.
1921
*
2022
* @author Fabien Potencier <fabien@symfony.com>
2123
*
2224
* @final
2325
*
24-
* @deprecated the TestSessionListener use the default SessionListener instead
26+
* @deprecated since Symfony 5.4, use SessionListener instead
2527
*/
2628
class TestSessionListener extends AbstractTestSessionListener
2729
{
@@ -33,13 +35,8 @@ public function __construct(ContainerInterface $container, array $sessionOptions
3335
parent::__construct($sessionOptions);
3436
}
3537

36-
/**
37-
* @deprecated since Symfony 5.4, will be removed in 6.0.
38-
*/
3938
protected function getSession(): ?SessionInterface
4039
{
41-
trigger_deprecation('symfony/http-kernel', '5.4', '"%s" is deprecated and will be removed in 6.0, inject a session in the request instead.', __METHOD__);
42-
4340
if ($this->container->has('session')) {
4441
return $this->container->get('session');
4542
}

0 commit comments

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