Skip to content

Commit b2f4d40

Browse files
committed
Merge branch '2.8' into 3.0
* 2.8: [2.3][Component/Security] Fixed phpdoc in AnonymousToken constructor for user param prevent calling get() for service_container service call get() after the container was compiled Fixed readme of OptionsResolver top-level anonymous services must be public [DependencyInjection] Suggest ExpressionLanguage in composer.json added a conflict between Monolog bridge 2.8 and HTTP Kernel 3.0+
2 parents df8ebe7 + bd04588 commit b2f4d40

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Loader/XmlFileLoader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,10 @@ private function processAnonymousServices(\DOMDocument $xml, $file)
292292
if ($services = $this->getChildren($node, 'service')) {
293293
$definitions[$id] = array($services[0], $file, false);
294294
$services[0]->setAttribute('id', $id);
295+
296+
// anonymous services are always private
297+
// we could not use the constant false here, because of XML parsing
298+
$services[0]->setAttribute('public', 'false');
295299
}
296300
}
297301
}
@@ -309,10 +313,6 @@ private function processAnonymousServices(\DOMDocument $xml, $file)
309313
// resolve definitions
310314
krsort($definitions);
311315
foreach ($definitions as $id => list($domElement, $file, $wild)) {
312-
// anonymous services are always private
313-
// we could not use the constant false here, because of XML parsing
314-
$domElement->setAttribute('public', 'false');
315-
316316
if (null !== $definition = $this->parseDefinition($domElement, $file)) {
317317
$this->container->setDefinition($id, $definition);
318318
}

Tests/Loader/XmlFileLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public function testLoadAnonymousServices()
200200
$service = $container->getDefinition($id);
201201
}
202202
$this->assertEquals('BizClass', $service->getClass(), '->load() uses the same configuration as for the anonymous ones');
203-
$this->assertFalse($service->isPublic());
203+
$this->assertTrue($service->isPublic());
204204

205205
// anonymous services are shared when using decoration definitions
206206
$container->compile();

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"suggest": {
2727
"symfony/yaml": "",
2828
"symfony/config": "",
29+
"symfony/expression-language": "For using expressions in service container configuration",
2930
"symfony/proxy-manager-bridge": "Generate service proxies to lazy load them"
3031
},
3132
"autoload": {

0 commit comments

Comments
 (0)