/** * Create a new HTTP kernel instance. * * @param \Viserio\Contracts\Foundation\Application $app * @param \Viserio\Contracts\Routing\Router $router * @param \Viserio\Contracts\Events\Dispatcher $events */ public function __construct(ApplicationContract $app, RouterContract $router, DispatcherContract $events) { $this->app = $app; $this->events = $events; foreach ($this->routeWithMiddlewares as $routeWithMiddleware) { $router->withMiddleware($routeWithMiddleware); } foreach ($this->routeWithoutMiddlewares as $routeWithoutMiddleware) { $router->withMiddleware($routeWithoutMiddleware); } $this->router = $router; }