@@ -965,11 +965,11 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co
965
965
->replaceArgument (0 , $ config ['default_uri ' ]);
966
966
}
967
967
968
- if ($ this ->annotationsConfigEnabled ) {
968
+ if (\ PHP_VERSION_ID >= 80000 || $ this ->annotationsConfigEnabled ) {
969
969
$ container ->register ('routing.loader.annotation ' , AnnotatedRouteControllerLoader::class)
970
970
->setPublic (false )
971
971
->addTag ('routing.loader ' , ['priority ' => -10 ])
972
- ->addArgument (new Reference ('annotation_reader ' ));
972
+ ->addArgument (new Reference ('annotation_reader ' , ContainerInterface:: NULL_ON_INVALID_REFERENCE ));
973
973
974
974
$ container ->register ('routing.loader.annotation.directory ' , AnnotationDirectoryLoader::class)
975
975
->setPublic (false )
@@ -1564,13 +1564,13 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
1564
1564
1565
1565
$ serializerLoaders = [];
1566
1566
if (isset ($ config ['enable_annotations ' ]) && $ config ['enable_annotations ' ]) {
1567
- if (!$ this ->annotationsConfigEnabled ) {
1567
+ if (\ PHP_VERSION_ID < 80000 && !$ this ->annotationsConfigEnabled ) {
1568
1568
throw new \LogicException ('"enable_annotations" on the serializer cannot be set as Annotations support is disabled. ' );
1569
1569
}
1570
1570
1571
1571
$ annotationLoader = new Definition (
1572
1572
'Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader ' ,
1573
- [new Reference ('annotation_reader ' )]
1573
+ [new Reference ('annotation_reader ' , ContainerInterface:: NULL_ON_INVALID_REFERENCE )]
1574
1574
);
1575
1575
$ annotationLoader ->setPublic (false );
1576
1576
0 commit comments