nikic / FastRoute

Fast request router for PHP
Other
5.1k stars 445 forks source link

Need for a RouteCollectorInterface #209

Closed Gremlyn closed 7 months ago

Gremlyn commented 4 years ago

The way I am splitting up and loading routes requires me to pass the RouteCollector through to some methods, and I have built a custom RouteCollector that allows me to do reverse route lookup and generation. I'd like to be able to require a RouteCollectorInterface as the typehint, rather than my specific, custom RouteCollector - is there any appetite for that kind of modification?

burzum commented 4 years ago

is there any appetite for that kind of moditifcation?

Yes, I would like to see interfaces for almost everything inside the lib.

kktsvetkov commented 2 years ago

@Gremlyn can you use object composition instead, where your own route collector is sort of a decorator around the core FastRoute route collector?