Skip to content

Commit f310303

Browse files
committed
📦 Migrate routes configuration to the PHP intead of XML
XML is deprecated by the Symfony for 7.4+
1 parent f6e4640 commit f310303

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
graphqlite_bundle:
2-
resource: '@GraphQLiteBundle/Resources/config/routes.xml'
2+
resource: '@GraphQLiteBundle/Resources/config/routes.php'

src/Resources/config/routes.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
4+
use TheCodingMachine\GraphQLite\Bundle\Controller\GraphQLiteController;
5+
6+
return function (RoutingConfigurator $routes): void {
7+
$routes->import(
8+
\sprintf('%s::loadRoutes', GraphQLiteController::class),
9+
'service',
10+
);
11+
};

tests/GraphQLiteTestingKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function configureContainer(ContainerBuilder $c, LoaderInterface $loader)
199199
// Note: typing is disabled because using different classes in Symfony 4 and 5
200200
protected function configureRoutes(/*RoutingConfigurator*/ $routes)
201201
{
202-
$routes->import(__DIR__.'/../src/Resources/config/routes.xml');
202+
$routes->import(__DIR__.'/../src/Resources/config/routes.php');
203203
}
204204

205205
public function getCacheDir(): string

0 commit comments

Comments
 (0)