/** * Finds an entry of the container by its identifier and returns it. * * @param string $id Identifier of the entry to look for. * * @throws \Interop\Container\Exception\NotFoundException No entry was found for this identifier. * @throws \Interop\Container\Exception\ContainerException Error while retrieving the entry. * * @return mixed Entry. */ public function get($id) { if ('kernel' === $id) { return $this->kernel; } elseif ('event_dispatcher' === $id) { return $this->kernel->getDispatcher(); } throw new NotFoundException(sprintf("The service '%s' doesn't exist", $id)); }