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];
    }
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];
    }
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 ] ; }
Determine loader based on file extension

@param string $source
@return LoaderInterface
@throws NoLoaderException
Determine loader based on file extension