Skip to content

Commit 985ebee

Browse files
Merge branch '3.4' into 4.1
* 3.4: Fix CS Allow reuse of Session between requests [MonologBridge] Re-add option option to ignore empty context and extra data [Lock] remove useless code [PhpUnitBridge] fix disabling DeprecationErrorHandler using phpunit.xml file Provide debug_backtrace with proper args [DI] fix infinite loop involving self-references in decorated services forward false label option to nested types forward the invalid_message option in date types
2 parents a6c4efa + edfb30a commit 985ebee

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

Compiler/AnalyzeServiceReferencesPass.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ protected function processValue($value, $isRoot = false)
113113
return $value;
114114
}
115115
$this->currentDefinition = $value;
116+
} elseif ($this->currentDefinition === $value) {
117+
return $value;
116118
}
117119
$this->lazy = false;
118120

Tests/ContainerBuilderTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,22 @@ public function testErroredDefinition()
14761476

14771477
$container->get('errored_definition');
14781478
}
1479+
1480+
public function testDecoratedSelfReferenceInvolvingPrivateServices()
1481+
{
1482+
$container = new ContainerBuilder();
1483+
$container->register('foo', 'stdClass')
1484+
->setPublic(false)
1485+
->setProperty('bar', new Reference('foo'));
1486+
$container->register('baz', 'stdClass')
1487+
->setPublic(false)
1488+
->setProperty('inner', new Reference('baz.inner'))
1489+
->setDecoratedService('foo');
1490+
1491+
$container->compile();
1492+
1493+
$this->assertSame(array('service_container'), array_keys($container->getDefinitions()));
1494+
}
14791495
}
14801496

14811497
class FooClass

Tests/Dumper/PhpDumperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,8 @@ public function testResolvedBase64EnvParameters()
392392
$container->compile(true);
393393

394394
$expected = array(
395-
'env(foo)' => 'd29ybGQ=',
396-
'hello' => 'world',
395+
'env(foo)' => 'd29ybGQ=',
396+
'hello' => 'world',
397397
);
398398
$this->assertSame($expected, $container->getParameterBag()->all());
399399
}

0 commit comments

Comments
 (0)