bug #18491 [DependencyInjection] anonymous services are always private (xabbuh)

This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] anonymous services are always private

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

0a469a4 anonymous services are always private
This commit is contained in:
Nicolas Grekas 2016-04-12 17:22:47 +02:00
commit 689f27b397
1 changed files with 1 additions and 5 deletions

View File

@ -302,11 +302,7 @@ class XmlFileLoader extends FileLoader
// give it a unique name
$id = sprintf('%s_%d', hash('sha256', $file), ++$count);
$node->setAttribute('id', $id);
if ($services = $this->getChildren($node, 'service')) {
$definitions[$id] = array($node, $file, true);
$services[0]->setAttribute('id', $id);
}
$definitions[$id] = array($node, $file, true);
}
}