router
router copied to clipboard
Inconsistent \Yiisoft\Router\CurrentRoute
Due to \Yiisoft\Router\CurrentRoute doesn't have any restrictions it may be created with $container->get(), but it has whole empty state:

It's unexpected and cause lots of if's over it.
Isn't it better to add RouteProvider with the getCurrent() method that will return either CurrentRoute or Route or throw an exception because it wasn't set before?
Returns CurrentRoute|Route is confused.
By fact, CurrentRoute is RouteProvider.
It's not a provider by design.