@param LoaderInterface[] $loaders

@return XmlFileLoader[]|YamlFileLoader[]
6391
private function extractSupportedLoaders(array $loaders)
    {
        $supportedLoaders = [];

        foreach ($loaders as $loader) {
            if ($loader instanceof XmlFileLoader || $loader instanceof YamlFileLoader) {
                $supportedLoaders[] = $loader;
            } elseif ($loader instanceof LoaderChain) {
                $supportedLoaders = array_merge($supportedLoaders, $this->extractSupportedLoaders($loader->getLoaders()));
            }
        }

        return $supportedLoaders;
    }
803760
public static function getDefaultLoaders(): FluentDOM\Loaders {
    if (!(self::$_defaultLoaders instanceof FluentDOM\Loaders)) {
      self::$_defaultLoaders = new FluentDOM\Loaders(new FluentDOM\Loader\Standard());
    }
    return self::$_defaultLoaders;
  }
903533
public static function create(array $loaders = [])
    {
        if (empty($loaders)) {
            $extractor = null;

            if (class_exists(PropertyInfoExtractor::class)) {
                $extractors = $typeExtractors = [new ReflectionExtractor()];

                if (class_exists(ClassReflector::class)) {
                    array_unshift($typeExtractors, new PhpDocExtractor());
                }

                $extractor = new PropertyInfoExtractor($extractors, $typeExtractors, [], $extractors);
            }

            $loaders = [new ReflectionClassMetadataLoader($extractor)];

            if (class_exists(AnnotationReader::class)) {
                $loaders[] = new AnnotationClassMetadataLoader(new AnnotationReader());
            }
        }

        return new static(count($loaders) > 1 ? new ChainClassMetadataLoader($loaders) : array_shift($loaders));
    }
1156860
protected function getLoader($type)
    {
        if (!isset($this->loaders[$type])) {
            throw new \InvalidArgumentException("No loader defined for type '${type}'.");
        }

        return $this->loaders[$type];
    }
1199912
public function registerLoader(LoaderInterface $loader, $id = null) {
		if ($id === null) {
			$this->_loaders[] = $loader;
		} else if (! isset($this->_loaders[$id])) {
			$this->_loaders[$id] = $loader;
		}
		
		if ($loader instanceof LocatorAwareInterface && ! $loader->hasLocator() && $this->hasLocator()) {
			$loader->setLocator($this->getLocator());
		}
		
		return $this;
	}
164428
protected function load()
    {
        $data = array();

        /** @var LoaderInterface $loader */
        foreach ($this->loaders as $loader) {
            try {
                $data = array_merge($data, $loader->load());

                if ($loader->stopPropagation()) {
                    break;
                }
            } catch (LoaderException $e) {
                $this->getLogger()->error($e->getMessage());
            }
        }

        return $data;
    }
987186
public function load(LoaderInterface $loader, $merge = true)
    {
        $this->internalLoad($loader->load(), $merge);
    }
131166
protected function getTwig(\Twig_LoaderInterface $loader)
    {
        $twig = new \Twig_Environment($loader);
        $twig->setCache(false);

        return $twig;
    }
1048538
public function setLoader($name, LoaderInterface $loader)
    {
        // If name is int or null, get name from Loader object.
        $name = (is_numeric($name) || !$name) ? $loader->getName() : $name;

        $this->loaders[$name] = $loader;

        return $this;
    }
991806
public function getLoader($prefix)
    {
        if (!$this->hasLoader($prefix)) {
            throw new \InvalidArgumentException(sprintf('A loader is not registered for the prefix "%s"', $prefix));
        }

        return $this->loaders[$prefix];
    }
688391
public function loadServices(FileLoader $loader)
    {
        // services, admin & config files
        foreach (['services', 'admin'] as $fileName) {
            if (file_exists($this->dir . $this->prefix . $fileName . $this->suffix)) {
                $loader->load($fileName . $this->suffix);
            }
        }

        return $this;
    }
102201
public function load(array $headers = [])
    {
        $data = $this->getApi()->getConfiguration($headers);

        return $this->getFactory()->create($data);
    }
1327748
public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $config = '';
        if ($this->configMerge) {
            $config = $config ? Yaml::parse($config) : array();
            foreach ($this->configMerge as $configToMerge) {
                $config = array_replace($config, Yaml::parse($configToMerge));
            }
            $config = Yaml::dump($config);
        }

        file_put_contents($this->getCacheDir() .'/config.yml', $config);

        $loader->load($this->getCacheDir() .'/config.yml');
    }
293760
public function addListenerLoader(LoaderInterface $loader)
	{
		if (!isset($this->loaders[$loader->getName()]))
		{
			//$loader->setDispatcher($this);

			$this->loaders[$loader->getName()] = $loader;
		}

		return $this;
	}
421563
public function getLoader()
    {
        if (null === $this->loader) {
            $locator  = new FileLocator($this->paths);
            $resolver = new LoaderResolver(array(
                new YamlFileLoader($locator),
                new PhpFileLoader($locator),
                new IniFileLoader($locator),
                new ArrayLoader(),
            ));

            $this->loader = new DelegatingLoader($resolver);
        }

        return $this->loader;
    }
513861
public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load(__DIR__.'/../config/config.yml');

        foreach ($this->extraConfigFiles as $configFile) {
            $loader->load($configFile);
        }
    }
566250
public static function registerLoader($loader, string ...$contentTypes): FluentDOM\Loaders {
    $loaders = self::getDefaultLoaders();
    if (count($contentTypes) > 0) {
      $lazyLoader = new \FluentDOM\Loader\Lazy();
      foreach ($contentTypes as $contentType) {
        $lazyLoader->add($contentType, $loader);
      }
      $loaders->add($lazyLoader);
    } elseif (is_callable($loader)) {
      self::registerLoader($loader());
    } else {
      $loaders->add($loader);
    }
    self::$_loader = NULL;
    return $loaders;
  }