symfony/symfony — pull request #12393 by boekkooi (2014-11-03 12:13:52+00:00)
Title: Di factory inline patch

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes (except for Symfony\Component\DependencyInjection\Tests\Dumper\PhpDumperTest::testAddService but this is not related to the PR)
| Fixed tickets | -
| License | MIT
| Doc PR | -

While working with the DI I encountered a `You have requested a non-existent service "xxxxx"` exception.
After some research it seems that this problem has 2 reasons:
1. When the InlineServiceDefinitionsPass inlined a private factory that referenced to another factory it was not added to the graph.
2. Once this was fixed it seems that InlineServiceDefinitionsPass made sure the factory was still inlined. So I have added a check that if the service to be inlined is a factory and is used more than once it won't inline.

I'm not 100% sure that the InlineServiceDefinitionsPass fix is the best way to do this let me know if someone has a better idea.