8000 Merge branch '6.1' into 6.2 · symfony/symfony@a057029 · GitHub
[go: up one dir, main page]

Skip to content

Commit a057029

Browse files
Merge branch '6.1' into 6.2
* 6.1: Fix merge 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 4dde161 + 90164c1 commit a057029

File tree

18 files changed

+63
-41
lines changed
  • Loader
  • Tests/Compiler
  • ErrorHandler/Internal
  • 18 files changed

    +63
    -41
    lines changed

    src/Symfony/Bundle/FrameworkBundle/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($kernel);
    96+
    9697
    if ($container->hasExtension($name)) {
    9798
    return $container->getExtension($name);
    9899
    }

    src/Symfony/Bundle/FrameworkBundle/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) {

    src/Symfony/Bundle/FrameworkBundle/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);

    src/Symfony/Bundle/FrameworkBundle/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'])) {

    src/Symfony/Bundle/FrameworkBundle/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',

    src/Symfony/Bundle/FrameworkBundle/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');

    src/Symfony/Bundle/FrameworkBundle/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([

    src/Symfony/Bundle/FrameworkBundle/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',

    src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/LdapFactoryTrait.php

    Lines changed: 0 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -35,10 +35,6 @@ public function getKey(): string
    3535
    public function createAuthenticator(ContainerBuilder $container, string $firewallName, array $config, string $userProviderId): string
    3636
    {
    3737
    $key = str_replace('-', '_', $this->getKey());
    38-
    if (!class_exists(LdapAuthenticator::class)) {
    39-
    throw new \LogicException(sprintf('The "%s" authenticator requires the "symfony/ldap" package version "5.1" or higher.', $key));
    40-
    }
    41-
    4238
    $authenticatorId = parent::createAuthenticator($container, $firewallName, $config, $userProviderId);
    4339

    4440
    $container->setDefinition('security.listener.'.$key.'.'.$firewallName, new Definition(CheckLdapCredentialsListener::class))

    src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/LoginLinkFactory.php

    Lines changed: 0 additions & 5 deletions
    Original file line numberDiff line numberDiff line change
    @@ -20,7 +20,6 @@
    2020
    use Symfony\Component\DependencyInjection\Reference;
    2121
    use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface;
    2222
    use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
    23-
    use Symfony\Component\Security\Http\LoginLink\LoginLinkHandler;
    2423

    2524
    /**
    2625
    * @internal
    @@ -88,10 +87,6 @@ public function getKey(): string
    8887

    8988
    public function createAuthenticator(ContainerBuilder $container, string $firewallName, array $config, string $userProviderId): string
    9089
    {
    91-
    if (!class_exists(LoginLinkHandler::class)) {
    92-
    throw new \LogicException('Login login link requires symfony/security-http:^5.2.');
    93-
    }
    94-
    9590
    if (!$container->hasDefinition('security.authenticator.login_link')) {
    9691
    $loader = new PhpFileLoader($container, new FileLocator(\dirname(__DIR__).'/../../Resources/config'));
    9792
    $loader->load('security_authenticator_login_link.php');

    0 commit comments

    Comments
     (0)
    0