symfony-cmf/Routing — pull request #34 by Crell (2012-11-23 10:33:06+00:00)
Title: [WiP] Route filters

This is an evolution of #30 based on the discussion there. I wanted to split it off since it's such a dramatic change. It's still not complete, and the coding style is a horrifying mix of Drupal and Symfony, but it gets the idea across. :-)

Changes:
* RouteRepository is now RouteProvider, and includes some changes from #33
* Initial Matcher is gone. NestedMatcher now uses a Route Provider.
* PartialMatchers are now called Route Filters, and are entirely optional.
* FinalMatcherInterface now does nothing but add a setCollection() method. It doesn't inherit from anything.
* There's a new UrlMatcher that subclasses Symfony's and adds FinalMatcherInterface. It also depends on https://github.com/symfony/symfony/pull/6100, which makes it possible to override just the small piece of UrlMatcher that CMF and Drupal care about.
* NestedMatcher handles both Request Matchers and Url Matchers. Ironically, I think we'll all be using the CMF/UrlMatcher. :-)
* I also provided a RouteProvider-backed UrlGenerator and a generic BasicRouter that does the bare minimum to wire the Matcher and Generator together. Again, it supports both Request Matchers and Url Matchers. (I'm totally cool with only allowing Request Matchers, though.)
* NestedMatcher has a single one-line method that Drupal would override to use system_path instead of pathInfo().

I am liking this approach a LOT better. It feels more robust and portable. Still needs feedback, DynamicRouter would need to be updated, and lots of tests.