Skip to content

Commit eab3de4

Browse files
Merge branch '3.0'
* 3.0: (31 commits) Drop hirak/prestissimo [MonologBridge] Uninstallable together with symfony/http-kernel in 3.0.6 bumped Symfony version to 3.0.7 updated VERSION for 3.0.6 updated CHANGELOG for 3.0.6 bumped Symfony version to 2.8.7 updated VERSION for 2.8.6 updated CHANGELOG for 2.8.6 bumped Symfony version to 2.7.14 updated VERSION for 2.7.13 updated CHANGELOG for 2.7.13 bumped Symfony version to 2.3.42 [Debug] Fix fatal error handlers on PHP 7 updated VERSION for 2.3.41 update CONTRIBUTORS for 2.3.41 updated CHANGELOG for 2.3.41 fixed bad merge Fixed issue with blank password with Ldap limited the maximum length of a submitted username [2.3][Component/Security] Fixed phpdoc in AnonymousToken constructor for user param ... Conflicts: src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php src/Symfony/Component/HttpKernel/Kernel.php
2 parents 0de12bd + b2f4d40 commit eab3de4

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

Compiler/ResolveDefinitionTemplatesPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private function resolveDefinition(ContainerBuilder $container, DefinitionDecora
156156
if (null === $decoratedService) {
157157
$def->setDecoratedService($decoratedService);
158158
} else {
159-
$def->setDecoratedService($decoratedService[0], $decoratedService[1]);
159+
$def->setDecoratedService($decoratedService[0], $decoratedService[1], $decoratedService[2]);
160160
}
161161
}
162162

Loader/XmlFileLoader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ private function processAnonymousServices(\DOMDocument $xml, $file)
294294
if ($services = $this->getChildren($node, 'service')) {
295295
$definitions[$id] = array($services[0], $file, false);
296296
$services[0]->setAttribute('id', $id);
297+
298+
// anonymous services are always private
299+
// we could not use the constant false here, because of XML parsing
300+
$services[0]->setAttribute('public', 'false');
297301
}
298302
}
299303
}
@@ -311,10 +315,6 @@ private function processAnonymousServices(\DOMDocument $xml, $file)
311315
// resolve definitions
312316
krsort($definitions);
313317
foreach ($definitions as $id => list($domElement, $file, $wild)) {
314-
// anonymous services are always private
315-
// we could not use the constant false here, because of XML parsing
316-
$domElement->setAttribute('public', 'false');
317-
318318
if (null !== $definition = $this->parseDefinition($domElement, $file)) {
319319
$this->container->setDefinition($id, $definition);
320320
}

Tests/Compiler/ResolveDefinitionTemplatesPassTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,12 @@ public function testSetDecoratedServiceOnServiceHasParent()
253253
$container->register('parent', 'stdClass');
254254

255255
$container->setDefinition('child1', new DefinitionDecorator('parent'))
256-
->setDecoratedService('foo', 'foo_inner')
256+
->setDecoratedService('foo', 'foo_inner', 5)
257257
;
258258

259-
$this->assertEquals(array('foo', 'foo_inner', 0), $container->getDefinition('child1')->getDecoratedService());
259+
$this->process($container);
260+
261+
$this->assertEquals(array('foo', 'foo_inner', 5), $container->getDefinition('child1')->getDecoratedService());
260262
}
261263

262264
public function testDecoratedServiceCopiesDeprecatedStatusFromParent()

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)