Skip to content

Commit f5c257d

Browse files
authored
feat(symfony): convert routing files to php-dsl (#7463)
1 parent 7a9348e commit f5c257d

File tree

15 files changed

+172
-105
lines changed

15 files changed

+172
-105
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the API Platform project.
5+
*
6+
* (c) Kévin Dunglas <dunglas@gmail.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Symfony\Component\Routing\Loader\Configurator;
15+
16+
return function (RoutingConfigurator $routes) {
17+
$routes->add('api_entrypoint', '/{index}.{_format}')
18+
->controller('api_platform.action.entrypoint')
19+
->methods(['GET', 'HEAD'])
20+
->defaults([
21+
'_format' => null,
22+
'_api_respond' => true,
23+
'index' => 'index',
24+
])
25+
->requirements([
26+
'index' => 'index',
27+
]);
28+
};

src/Symfony/Bundle/Resources/config/routing/api.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the API Platform project.
5+
*
6+
* (c) Kévin Dunglas <dunglas@gmail.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Symfony\Component\Routing\Loader\Configurator;
15+
16+
return function (RoutingConfigurator $routes) {
17+
$routes->add('api_doc', '/docs.{_format}')
18+
->controller('api_platform.action.documentation')
19+
->methods(['GET', 'HEAD'])
20+
->defaults([
21+
'_format' => null,
22+
'_api_respond' => true,
23+
]);
24+
};

src/Symfony/Bundle/Resources/config/routing/docs.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the API Platform project.
5+
*
6+
* (c) Kévin Dunglas <dunglas@gmail.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Symfony\Component\Routing\Loader\Configurator;
15+
16+
return function (RoutingConfigurator $routes) {
17+
$routes->add('api_validation_errors', '/validation_errors/{id}')
18+
->controller('api_platform.action.not_exposed')
19+
->methods(['GET', 'HEAD']);
20+
};

src/Symfony/Bundle/Resources/config/routing/errors.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the API Platform project.
5+
*
6+
* (c) Kévin Dunglas <dunglas@gmail.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Symfony\Component\Routing\Loader\Configurator;
15+
16+
return function (RoutingConfigurator $routes) {
17+
$routes->add('api_genid', '/.well-known/genid/{id}')
18+
->controller('api_platform.action.not_exposed')
19+
->methods(['GET', 'HEAD'])
20+
->defaults([
21+
'_api_respond' => true,
22+
]);
23+
};

src/Symfony/Bundle/Resources/config/routing/genid.xml

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the API Platform project.
5+
*
6+
* (c) Kévin Dunglas <dunglas@gmail.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Symfony\Component\Routing\Loader\Configurator;
15+
16+
return function (RoutingConfigurator $routes) {
17+
$routes->add('api_graphql_graphiql', '/graphql/graphiql')
18+
->controller('api_platform.graphql.action.graphiql')
19+
->methods(['GET', 'HEAD']);
20+
};

src/Symfony/Bundle/Resources/config/routing/graphql/graphiql.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)