[Routing] Deprecate RouteCollectionBuilder#32937
Conversation
src/Symfony/Component/Routing/Loader/Configurator/RoutingConfigurator.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Routing/Loader/Configurator/RoutingConfigurator.php
Outdated
Show resolved
Hide resolved
|
@nicolas-grekas , @Tobion , could you please give me some feedback so that I can move on? |
|
@Tobion would you have time to help move this one forward soonish? Otherwise, I'd suggest to close (and keep the issue open) |
|
@nicolas-grekas , don't close the PR, please. I will have time to make it ready for review soon. At least we'll discuss it at the hack day in Lisbon ;) |
570a239 to
16d5a6d
Compare
|
@nicolas-grekas , ready for review with tests and deprecations! I will finish the CHANGELOG and add the docs once you agree with the implementation. For now I rebased onto master. Do we have any chance to get this in 4.4? Or it's too late? |
|
@nicolas-grekas , fully ready for you review |
nicolas-grekas
left a comment
There was a problem hiding this comment.
I really like the idea! Would be great to do the same for services late on ;)
|
Yes, I already started in the airplane yesterday ;) |
|
@fabpot, thanx, corrected! |
badef1d to
e641cbd
Compare
|
Thank you @vudaltsov. |
…in MicroKernelTrait::configureContainer() (nicolas-grekas) This PR was merged into the 5.1-dev branch. Discussion ---------- [FrameworkBundle] Allow using a ContainerConfigurator in MicroKernelTrait::configureContainer() | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - This PR is a continuation of #32937 (it reverts some parts of it that are not needed anymore). It builds on #34872 for now. This PR allows using the PHP-DSL natively in our `Kernel::configureContainer()` methods. It allows the same in our `Kernel::configureRoutes()` methods. Both signatures are handled gracefully with no deprecations to let existing code in peace: - `protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader);` - `protected function configureContainer(ContainerConfigurator $c);` (a loader is always passed as 2nd arg to ease FC) Same for routes: - `protected function configureRoutes(RoutingConfigurator $routes);` - `protected function configureRoutes(RouteCollectionBuilder $routes);` (this one is deprecated because `RouteCollectionBuilder` is deprecated) Here is my working `src/Kernel.php` after this change: ```php class Kernel extends BaseKernel { use MicroKernelTrait; protected function configureContainer(ContainerConfigurator $container): void { $container->import('../config/{packages}/*.yaml'); $container->import('../config/{packages}/'.$this->environment.'/*.yaml'); $container->import('../config/services.yaml'); $container->import('../config/{services}_'.$this->environment.'.yaml'); } protected function configureRoutes(RoutingConfigurator $routes): void { $routes->import('../config/{routes}/'.$this->environment.'/*.yaml'); $routes->import('../config/{routes}/*.yaml'); $routes->import('../config/routes.yaml'); } } ``` Commits ------- cf45eec [FrameworkBundle] Allow using a ContainerConfigurator in MicroKernelTrait::configureContainer()
A lot to be done here after the implementation is accepted:
Ping @Tobion , @nicolas-grekas .