symfony/symfony — pull request #12869 by nikita2206 (2014-12-05 16:48:08+00:00)
Title: [WIP] Add support for parameters and service calls in route conditions

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

See http://symfony.com/doc/2.7/book/routing.html#completely-customized-route-matching-with-conditions for reference on route conditions. This feature adds ability to use `parameter()` and `service()` functions in route conditions just like in container configuration.

Although I don't like injecting container in all those places, I'm not aware of better solution. What do you think and/or maybe you have better ideas how to do it?

TODO: fix tests, fix Symfony\Component\Routing\Router compatibility issues - probably it's better to make UrlMatcher unaware of container and instead just use a context array for ExpLang and pass it there (so there's no static coupling from UrlMatcher to Symfony's container)