/**
  * {@inheritdoc}
  */
 public function loadRuleSet($path)
 {
     $key = $this->generateDirectoryKey($path);
     if ($this->cache->has($key)) {
         return $this->cache->getCachedRuleSet($key);
     }
     $ruleSet = $this->traverser->traverse($path);
     $this->cache->cacheRuleSet($key, $ruleSet);
     return $ruleSet;
 }
 /**
  * @param $package
  *
  * @return RuleSet|null
  */
 private function loadPackageRuleSet(\stdClass $package)
 {
     $ruleSet = null;
     $key = $this->generatePackageKey($package);
     if ($this->cache->has($key)) {
         $ruleSet = $this->cache->getCachedRuleSet($key);
     } elseif (is_dir($path = $this->getPackagePath($package))) {
         $ruleSet = $this->traverser->traverse($path, true);
         $this->cache->cacheRuleSet($key, $ruleSet);
     }
     return $ruleSet;
 }