Skip to content

Commit 5af2cf5

Browse files
committed
📦 Make bundle compatible with Symfony 7
1 parent e7cbdd1 commit 5af2cf5

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

DependencyInjection/Configuration.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88

99
class Configuration implements ConfigurationInterface
1010
{
11-
/**
12-
* @return TreeBuilder
13-
*/
14-
public function getConfigTreeBuilder()
11+
public function getConfigTreeBuilder(): TreeBuilder
1512
{
1613
$treeBuilder = new TreeBuilder('graphqlite');
1714
$rootNode = $treeBuilder->getRootNode();

Tests/GraphQLiteTestingKernel.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
namespace TheCodingMachine\GraphQLite\Bundle\Tests;
55

66

7+
use Composer\InstalledVersions;
8+
use Composer\Semver\VersionParser;
79
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
810
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
911
use Symfony\Bundle\SecurityBundle\SecurityBundle;
@@ -118,8 +120,12 @@ public function configureContainer(ContainerBuilder $c, LoaderInterface $loader)
118120

119121
$container->loadFromExtension('framework', $frameworkConf);
120122
if ($this->enableSecurity) {
121-
$container->loadFromExtension('security', array(
122-
'enable_authenticator_manager' => true,
123+
$extraConfig = [];
124+
if (InstalledVersions::satisfies(new VersionParser(), 'symfony/security-bundle', '< 7.0.0')) {
125+
$extraConfig['enable_authenticator_manager'] = true;
126+
}
127+
128+
$container->loadFromExtension('security', array_merge(array(
123129
'providers' => [
124130
'in_memory' => [
125131
'memory' => [
@@ -150,7 +156,7 @@ public function configureContainer(ContainerBuilder $c, LoaderInterface $loader)
150156
'password_hashers' => [
151157
InMemoryUser::class => 'plaintext',
152158
],
153-
));
159+
), $extraConfig));
154160
}
155161

156162
$graphqliteConf = array(

composer.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,27 @@
2020
"ext-json": "*",
2121
"thecodingmachine/graphqlite" : "^6.0",
2222
"thecodingmachine/graphqlite-symfony-validator-bridge" : "^6.0",
23-
"symfony/config": "^6",
24-
"symfony/framework-bundle": "^6",
25-
"symfony/validator": "^6",
26-
"symfony/translation": "^6",
23+
"symfony/config": "^6 || ^7",
24+
"symfony/console": "^6 || ^7",
25+
"symfony/framework-bundle": "^6 || ^7",
26+
"symfony/validator": "^6 || ^7",
27+
"symfony/translation": "^6 || ^7",
2728
"doctrine/annotations": "^1.13 || ^2.0.1",
2829
"symfony/psr-http-message-bridge": "^2.0",
2930
"nyholm/psr7": "^1.1",
3031
"laminas/laminas-diactoros": "^2.2.2",
3132
"overblog/graphiql-bundle": "^0.2 || ^0.3",
32-
"thecodingmachine/cache-utils": "^1",
33-
"symfony/console": "^6"
33+
"thecodingmachine/cache-utils": "^1"
3434
},
3535
"require-dev": {
36-
"symfony/security-bundle": "^6",
37-
"symfony/yaml": "^6",
36+
"symfony/security-bundle": "^6 || ^7",
37+
"symfony/yaml": "^6 || ^7",
3838
"beberlei/porpaginas": "^1.2 || ^2.0",
3939
"php-coveralls/php-coveralls": "^2.1.0",
4040
"symfony/phpunit-bridge": "^6 || ^7",
4141
"phpstan/phpstan": "^1.8",
42-
"composer/package-versions-deprecated": "^1.8"
42+
"composer/package-versions-deprecated": "^1.8",
43+
"composer/semver": "^3.4"
4344
},
4445
"conflict": {
4546
"mouf/classname-mapper": "<1.0.2",

0 commit comments

Comments
 (0)