You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was squashed before being merged into the 5.1-dev branch (closes#32937).
Discussion
----------
[Routing] Deprecate RouteCollectionBuilder
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #32240
| License | MIT
| Doc PR | symfony/symfony-docs#12688
| Recipe PR | symfony/recipes#690
A lot to be done here after the implementation is accepted:
- [x] finish deprecations in the MicroKernelTrait
- [x] deprecate the class
- [x] mention in the CHANGELOG file
- [x] mention in the UPGRADE file
- [x] mark tests as legacy
- [x] add a doc PR
- [x] update the recipe
Ping @Tobion , @nicolas-grekas .
Commits
-------
e641cbd [Routing] Deprecate RouteCollectionBuilder
@trigger_error(sprintf('Not overriding the "%s()" method is deprecated since Symfony 5.1 and will trigger a fatal error in 6.0.', __METHOD__), E_USER_DEPRECATED);
54
+
}
34
55
35
56
/**
36
57
* Configures the container.
@@ -91,7 +112,15 @@ public function loadRoutes(LoaderInterface $loader)
91
112
{
92
113
$routes = newRouteCollectionBuilder($loader);
93
114
$this->configureRoutes($routes);
115
+
$collection = $routes->build();
116
+
117
+
if (0 !== \count($collection)) {
118
+
@trigger_error(sprintf('Adding routes via the "%s:configureRoutes()" method is deprecated since Symfony 5.1 and will have no effect in 6.0; use "configureRouting()" instead.', self::class), E_USER_DEPRECATED);
119
+
}
120
+
121
+
$file = (new \ReflectionObject($this))->getFileName();
Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/MicroKernelTraitTest.php
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,18 @@
19
19
20
20
class MicroKernelTraitTest extends TestCase
21
21
{
22
+
/**
23
+
* @group legacy
24
+
* @expectedDeprecation Adding routes via the "Symfony\Bundle\FrameworkBundle\Tests\Kernel\MicroKernelWithConfigureRoutes:configureRoutes()" method is deprecated since Symfony 5.1 and will have no effect in 6.0; use "configureRouting()" instead.
25
+
* @expectedDeprecation Not overriding the "Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait::configureRouting()" method is deprecated since Symfony 5.1 and will trigger a fatal error in 6.0.
0 commit comments