|
172 | 172 | use Symfony\Component\RemoteEvent\Attribute\AsRemoteEventConsumer; |
173 | 173 | use Symfony\Component\RemoteEvent\RemoteEvent; |
174 | 174 | use Symfony\Component\Routing\Attribute\Route; |
| 175 | +use Symfony\Component\Routing\Loader\AttributeServicesLoader; |
175 | 176 | use Symfony\Component\Scheduler\Attribute\AsCronTask; |
176 | 177 | use Symfony\Component\Scheduler\Attribute\AsPeriodicTask; |
177 | 178 | use Symfony\Component\Scheduler\Attribute\AsSchedule; |
@@ -768,7 +769,7 @@ public function load(array $configs, ContainerBuilder $container): void |
768 | 769 | $definition->addTag('controller.service_arguments'); |
769 | 770 | }); |
770 | 771 | $container->registerAttributeForAutoconfiguration(Route::class, static function (ChildDefinition $definition, Route $attribute, \ReflectionClass|\ReflectionMethod $reflection): void { |
771 | | - $definition->addTag('controller.service_arguments'); |
| 772 | + $definition->addTag('controller.service_arguments')->addTag('routing.controller'); |
772 | 773 | }); |
773 | 774 | $container->registerAttributeForAutoconfiguration(AsRemoteEventConsumer::class, static function (ChildDefinition $definition, AsRemoteEventConsumer $attribute): void { |
774 | 775 | $definition->addTag('remote_event.consumer', ['consumer' => $attribute->name]); |
@@ -1307,6 +1308,10 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co |
1307 | 1308 |
|
1308 | 1309 | $loader->load('routing.php'); |
1309 | 1310 |
|
| 1311 | + if (!class_exists(AttributeServicesLoader::class)) { |
| 1312 | + $container->removeDefinition('routing.loader.attribute.services'); |
| 1313 | + } |
| 1314 | + |
1310 | 1315 | if ($config['utf8']) { |
1311 | 1316 | $container->getDefinition('routing.loader')->replaceArgument(1, ['utf8' => true]); |
1312 | 1317 | } |
|
0 commit comments