Skip to content

Commit 3daf503

Browse files
Merge branch '6.0' into 6.1
* 6.0: Fix merge [FrameworkBundle] fix tests [FrameworkBundle] fix wiring of annotations.cached_reader [SecurityBundle] Remove dead `class_exists` checks Fix BC break [DependencyInjection] Ignore unused bindings defined by attribute [ErrorHandler] update tentative types
2 parents ca46587 + 46b9385 commit 3daf503

File tree

8 files changed

+15
-12
lines changed

8 files changed

+15
-12
lines changed

Command/AbstractConfigCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Symfony\Component\Console\Helper\Table;
1717
use Symfony\Component\Console\Output\OutputInterface;
1818
use Symfony\Component\Console\Style\StyleInterface;
19-
use Symfony\Component\DependencyInjection\ContainerBuilder;
2019
use Symfony\Component\DependencyInjection\Extension\ConfigurationExtensionInterface;
2120
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
2221

@@ -55,7 +54,7 @@ protected function listBundles(OutputInterface|StyleInterface $output)
5554
}
5655
}
5756

58-
protected function findExtension(string $name, ContainerBuilder $container): ExtensionInterface
57+
protected function findExtension(string $name): ExtensionInterface
5958
{
6059
$bundles = $this->initializeBundles();
6160
$minScore = \INF;
@@ -93,6 +92,8 @@ protected function findExtension(string $name, ContainerBuilder $container): Ext
9392
}
9493
}
9594

95+
$container = $this->getContainerBuilder();
96+
9697
if ($container->hasExtension($name)) {
9798
return $container->getExtension($name);
9899
}

Command/ConfigDebugCommand.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9090
return 0;
9191
}
9292

93-
$container = $this->compileContainer();
94-
$extension = $this->findExtension($name, $container);
93+
$extension = $this->findExtension($name);
9594
$extensionAlias = $extension->getAlias();
95+
$container = $this->compileContainer();
9696

9797
$config = $this->getConfig($extension, $container);
9898

@@ -192,8 +192,7 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti
192192

193193
if ($input->mustSuggestArgumentValuesFor('path') && null !== $name = $input->getArgument('name')) {
194194
try {
195-
$container = $this->compileContainer();
196-
$config = $this->getConfig($this->findExtension($name, $container), $container);
195+
$config = $this->getConfig($this->findExtension($name), $this->compileContainer());
197196
$paths = array_keys(self::buildPathsCompletion($config));
198197
$suggestions->suggestValues($paths);
199198
} catch (LogicException) {

Command/ConfigDumpReferenceCommand.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
103103
return 0;
104104
}
105105

106-
$container = $this->getContainerBuilder($this->getApplication()->getKernel());
107-
$extension = $this->findExtension($name, $container);
106+
$extension = $this->findExtension($name);
108107

109108
if ($extension instanceof ConfigurationInterface) {
110109
$configuration = $extension;
111110
} else {
112-
$configuration = $extension->getConfiguration([], $container);
111+
$configuration = $extension->getConfiguration([], $this->getContainerBuilder($this->getApplication()->getKernel()));
113112
}
114113

115114
$this->validateConfiguration($extension, $configuration);

DependencyInjection/Compiler/AddAnnotationsCachedReaderPass.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public function process(ContainerBuilder $container)
2929
// "annotation_reader" at build time don't get any cache
3030
foreach ($container->findTaggedServiceIds('annotations.cached_reader') as $id => $tags) {
3131
$reader = $container->getDefinition($id);
32-
$reader->setPublic(false);
3332
$properties = $reader->getProperties();
3433

3534
if (isset($properties['cacheProviderBackup'])) {

DependencyInjection/Compiler/UnusedTagsPass.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class UnusedTagsPass implements CompilerPassInterface
3131
'chatter.transport_factory',
3232
'config_cache.resource_checker',
3333
'console.command',
34+
'container.do_not_inline',
3435
'container.env_var_loader',
3536
'container.env_var_processor',
3637
'container.hot_path',

DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,8 @@ public function load(array $configs, ContainerBuilder $container)
675675
->addTag('routing.route_loader');
676676

677677
$container->setParameter('container.behavior_describing_tags', [
678+
'annotations.cached_reader',
679+
'container.do_not_inline',
678680
'container.service_locator',
679681
'container.service_subscriber',
680682
'kernel.event_subscriber',
@@ -1657,11 +1659,9 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde
16571659

16581660
$container
16591661
->getDefinition('annotations.cached_reader')
1660-
->setPublic(true) // set to false in AddAnnotationsCachedReaderPass
16611662
->replaceArgument(2, $config['debug'])
16621663
// reference the cache provider without using it until AddAnnotationsCachedReaderPass runs
16631664
->addArgument(new ServiceClosureArgument(new Reference($cacheService)))
1664-
->addTag('annotations.cached_reader')
16651665
;
16661666

16671667
$container->setAlias('annotation_reader', 'annotations.cached_reader');

Resources/config/annotations.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
inline_service(ArrayAdapter::class),
3838
abstract_arg('Debug-Flag'),
3939
])
40+
->tag('annotations.cached_reader')
41+
->tag('container.do_not_inline')
4042

4143
->set('annotations.filesystem_cache_adapter', FilesystemAdapter::class)
4244
->args([

Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,6 +1947,8 @@ public function testRegisterParameterCollectingBehaviorDescribingTags()
19471947

19481948
$this->assertTrue($container->hasParameter('container.behavior_describing_tags'));
19491949
$this->assertEquals([
1950+
'annotations.cached_reader',
1951+
'container.do_not_inline',
19501952
'container.service_locator',
19511953
'container.service_subscriber',
19521954
'kernel.event_subscriber',

0 commit comments

Comments
 (0)