Skip to content

Commit c0651c9

Browse files
Merge branch '5.3' into 5.4
* 5.3: [FrameworkBundle] Fix default PHP attributes support in validation and serializer configuration when doctrine/annotations is not installed with PHP 8
2 parents 51490f5 + c3275d9 commit c0651c9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

DependencyInjection/Configuration.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ private function addValidationSection(ArrayNodeDefinition $rootNode, callable $e
884884
->{$enableIfStandalone('symfony/validator', Validation::class)}()
885885
->children()
886886
->scalarNode('cache')->end()
887-
->booleanNode('enable_annotations')->{!class_exists(FullStack::class) && $willBeAvailable('doctrine/annotations', Annotation::class, 'symfony/validator') ? 'defaultTrue' : 'defaultFalse'}()->end()
887+
->booleanNode('enable_annotations')->{!class_exists(FullStack::class) && (\PHP_VERSION_ID >= 80000 || $willBeAvailable('doctrine/annotations', Annotation::class, 'symfony/validator')) ? 'defaultTrue' : 'defaultFalse'}()->end()
888888
->arrayNode('static_method')
889889
->defaultValue(['loadValidatorMetadata'])
890890
->prototype('scalar')->end()
@@ -967,8 +967,8 @@ private function addValidationSection(ArrayNodeDefinition $rootNode, callable $e
967967

968968
private function addAnnotationsSection(ArrayNodeDefinition $rootNode, callable $willBeAvailable)
969969
{
970-
$doctrineCache = $willBeAvailable('doctrine/cache', Cache::class, 'doctrine/annotation');
971-
$psr6Cache = $willBeAvailable('symfony/cache', PsrCachedReader::class, 'doctrine/annotation');
970+
$doctrineCache = $willBeAvailable('doctrine/cache', Cache::class, 'doctrine/annotations');
971+
$psr6Cache = $willBeAvailable('symfony/cache', PsrCachedReader::class, 'doctrine/annotations');
972972

973973
$rootNode
974974
->children()
@@ -993,7 +993,7 @@ private function addSerializerSection(ArrayNodeDefinition $rootNode, callable $e
993993
->info('serializer configuration')
994994
->{$enableIfStandalone('symfony/serializer', Serializer::class)}()
995995
->children()
996-
->booleanNode('enable_annotations')->{!class_exists(FullStack::class) && $willBeAvailable('doctrine/annotations', Annotation::class, 'symfony/serializer') ? 'defaultTrue' : 'defaultFalse'}()->end()
996+
->booleanNode('enable_annotations')->{!class_exists(FullStack::class) && (\PHP_VERSION_ID >= 80000 || $willBeAvailable('doctrine/annotations', Annotation::class, 'symfony/serializer')) ? 'defaultTrue' : 'defaultFalse'}()->end()
997997
->scalarNode('name_converter')->end()
998998
->scalarNode('circular_reference_handler')->end()
999999
->scalarNode('max_depth_handler')->end()

0 commit comments

Comments
 (0)