8000 [DependencyInjection] top-level anonymous services must be public by xabbuh · Pull Request #18709 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DependencyInjection] top-level anonymous services must be public #18709

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
May 6, 2016
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
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ private function processAnonymousServices(SimpleXMLElement $xml, $file)

$definitions[(string) $node['id']] = array($node->service, $file, false);
$node->service['id'] = (string) $node['id'];

// anonymous services are always private
$node->service['public'] = false;
}
}

Expand All @@ -254,9 +257,6 @@ private function processAnonymousServices(SimpleXMLElement $xml, $file)
// resolve definitions
krsort($definitions);
foreach ($definitions as $id => $def) {
// anonymous services are always private
$def[0]['public'] = false;

$this->parseDefinition($id, $def[0], $def[1]);

$oNode = dom_import_simplexml($def[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function testLoadAnonymousServices()
$service = $container->getDefinition($id);
}
$this->assertEquals('BizClass', $service->getClass(), '->load() uses the same configuration as for the anonymous ones');
$this->assertFalse($service->isPublic());
$this->assertTrue($service->isPublic());

// anonymous services are shared when using decoration definitions
$container->compile();
Expand Down
0