Upgrade the FastRoute dependency from ^1.3 to v2 when it reaches stable.
Current state:
league/route depends on nikic/fast-route ^1.3 (released 2018)
FastRoute v2.0.0-beta1 was released March 2024 but has not progressed to stable
What v2 changes:
dispatch() returns Matched|NotMatched|MethodNotAllowed result objects instead of arrays
RouteCollector replaced by ConfigureRoutes interface
GroupCountBased dispatcher marked as @final (breaks our current inheritance)
Built-in GenerateUri interface for reverse routing
Built-in Cache interface
PHP 8.1+ minimum with strict types throughout
Required work:
Replace Dispatcher inheritance with composition (the Dispatcher currently extends GroupCountBased)
Adapt to new result object types in matchRequest() and dispatchRequest()
Update Router::prepareRoutes() for the new ConfigureRoutes API
Potentially leverage v2's built-in URI generation for reverse routing (Reverse routing / URL generation from named routes #355 )
Potentially leverage v2's caching alongside our index-based approach
Prerequisite: FastRoute v2 reaching a stable release.
Target: 8.0
Upgrade the FastRoute dependency from ^1.3 to v2 when it reaches stable.
Current state:
nikic/fast-route ^1.3(released 2018)What v2 changes:
dispatch()returnsMatched|NotMatched|MethodNotAllowedresult objects instead of arraysRouteCollectorreplaced byConfigureRoutesinterfaceGroupCountBaseddispatcher marked as@final(breaks our current inheritance)GenerateUriinterface for reverse routingCacheinterfaceRequired work:
GroupCountBased)matchRequest()anddispatchRequest()Router::prepareRoutes()for the newConfigureRoutesAPIPrerequisite: FastRoute v2 reaching a stable release.
Target: 8.0