From fad9a8d382be6ca12bc1645f069a5552b3c465e2 Mon Sep 17 00:00:00 2001 From: Yoshida Masaaki Date: Mon, 11 Jul 2022 16:16:50 +0900 Subject: [PATCH 1/2] update composer.json --- composer.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index d35d2fe..3340db1 100644 --- a/composer.json +++ b/composer.json @@ -12,19 +12,19 @@ ], "require": { "php": ">=5.5.9", - "symfony/config": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "~2.8|~3.0|~4.0", - "symfony/framework-bundle": "~2.8|~3.0|~4.0", - "symfony/http-foundation": "~2.8|~3.0|~4.0", - "symfony/http-kernel": "~2.8|~3.0|~4.0", - "symfony/routing": "~2.8|~3.0|~4.0" + "symfony/config": "~4.0|~5.0", + "symfony/dependency-injection": "~4.0|~5.0", + "symfony/framework-bundle": "~4.0|~5.0", + "symfony/http-foundation": "~4.0|~5.0", + "symfony/http-kernel": "~4.0|~5.0", + "symfony/routing": "~4.0|~5.0" }, "require-dev": { "phpunit/phpunit": "~4.0", - "symfony/asset": "~2.8|~3.0|~4.0", - "symfony/browser-kit": "~2.8|~3.0|~4.0", - "symfony/filesystem": "~2.8|~3.0|~4.0", - "symfony/http-foundation": "~2.8|~3.0|~4.0" + "symfony/asset": "~4.0|~5.0", + "symfony/browser-kit": "~4.0|~5.0", + "symfony/filesystem": "~4.0|~5.0", + "symfony/http-foundation": "~4.0|~5.0" }, "autoload": { "psr-4": { From 2b381915eab683e2b653d47fb754621a3e619aa7 Mon Sep 17 00:00:00 2001 From: Yoshida Masaaki Date: Mon, 11 Jul 2022 16:31:47 +0900 Subject: [PATCH 2/2] update code to work with Symfony 5 --- src/DependencyInjection/Configuration.php | 4 ++-- src/EventListener/SessionConfigurationListener.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 8c6a51d..e6df1c2 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -22,8 +22,8 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - $treeBuilder->root('phpmentors_session_configuration'); + $treeBuilder = new TreeBuilder('phpmentors_session_configuration'); + $treeBuilder->getRootNode(); return $treeBuilder; } diff --git a/src/EventListener/SessionConfigurationListener.php b/src/EventListener/SessionConfigurationListener.php index 3188168..45e3b6f 100644 --- a/src/EventListener/SessionConfigurationListener.php +++ b/src/EventListener/SessionConfigurationListener.php @@ -15,7 +15,7 @@ use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface; -use Symfony\Component\HttpKernel\Event\GetResponseEvent; +use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\Routing\RouterInterface; class SessionConfigurationListener @@ -41,9 +41,9 @@ public function __construct(RouterInterface $router, SessionStorageInterface $se } /** - * @param GetResponseEvent $event + * @param RequestEvent $event */ - public function onKernelRequest(GetResponseEvent $event) + public function onKernelRequest(RequestEvent $event) { if ($this->sessionStorage === null) { return;