SensioLabs\DeprecationDetector\DetectorFactory::getRuleSetLoader PHP Метод

getRuleSetLoader() приватный Метод

private getRuleSetLoader ( DirectoryTraverser $traverser, Configuration $configuration ) : SensioLabs\DeprecationDetector\RuleSet\Loader\LoaderInterface
$traverser SensioLabs\DeprecationDetector\RuleSet\DirectoryTraverser
$configuration SensioLabs\DeprecationDetector\Configuration\Configuration
Результат SensioLabs\DeprecationDetector\RuleSet\Loader\LoaderInterface
    private function getRuleSetLoader(DirectoryTraverser $traverser, Configuration $configuration)
    {
        $ruleSetCache = new Cache(new Filesystem());
        if ($configuration->useCachedRuleSet()) {
            $ruleSetCache->disable();
        } else {
            $ruleSetCache->setCacheDir($configuration->ruleSetCacheDir());
        }
        if (is_dir($configuration->ruleSet())) {
            $loader = new DirectoryLoader($traverser, $ruleSetCache);
        } elseif ('composer.lock' === basename($configuration->ruleSet())) {
            $loader = new ComposerLoader($traverser, $ruleSetCache, new ComposerFactory());
        } else {
            $loader = new FileLoader();
        }
        return $loader;
    }