Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bce287e

Browse files
Revert "minor #35559 [FrameworkBundle] remove mention of the old Controller class (nicolas-grekas)"
This reverts commit 6bb6473, reversing changes made to 4cce23d.
1 parent 8c778cb commit bce287e

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ public function load(array $configs, ContainerBuilder $container)
404404
->addTag('controller.argument_value_resolver');
405405
$container->registerForAutoconfiguration(AbstractController::class)
406406
->addTag('controller.service_arguments');
407+
$container->registerForAutoconfiguration('Symfony\Bundle\FrameworkBundle\Controller\Controller')
408+
->addTag('controller.service_arguments');
407409
$container->registerForAutoconfiguration(DataCollectorInterface::class)
408410
->addTag('data_collector');
409411
$container->registerForAutoconfiguration(FormTypeInterface::class)

src/Symfony/Component/HttpKernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public function process(ContainerBuilder $container)
5151
}
5252
}
5353
if (!$reason) {
54+
$controllers[$id.':'.$action] = $argumentRef;
55+
5456
if ('__invoke' === $action) {
5557
$controllers[$id] = $argumentRef;
5658
}

src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPassTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testProcess()
4949

5050
$controllers = $container->getDefinition((string) $resolver->getArgument(0))->getArgument(0);
5151

52-
$this->assertSame(['c1::fooAction'], array_keys($controllers));
52+
$this->assertSame(['c1::fooAction', 'c1:fooAction'], array_keys($controllers));
5353
$this->assertSame(['bar'], array_keys($container->getDefinition((string) $controllers['c1::fooAction']->getValues()[0])->getArgument(0)));
5454

5555
$expectedLog = [
@@ -73,7 +73,7 @@ public function testInvoke()
7373
(new RemoveEmptyControllerArgumentLocatorsPass())->process($container);
7474

7575
$this->assertEquals(
76-
['invokable::__invoke', 'invokable'],
76+
['invokable::__invoke', 'invokable:__invoke', 'invokable'],
7777
array_keys($container->getDefinition((string) $resolver->getArgument(0))->getArgument(0))
7878
);
7979
}

0 commit comments

Comments
 (0)