Skip to content

Commit ae24523

Browse files
committed
Remove $tempCollectorErrors filter
1 parent 810eb82 commit ae24523

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/Analyser/AnalyserResultFinalizer.php

+10-14
Original file line numberDiff line numberDiff line change
@@ -89,23 +89,19 @@ public function finalize(AnalyserResult $analyserResult, bool $onlyFiles, bool $
8989
}
9090

9191
foreach ($ruleErrors as $ruleError) {
92-
$tempCollectorErrors[] = $this->ruleErrorTransformer->transform($ruleError, $scope, $nodeType, $node->getStartLine());
93-
}
94-
}
95-
96-
$tempCollectorErrors = array_filter($tempCollectorErrors, function (Error $error) use ($scope, $node) : bool {
97-
if (! $error->canBeIgnored()) {
98-
return true;
99-
}
92+
$error = $this->ruleErrorTransformer->transform($ruleError, $scope, $nodeType, $node->getStartLine());
10093

101-
foreach ($this->ignoreErrorExtensionProvider->getExtensions() as $ignoreErrorExtension) {
102-
if ($ignoreErrorExtension->shouldIgnore($error, $node, $scope)) {
103-
return false;
94+
if ( $error->canBeIgnored()) {
95+
foreach ($this->ignoreErrorExtensionProvider->getExtensions() as $ignoreErrorExtension) {
96+
if ($ignoreErrorExtension->shouldIgnore($error, $node, $scope)) {
97+
continue 2;
98+
}
99+
}
104100
}
105-
}
106101

107-
return true;
108-
});
102+
$tempCollectorErrors[] = $error;
103+
}
104+
}
109105

110106
$errors = $analyserResult->getUnorderedErrors();
111107
$locallyIgnoredErrors = $analyserResult->getLocallyIgnoredErrors();

0 commit comments

Comments
 (0)