Skip to content

Commit d1985c2

Browse files
authored
Fix deprecation for Symfony 5.3 (#34)
1 parent 32c84e2 commit d1985c2

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/AppKernel.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Nyholm\BundleTest;
44

5+
use Symfony\Bundle\FrameworkBundle\CacheWarmer\ConfigBuilderCacheWarmer;
56
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
67
use Symfony\Component\Config\Loader\LoaderInterface;
78
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
@@ -52,7 +53,13 @@ public function __construct($cachePrefix)
5253
parent::__construct($cachePrefix, true);
5354
$this->cachePrefix = $cachePrefix;
5455
$this->addBundle(FrameworkBundle::class);
56+
5557
$this->addConfigFile(__DIR__.'/config/framework.yml');
58+
if (class_exists(ConfigBuilderCacheWarmer::class)) {
59+
$this->addConfigFile(__DIR__.'/config/framework-53.yml');
60+
} else {
61+
$this->addConfigFile(__DIR__.'/config/framework-52.yml');
62+
}
5663
}
5764

5865
/**

src/config/framework-52.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
framework:
2+
session:
3+
storage_id: session.storage.mock_file

src/config/framework-53.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
framework:
2+
session:
3+
storage_factory_id: session.storage.factory.native

0 commit comments

Comments
 (0)