symfony/symfony — pull request #12593 by kbond (2014-11-28 14:29:39+00:00)
Title: [ExpressionLanguage] Simplify use of by adding expression contexts

| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | *TODO*

I find the ExpressionLanguage awkward to use. You define your functions in one place and your variables in another. This PR adds the ability to implement an `ExpressionContextInterface` so you can define your functions and variables in one place. Making the `compile` and `parse` functions static allows you to pre-parse/pre-compile your expressions without instantiating the class and its possible dependencies.