8000 bug #36017 [HttpKernel] Fix support for single-colon syntax for contr… · symfony/symfony@ca41e35 · GitHub
[go: up one dir, main page]

Skip to content

Commit ca41e35

Browse files
committed
bug #36017 [HttpKernel] Fix support for single-colon syntax for controllers (nicolas-grekas)
This PR was merged into the 5.0 branch. Discussion ---------- [HttpKernel] Fix support for single-colon syntax for controllers | Q | A | ------------- | --- | Branch? | master for features / 3.4, 4.4 or 5.0 for bug fixes <!-- see below --> | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #35983 | License | MIT | Doc PR | - This reverts commit 6bb6473, reversing changes made to 4cce23d. As spotted by @stof in #35983 (comment) Commits ------- fbea81c Revert "minor #35559 [FrameworkBundle] remove mention of the old Controller class (nicolas-grekas)"
2 parents 8c778cb + fbea81c commit ca41e35

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public function process(ContainerBuilder $container)
5151
}
5252
}
5353
if (!$reason) {
54+
// see Symfony\Component\HttpKernel\Controller\ContainerControllerResolver
55+
$controllers[$id.':'.$action] = $argumentRef;
56+
5457
if ('__invoke' === $action) {
5558
$controllers[$id] = $argumentRef;
5659
}

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)
0