Skip to content

Commit b6f1667

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: [FrameworkBundle] Return early
2 parents 5b4a695 + 68224c2 commit b6f1667

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
@@ -971,28 +971,30 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co
971971
->replaceArgument(0, $config['default_uri']);
972972
}
973973

974-
if (\PHP_VERSION_ID >= 80000 || $this->annotationsConfigEnabled) {
975-
$container->register('routing.loader.annotation', AnnotatedRouteControllerLoader::class)
976-
->setPublic(false)
977-
->addTag('routing.loader', ['priority' => -10])
978-
->addArgument(new Reference('annotation_reader', ContainerInterface::NULL_ON_INVALID_REFERENCE));
979-
980-
$container->register('routing.loader.annotation.directory', AnnotationDirectoryLoader::class)
981-
->setPublic(false)
982-
->addTag('routing.loader', ['priority' => -10])
983-
->setArguments([
984-
new Reference('file_locator'),
985-
new Reference('routing.loader.annotation'),
986-
]);
987-
988-
$container->register('routing.loader.annotation.file', AnnotationFileLoader::class)
989-
->setPublic(false)
990-
->addTag('routing.loader', ['priority' => -10])
991-
->setArguments([
992-
new Reference('file_locator'),
993-
new Reference('routing.loader.annotation'),
994-
]);
974+
if (\PHP_VERSION_ID < 80000 && !$this->annotationsConfigEnabled) {
975+
return;
995976
}
977+
978+
$container->register('routing.loader.annotation', AnnotatedRouteControllerLoader::class)
979+
->setPublic(false)
980+
->addTag('routing.loader', ['priority' => -10])
981+
->addArgument(new Reference('annotation_reader', ContainerInterface::NULL_ON_INVALID_REFERENCE));
982+
983+
$container->register('routing.loader.annotation.directory', AnnotationDirectoryLoader::class)
984+
->setPublic(false)
985+
->addTag('routing.loader', ['priority' => -10])
986+
->setArguments([
987+
new Reference('file_locator'),
988+
new Reference('routing.loader.annotation'),
989+
]);
990+
991+
$container->register('routing.loader.annotation.file', AnnotationFileLoader::class)
992+
->setPublic(false)
993+
->addTag('routing.loader', ['priority' => -10])
994+
->setArguments([
995+
new Reference('file_locator'),
996+
new Reference('routing.loader.annotation'),
997+
]);
996998
}
997999

9981000
private function registerSessionConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader)

0 commit comments

Comments
 (0)