Skip to content

Commit db1c487

Browse files
committed
[FrameworkBundle] framework.annotations default should be true only if doctrine/annotations is installed
1 parent 8d80628 commit db1c487

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

DependencyInjection/Configuration.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
1313

14+
use Doctrine\Common\Annotations\Annotation;
1415
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
1516
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
1617
use Symfony\Component\Config\Definition\ConfigurationInterface;
@@ -602,7 +603,7 @@ private function addAnnotationsSection(ArrayNodeDefinition $rootNode)
602603
->children()
603604
->arrayNode('annotations')
604605
->info('annotation configuration')
605-
->canBeDisabled()
606+
->{class_exists(Annotation::class) ? 'canBeDisabled' : 'canBeEnabled'}()
606607
->children()
607608
->scalarNode('cache')->defaultValue('php_array')->end()
608609
->scalarNode('file_cache_dir')->defaultValue('%kernel.cache_dir%/annotations')->end()

0 commit comments

Comments
 (0)