thephpleague / route

Fast PSR-7 based routing and dispatch component including PSR-15 middleware, built on top of FastRoute.
http://route.thephpleague.com
MIT License
651 stars 126 forks source link

A few questions #222

Closed ncou closed 5 years ago

ncou commented 5 years ago

Hi,

Very nice piece of code. I used some part of this code to do a micro framework and i have a few questions/remarks.

1) Why not enforce the return type in the CollectionTrait/Interface ?

2) You should add an abstract "group()" function in the CollectionTrait and add the function in the RouteGroup classe, so we can have the possibility to create some groups of groups.

3) If i create a group, and declare inside a route with a name, if i try to find it using the getNamedRoute() function it will not work. It's because the group are not yet invoked, so the route object is not yet added in the array. Am i right ? I need to do a few tests to confirm.

4) My 2 cents opinion : i think the get/setName present in the ConditionTrait should be removed and moved in the Route class, to let only the scheme/host/port condition.

5) My 2 cents opinion : In the Dispatch class who implement the interface Dispatcher, instead of using "FastRoute::NOT_FOUND" i would use "self::NOT_FOUND" it feel more like a class extend this way.

Sorry for my poor english.

philipobenito commented 5 years ago

These are more suggestions than questions :-) will keep them in mind for the next major release.