@param LoaderInterface|array $loader

@throws InvalidParamException
17070
public function setLoader($loader)
    {
        if (!is_array($loader) && !($loader instanceof LoaderInterface)) {
            throw new InvalidParamException('Argument should be an array or implement LoaderInterface');
        }

        $this->loader = $loader;
    }
1035457
public function addLoader($id, $loader)
    {
        if (!array_key_exists($id, $this->loaders)) {
            $this->loaders[$id] = $loader;
        }
    }
565393
protected function setLoaders(array $loaders)
    {
        $this->loaders = array();
        foreach ($loaders as $type=>$loader) {
            if (!$loader instanceof FormulaLoaderInterface) {
                throw new \InvalidArgumentException("Not a valid formula loader with key '${type}'.");
            }
            $this->setLoader($type, $loader);
        }
    }
315277
protected function rendererFactory($renderer): RendererInterface
	{
		return $renderer instanceof Closure ? $this->container->call($renderer) : $this->container->get($renderer);
	}
561518
public function getFileLoader(): LoaderInterface
    {
        if (!isset($this->fileLoader)) {
            $this->fileLoader = new DelegateLoader();
        }

        return $this->fileLoader;
    }
863608
public function registerDoctrineLazyLoader($entityClass, LazyLoaderInterface $loader)
    {
        if (!is_a($entityClass, LazyPropertiesInterface::class, true)) {
            throw new \InvalidArgumentException(sprintf(
                'Class %s has to implement %s to be able to lazy load her properties.',
                $entityClass,
                LazyPropertiesInterface::class
            ));
        }

        $this->loaders->set($entityClass, $loader);
    }
183795
public final void initApplicationClassLoader(ClassLoader loader)
    {
        if (loader == null)
            throw new IllegalArgumentException("loader is null");
        if (!Kit.testIfCanLoadRhinoClasses(loader))
            throw new IllegalArgumentException(
                "Loader can not resolve Rhino classes");

        if (this.applicationClassLoader != null)
            throw new IllegalStateException(
                "applicationClassLoader can only be set once");
        checkNotSealed();

        this.applicationClassLoader = loader;
    }
278467
private function createLoader(ContainerBuilder $container, string $basePath): LoaderInterface
    {
        $fileLocator = new FileLocator($basePath);
        $loader = new DelegatingLoader(new LoaderResolver([
            new Loader\XmlFileLoader($container, $fileLocator),
            new Loader\YamlFileLoader($container, $fileLocator),
            new Loader\PhpFileLoader($container, $fileLocator),
            new Loader\GlobFileLoader($container, $fileLocator)
        ]));

        return $loader;
    }
1205273
public void classLoaderInit(DynamicClassLoader loader)
  {
    EnvLoaderListener listener = _listenerRef.get();
    
    if (listener != null)
      listener.classLoaderInit(loader);
  }
1247313
protected function configureLoader(LoaderInterface $loader)
    {
        if ($loader instanceof Base) {
            $loader->setORM($this->getORM());
            if ($this->logger) {
                $loader->setLogger($this->logger);
            }
        }
        if (is_callable(array($loader, 'addProvider'))) { // new in Alice 1.7.2
            $loader->addProvider($this->providers);
        } else { // BC path
            $loader->setProviders($this->providers);
        }
    }
922620
protected function initializeFileLoader(FileLoader $fileLoader = null)
    {
        if (!isset($this->fileLoader)) {
            $this->setFileLoader(($fileLoader) ? $fileLoader : new FileLoader());
        }
    }
1126737
public function addLoader(Loader $loader)
    {
        $loader->setLocator($this->locator);

        $this->resolver->addLoader($loader);
    }
999910
public function removeListenerLoader($loader)
	{
		if ($loader instanceof LoaderInterface)
		{
			$loader = $loader->getName();
		}

		if (isset($this->loaders[$loader]))
		{
			unset($this->loaders[$loader]);
		}

		return $this;
	}
273260
public function registerLoaderExtension(AspectLoaderExtension $loader): void
    {
        $targets = $loader->getTargets();
        foreach ($targets as $target) {
            $this->loaders[$target][] = $loader;
        }
    }
298876
public function setDownloader(DownloaderInterface $downloader = null)
    {
        if (null === $downloader) {
            $downloader = $this->defaultDownloader();
        }
        $this->downloader = $downloader;
    }
106978
public function detachLoader($key)
    {
        if (empty($this->loaders[$key])) {

            throw new \InvalidArgumentException(
                'No registered loader found.',
                DataAggregatorException::LOADER_NOT_FOUND
            );
        }

        unset($this->loaders[$key]);
    }
1290045
protected function getLoader(string $path): LoaderInterface
    {
        if (null === $this->loaderClass) {
            throw new RuntimeException('You must implement '.__METHOD__.' or pass the loader class to the constructor');
        }

        return new $this->loaderClass($path);
    }