- Member | 464
I would like to ask if you ever come in touch with this error using PhpStan
Nette\Application\Routers\RouteList does not accept Nette\Application\Routers\Route
Code producing this error:
$router = new RouteList('v1'); $router = new Route('/v1/status', 'Status:default');
Workaround for this situation is this:
$router = new RouteList('v1'); $router->offsetSet(null, new Route('/v1/status', 'Status:default'));
and it works fine, but it's strange and to be honest, I don't want to use it in this way just because PhpStan.
Have you ever saw this? What is a correct solution?
Nette Application: 2.4.13
Last edited by arron (2020-10-30 11:09)