8000 [HttpKernel] Fix support for single-colon syntax for controllers by nicolas-grekas · Pull Request #36017 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpKernel] Fix support for single-colon syntax for controllers #36017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Revert "minor #35559 [FrameworkBundle] remove mention of the old Cont…
…roller class (nicolas-grekas)"

This reverts commit 6bb6473, reversing
changes made to 4cce23d.
  • Loading branch information
nicolas-grekas committed Mar 10, 2020
commit fbea81c9639bc0ecdaf723004262a9735c6ec310
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public function process(ContainerBuilder $container)
}
}
if (!$reason) {
// see Symfony\Component\HttpKernel\Controller\ContainerControllerResolver
$controllers[$id.':'.$action] = $argumentRef;

if ('__invoke' === $action) {
$controllers[$id] = $argumentRef;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function testProcess()

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

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

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

$this->assertEquals(
['invokable::__invoke', 'invokable'],
['invokable::__invoke', 'invokable:__invoke', 'invokable'],
array_keys($container->getDefinition((string) $resolver->getArgument(0))->getArgument(0))
);
}
Expand Down
0