diff --git a/src/RuleSet/Loader/ComposerLoader.php b/src/RuleSet/Loader/ComposerLoader.php index 652f5c8..81c3948 100644 --- a/src/RuleSet/Loader/ComposerLoader.php +++ b/src/RuleSet/Loader/ComposerLoader.php @@ -119,16 +119,16 @@ private function getComposerPackages(\stdClass $composer, $noDev = false) /** * @param $package * - * @return RuleSet + * @return RuleSet|null */ private function loadPackageRuleSet(\stdClass $package) { - $key = $this->generatePackageKey($package); + $ruleSet = null; + $key = $this->generatePackageKey($package); if ($this->cache->has($key)) { $ruleSet = $this->cache->getCachedRuleSet($key); - } else { - $path = $this->getPackagePath($package); + } elseif (is_dir($path = $this->getPackagePath($package))) { $ruleSet = $this->traverser->traverse($path, true); $this->cache->cacheRuleSet($key, $ruleSet); }