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

Route collection interface is missing parameter/return types #206

Closed shadowhand closed 6 years ago

shadowhand commented 6 years ago

While the map() method uses scalar types, the get(), post(), etc methods do not.

Unfortunately, this cannot be resolved without a new major release because adding scalar types to those methods would cause incompatible method signatures for 3rd parties implementing this interface.

Side note: If the required PHP version was >=7.2 this wouldn't be an issue due to parameter type widening.

philipobenito commented 6 years ago

This is because it extends RouteCollector from FastRoute so it can't right now.