Open MatthiasKuehneEllerhold opened 5 years ago
I guess this is a typo or something that's never implemented. I've checked all routers and they all do this (including older versions):
public function addRoute(Route $route) : void
{
$this->routesToInject[] = $route;
}
I guess you can even call it a feature to add more routes after you matched a route already :)
And to be honest, why would you have that check? When adding a lot of routes it only creates overhead.
So it'd be fine to remove this part of the docblock from zend-expressive?
This repository has been closed and moved to mezzio/mezzio-fastroute; a new issue has been opened at https://github.com/mezzio/mezzio-fastroute/issues/2.
The
Zend\Expressive\Router\RouterInface
states onaddRoute()
:But no RuntimeException will be thrown / raised.
Code to reproduce the issue
Expected results
A
Zend\Expressive\Router\Exception\RuntimeException
is thrown indicating that no routes may be added after callingmatch()
.Actual results
Scripts run without an exception.
Consequences
Is this a bug in the RouterInterface of "zend-expressive-router" or in the FastRouteRouter of this repo? (Same "error" (?) is in the "zend-expressive-zendrouter").