8000 [HttpKernel] "controller.service_arguments" services should be public by nicolas-grekas · Pull Request #24126 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpKernel] "controller.service_arguments" services should be public #24126

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
Sep 7, 2017
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
[HttpKernel] "controller.service_arguments" services should be public
  • Loading branch information
nicolas-grekas committed Sep 7, 2017
commit b9c6928d7e3070d6ae07c55505ac7f333f82d98c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function process(ContainerBuilder $container)

foreach ($container->findTaggedServiceIds($this->controllerTag, true) as $id => $tags) {
$def = $container->getDefinition($id);
$def->setPublic(true);
$class = $def->getClass();
$autowire = $def->isAutowired();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,21 @@ public function testArgumentWithNoTypeHintIsOk()
$locator = $container->getDefinition((string) $resolver->getArgument(0))->getArgument(0);
$this->assertEmpty(array_keys($locator));
}

public function testControllersAreMadePublic()
{
$container = new ContainerBuilder();
$resolver = $container->register('argument_resolver.service')->addArgument(array());

$container->register('foo', ArgumentWithoutTypeController::class)
->setPublic(false)
->addTag('controller.service_arguments');

$pass = new RegisterControllerArgumentLocatorsPass();
$pass->process($container);

$this->assertTrue($container->getDefinition('foo')->isPublic());
}
}

class RegisterTestController
Expand Down
0