symfony/symfony — pull request #8488 by endroid (2013-07-13 22:06:41+00:00)
Title: Add container aware trait

| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | will create one if merged

This trait can be used inside a class to make it container aware. As it is not always possible to extend the abstract ContainerAware class, the code for creating a container aware class is usually copied over and over (most of the time unchanged), resulting in a lot of redundant code in your project. As my projects are PHP 5.4 based nowadays, I would like to be able to use a trait in these scenarios to improve my workflow.