protected function determineLoaderFromPath(string $source): LoaderInterface
    {
        if (isset($this->loaders[$source])) {
            return $this->loaders[$source];
        }

        $key = is_dir($source) ? 'dir' : (pathinfo($source, PATHINFO_EXTENSION) ?: null);

        if (!isset($key) || !isset($this->loaders[$key])) {
            throw new NoLoaderException("Don't know how to load configuration from '$source'");
        }

        return $this->loaders[$key];
    }