/** * {@inheritdoc} */ public function resolve($resource) { foreach ($this->loaders as $loader) { if ($loader->supports($resource)) { return $loader; } } throw LoaderException::missingLoader($resource); }
/** * {@inheritdoc} * @throws LoaderException */ public function import($resource) { if ($this->supports($resource)) { return $this->load($resource); } if (null === ($res = $this->getResolver())) { throw LoaderException::missingLoader($resource); } try { $loader = $res->resolve($resource); } catch (LoaderException $e) { throw new LoaderException($e->getMessage(), $e->getCode(), $e); } $loader->load($resource); }