protected function resolveKernel()
	{
		if ($this->kernel !== null) {
			return $this->kernel;
		}

		$class = 'Symfony\Component\EventDispatcher\EventDispatcherInterface';
		$eventDispatcher = $this->container->isBound($class) ?
			$this->container->resolve($class) : null;

		$kernel = new Kernel(
			$this->getRouter(),
			$this->requests,
			$this->errorHandler,
			$eventDispatcher
		);

		return $this->kernel = $this->resolveStack()
			->resolve($kernel);
	}