/**
  * @param RuleSet             $ruleSet
  * @param ParsedPhpFileFinder $files
  *
  * @return BaseViolation[]
  */
 public function getViolations(RuleSet $ruleSet, ParsedPhpFileFinder $files)
 {
     $result = array();
     foreach ($files as $i => $file) {
         $unfilteredResult = $this->violationChecker->check($file, $ruleSet);
         foreach ($unfilteredResult as $unfilteredViolation) {
             if (false === $this->violationFilter->isViolationFiltered($unfilteredViolation)) {
                 $result[] = $unfilteredViolation;
             }
         }
     }
     return $result;
 }
 /**
  * @param RuleSet             $ruleSet
  * @param ParsedPhpFileFinder $files
  *
  * @return Violation[]
  */
 public function getViolations(RuleSet $ruleSet, ParsedPhpFileFinder $files, ViolationFilterInterface $filter)
 {
     $total = count($files);
     $this->eventDispatcher->dispatch(ProgressEvent::CHECKER, new ProgressEvent(0, $total));
     $result = array();
     foreach ($files as $i => $file) {
         $unfilteredResult = $this->violationChecker->check($file, $ruleSet);
         foreach ($unfilteredResult as $unfilteredViolation) {
             if (false === $filter->isViolationFiltered($unfilteredViolation)) {
                 $result[] = $unfilteredViolation;
             }
         }
         $this->eventDispatcher->dispatch(ProgressEvent::CHECKER, new ProgressEvent(++$i, $total));
     }
     return $result;
 }