Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

[Routing] clean up of RouteCollection API #6022

wants to merge 11 commits into
Commits on Dec 6, 2012
  1. clean up addPrefix that was misused to add requirements, defaults and…

    Tobion committed Nov 15, 2012
    … options without adding a prefix at all.
    so RouteCollection::addPrefix('', array('default' => 'value')) was used in addCollection() to add defaults to child routes, but not adding a prefix. this was just a hack. instead RouteCollection now offers a dedicated method to add such configs.
  2. removed parameter from RouteCollection::addPrefix in a BC way

    Tobion committed Nov 15, 2012
    it has been deprecated because adding options has nothing to do with adding a path prefix
  3. deprecated additional param of RouteCollection::addCollection

    Tobion committed Nov 15, 2012
    these prefix, defaults, requirements params were redundant to the behavior of addPrefix. and with the addition of hostnamePattern, this method did basically everything although there are already specific methods for these use-cases. the single responsibility of the methods provides a better API
  4. added type hints in addPrefix that would not work with anything other…

    Tobion committed Nov 15, 2012
    … than array anyway
  5. added defaults and requirements to setHostenamePattern to be consiste…

    Tobion committed Nov 15, 2012
    …nt with addPrefix which also accepts placeholders with defaults and requirements
  6. fix the loaders to not use the deprecated API

    Tobion committed Nov 17, 2012
    it also fixes the xml and yaml loader that was not using the empty hostname pattern when importing a resource to reset the hostname pattern for it.
Commits on Dec 7, 2012