{"action":"created","issue":{"url":"https://api.github.com/repos/silexphp/Silex/issues/1175","labels_url":"https://api.github.com/repos/silexphp/Silex/issues/1175/labels{/name}","comments_url":"https://api.github.com/repos/silexphp/Silex/issues/1175/comments","events_url":"https://api.github.com/repos/silexphp/Silex/issues/1175/events","html_url":"https://github.com/silexphp/Silex/pull/1175","id":87622576,"number":1175,"title":"Added factory for RouteCollection, makes subclassing of RouteCollection possible.","user":{"login":"lschricke","id":3723626,"avatar_url":"https://avatars.githubusercontent.com/u/3723626?v=3","gravatar_id":"","url":"https://api.github.com/users/lschricke","html_url":"https://github.com/lschricke","followers_url":"https://api.github.com/users/lschricke/followers","following_url":"https://api.github.com/users/lschricke/following{/other_user}","gists_url":"https://api.github.com/users/lschricke/gists{/gist_id}","starred_url":"https://api.github.com/users/lschricke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lschricke/subscriptions","organizations_url":"https://api.github.com/users/lschricke/orgs","repos_url":"https://api.github.com/users/lschricke/repos","events_url":"https://api.github.com/users/lschricke/events{/privacy}","received_events_url":"https://api.github.com/users/lschricke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-12T06:15:07Z","updated_at":"2015-06-15T03:41:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/silexphp/Silex/pulls/1175","html_url":"https://github.com/silexphp/Silex/pull/1175","diff_url":"https://github.com/silexphp/Silex/pull/1175.diff","patch_url":"https://github.com/silexphp/Silex/pull/1175.patch"},"body":"Note: replaces #1174, which was targeting a wrong branch (and where I messed a bit with the commits ;)).\r\n\r\n--\r\n\r\nThe aim of this PR is to allow developpers to subclass `Symfony\\Component\\Routing\\RouteCollection` to change some of its behavior.\r\n\r\nIn 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.\r\n\r\nThanks! :)"},"comment":{"url":"https://api.github.com/repos/silexphp/Silex/issues/comments/111911577","html_url":"https://github.com/silexphp/Silex/pull/1175#issuecomment-111911577","issue_url":"https://api.github.com/repos/silexphp/Silex/issues/1175","id":111911577,"user":{"login":"lschricke","id":3723626,"avatar_url":"https://avatars.githubusercontent.com/u/3723626?v=3","gravatar_id":"","url":"https://api.github.com/users/lschricke","html_url":"https://github.com/lschricke","followers_url":"https://api.github.com/users/lschricke/followers","following_url":"https://api.github.com/users/lschricke/following{/other_user}","gists_url":"https://api.github.com/users/lschricke/gists{/gist_id}","starred_url":"https://api.github.com/users/lschricke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lschricke/subscriptions","organizations_url":"https://api.github.com/users/lschricke/orgs","repos_url":"https://api.github.com/users/lschricke/repos","events_url":"https://api.github.com/users/lschricke/events{/privacy}","received_events_url":"https://api.github.com/users/lschricke/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T03:41:48Z","updated_at":"2015-06-15T03:41:48Z","body":"I updated the code and added some tests to cover this new feature as you suggested @fabpot. Do you think the tests provide enough coverage?\r\n\r\n@stof, this PR does not solve my use case directly, but using it to have `Silex` use a subclass of Symfony's `RouteCollection` like [this one](https://github.com/lschricke/symfony-strict-route-collection) seems to work in my tests. Am I missing something?"}}