feature #1175 Added factory for RouteCollection, makes subclassing of...
feature #1175 Added factory for RouteCollection, makes subclassing of RouteCollection possible. (lschricke) This PR was merged into the 2.0.x-dev branch. Discussion ---------- Added factory for RouteCollection, makes subclassing of RouteCollection possible. Note: replaces #1174, which was targeting a wrong branch (and where I messed a bit with the commits ;)). -- The aim of this PR is to allow developpers to subclass `Symfony\Component\Routing\RouteCollection` to change some of its behavior. In most of my Silex apps, I figured I don't want the Symfony's `RouteCollection` regular behavior where if you define two routes with the same name (bad copy-paste for instance), the first route added simply gets overriden by the second. Instead, I would like to be able to throw an Exception if that happens. So I've written [a tiny subclass of RouteCollection](https://github.com/lschricke/symfony-strict-route-collection), but to be able to use it (through [a service provider like this](https://github.com/lschricke/silex-strict-route-collection-service-provider) for instance (needs to be updated for Silex 2)), I need to be able to replace `RouteCollection` by my subclass. This PR makes it possible. Thanks! :) Commits ------- 18f253f2 Added factory for RouteCollection, makes subclassing of RouteCollection possible.
Showing
Please register or sign in to comment