8000 minor #41345 [FrameworkBundle] Return early (derrabus) · symfony/symfony@68224c2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 68224c2

Browse files
committed
minor #41345 [FrameworkBundle] Return early (derrabus)
This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle] Return early | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | #41295 (comment) | License | MIT | Doc PR | N/A Commits ------- b6c8aa5 [FrameworkBundle] Return early
2 parents c995f1c + b6c8aa5 commit 68224c2

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -895,28 +895,30 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co
895895
$container->setParameter('request_listener.http_port', $config['http_port']);
896896
$container->setParameter('request_listener.https_port', $config['https_port']);
897897

898-
if ($this->annotationsConfigEnabled) {
899-
$container->register('routing.loader.annotation', AnnotatedRouteControllerLoader::class)
900-
->setPublic(false)
901-
->addTag('routing.loader', ['priority' => -10])
902-
->addArgument(new Reference('annotation_reader'));
903-
904-
$container->register('routing.loader.annotation.directory', AnnotationDirectoryLoader::class)
905-
->setPublic(false)
906-
->addTag('routing.loader', ['priority' => -10])
907-
->setArguments([
908-
new Reference('file_locator'),
909-
new Reference('routing.loader.annotation'),
910-
]);
911-
912-
$container->register('routing.loader.annotation.file', AnnotationFileLoader::class)
913-
->setPublic(false)
914-
->addTag('routing.loader', ['priority' => -10])
915-
->setArguments([
916-
new Reference('file_locator'),
917-
new Reference('routing.loader.annotation'),
918-
]);
898+
if (!$this->annotationsConfigEnabled) {
899+
return;
919900
}
901+
902+
$container->register('routing.loader.annotation', AnnotatedRouteControllerLoader::class)
903+
->setPublic(false)
904+
->addTag('routing.loader', ['priority' => -10])
905+
->addArgument(new Reference('annotation_reader'));
906+
907+
$container->register('routing.loader.annotation.directory', AnnotationDirectoryLoader::class)
908+
->setPublic(false)
909+
->addTag('routing.loader', ['priority' => -10])
910+
->setArguments([
911+
new Reference('file_locator'),
912+
new Reference('routing.loader.annotation'),
913+
]);
914+
915+
$container->register('routing.loader.annotation.file', AnnotationFileLoader::class)
916+
->setPublic(false)
917+
->addTag('routing.loader', ['priority' => -10])
918+
->setArguments([
919+
new Reference('file_locator'),
920+
new Reference('routing.loader.annotation'),
921+
]);
920922
}
921923

922924
private function registerSessionConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)

0 commit comments

Comments
 (0)
0