This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component
Fabien Potencier 15ed486ea1 bug #24822 [DI] Fix "almost-circular" dependencies handling (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Fix "almost-circular" dependencies handling

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #19362, #24775
| License       | MIT
| Doc PR        | -

In a situation like the following one, we used to trigger a circular reference exception. But this was a false positive, as the reference is resolvable without hitting the circle. Fixing this exception could be considered as a new feature (because no existing config needs it, since it fails). But for 3.4, this should be considered a bug fix, as reported in #24775: not handling this situation now means creating broken service trees.

``` php
$containerBuilder = new ContainerBuilder();

$container->register('foo', FooCircular::class)->setPublic(true)
   ->addArgument(new Reference('bar'));

$container->register('bar', BarCircular::class)
    ->addMethodCall('addFoobar', array(new Reference('foobar')));

$container->register('foobar', FoobarCircular::class)
    ->addArgument(new Reference('foo'));

$foo = $containerBuilder->get('foo');
```

Commits
-------

beb4df712c [DI] Fix "almost-circular" dependencies handling
2017-11-05 07:38:28 -08:00
..
Asset Merge branch '3.3' into 3.4 2017-10-24 16:12:06 +02:00
BrowserKit Merge branch '3.3' into 3.4 2017-10-28 18:49:05 +02:00
Cache Merge branch '3.3' into 3.4 2017-10-31 08:19:40 -07:00
ClassLoader Merge branch '3.3' into 3.4 2017-10-24 16:12:06 +02:00
Config [FrameworkBundle][Config] fix: do not add resource checkers for debug=false 2017-11-05 14:56:21 +01:00
Console Merge branch '3.3' into 3.4 2017-10-24 16:40:29 +02:00
CssSelector Merge branch '3.3' into 3.4 2017-10-24 16:12:06 +02:00
Debug Merge branch '3.3' into 3.4 2017-10-24 16:12:06 +02:00
DependencyInjection [DI] Fix "almost-circular" dependencies handling 2017-11-05 13:06:25 +01:00
DomCrawler Merge branch '3.3' into 3.4 2017-10-28 18:49:05 +02:00
Dotenv Merge branch '3.3' into 3.4 2017-09-06 21:03:12 +02:00
EventDispatcher Merge branch '3.3' into 3.4 2017-10-24 16:12:06 +02:00
ExpressionLanguage Merge branch '3.3' into 3.4 2017-10-24 16:12:06 +02:00
Filesystem fix version in changelog 2017-10-03 15:54:22 +02:00
Finder Merge branch '3.3' into 3.4 2017-10-24 16:12:06 +02:00
Form [Bridge\Twig] fix bootstrap checkbox_row to render properly & remove spaceless 2017-10-30 12:07:24 -07:00
HttpFoundation Merge branch '3.3' into 3.4 2017-10-31 08:19:40 -07:00
HttpKernel [HttpKernel] Let the storage manage the session starts 2017-11-01 20:21:07 -07:00
Inflector Merge branch '3.3' into 3.4 2017-08-03 11:34:20 +02:00
Intl Merge branch '3.3' into 3.4 2017-10-24 16:12:06 +02:00
Ldap Merge branch '2.7' into 2.8 2017-10-01 23:00:16 +02:00
Lock feature #22132 [Lock] Automaticaly release lock when user forget it (jderusse) 2017-10-01 11:03:21 -07:00
OptionsResolver Support array of types in allowed type 2017-10-12 18:27:27 +02:00
Process Merge branch '3.3' into 3.4 2017-10-24 16:12:06 +02:00
PropertyAccess Merge branch '3.3' into 3.4 2017-10-28 18:49:05 +02:00
PropertyInfo Merge branch '3.3' into 3.4 2017-10-20 11:48:32 -07:00
Routing Merge branch '3.3' into 3.4 2017-10-24 16:12:06 +02:00
Security [Guard] remove invalid deprecation notice 2017-10-24 15:52:50 -04:00
Serializer Merge branch '3.3' into 3.4 2017-10-24 16:12:06 +02:00
Stopwatch Merge branch '3.3' into 3.4 2017-10-02 08:49:52 +02:00
Templating Merge branch '3.3' into 3.4 2017-10-24 16:12:06 +02:00
Translation Merge branch '3.3' into 3.4 2017-10-24 16:12:06 +02:00
Validator [Validator] Fix TraceableValidator is reset on data collector instantiation 2017-10-31 17:02:06 +01:00
VarDumper Fix DST 2017-10-30 17:32:34 +10:00
WebLink Merge branch '3.3' into 3.4 2017-09-11 14:23:16 -07:00
Workflow feature #23499 [Workflow] add guard is_valid() method support (alain-flaus, lyrixx) 2017-10-06 08:47:04 -07:00
Yaml Merge branch '3.3' into 3.4 2017-10-09 16:52:13 +02:00