Skip to content

Commit 4661c25

Browse files
authored
Merge pull request #227 from andrew-demb/support-symfony-7
Support Symfony 7
2 parents c6f7149 + aa40cfe commit 4661c25

File tree

4 files changed

+26
-21
lines changed

4 files changed

+26
-21
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();

GraphQLiteBundle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public function build(ContainerBuilder $container): void
2121
$container->addCompilerPass(new OverblogGraphiQLEndpointWiringPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -1);
2222
}
2323

24-
public function getContainerExtension(): ?ExtensionInterface
24+
public function getContainerExtension(): ExtensionInterface
2525
{
26-
if (null === $this->extension) {
26+
if (null === $this->extension || false === $this->extension) {
2727
$this->extension = new GraphQLiteExtension();
2828
}
2929

Tests/GraphQLiteTestingKernel.php

Lines changed: 10 additions & 4 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;
@@ -87,7 +89,7 @@ public function __construct(bool $enableSession = true,
8789
public function registerBundles(): iterable
8890
{
8991
$bundles = [ new FrameworkBundle() ];
90-
if (class_exists(SecurityBundle::class)) {
92+
if ($this->enableSecurity && class_exists(SecurityBundle::class)) {
9193
$bundles[] = new SecurityBundle();
9294
}
9395
$bundles[] = new GraphQLiteBundle();
@@ -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: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,27 @@
2020
"ext-json": "*",
2121
"thecodingmachine/graphqlite" : "^6.0",
2222
"thecodingmachine/graphqlite-symfony-validator-bridge" : "^6.0",
23-
"symfony/framework-bundle": "^6",
24-
"symfony/validator": "^6",
25-
"symfony/translation": "^6",
23+
"symfony/config": "^6.4 || ^7",
24+
"symfony/console": "^6.4 || ^7",
25+
"symfony/framework-bundle": "^6.4 || ^7",
26+
"symfony/validator": "^6.4 || ^7",
27+
"symfony/translation": "^6.4 || ^7",
2628
"doctrine/annotations": "^1.13 || ^2.0.1",
27-
"symfony/psr-http-message-bridge": "^2.0",
29+
"symfony/psr-http-message-bridge": "^2.0 || ^7.0",
2830
"nyholm/psr7": "^1.1",
2931
"laminas/laminas-diactoros": "^2.2.2",
30-
"overblog/graphiql-bundle": "^0.2 || ^0.3",
31-
"thecodingmachine/cache-utils": "^1",
32-
"symfony/console": "^6"
32+
"overblog/graphiql-bundle": "^0.2 || ^0.3 || ^1",
33+
"thecodingmachine/cache-utils": "^1"
3334
},
3435
"require-dev": {
35-
"symfony/security-bundle": "^6",
36-
"symfony/yaml": "^6",
36+
"symfony/security-bundle": "^6.4 || ^7",
37+
"symfony/yaml": "^6.4 || ^7",
3738
"beberlei/porpaginas": "^1.2 || ^2.0",
3839
"php-coveralls/php-coveralls": "^2.1.0",
39-
"symfony/phpunit-bridge": "^6 || ^7",
40+
"symfony/phpunit-bridge": "^6.4 || ^7",
4041
"phpstan/phpstan": "^1.8",
41-
"composer/package-versions-deprecated": "^1.8"
42+
"composer/package-versions-deprecated": "^1.8",
43+
"composer/semver": "^3.4"
4244
},
4345
"conflict": {
4446
"mouf/classname-mapper": "<1.0.2",

0 commit comments

Comments
 (0)