As I have my own error handler implemented, I'd like to an option for using anonymous functions in $router->notFound()
as it's unnecessary to implement an extra controller.
Is there any way to use something like this?
$router->notFound(function() {
throw new NotFoundException();
});