diff --git a/src/RuleErrors/DisallowedCallsRuleErrors.php b/src/RuleErrors/DisallowedCallsRuleErrors.php index 4057cdd..9681d1d 100644 --- a/src/RuleErrors/DisallowedCallsRuleErrors.php +++ b/src/RuleErrors/DisallowedCallsRuleErrors.php @@ -47,6 +47,7 @@ public function __construct(Allowed $allowed, Identifier $identifier, FilePath $ */ public function get(?CallLike $node, Scope $scope, string $name, ?string $displayName, ?string $definedIn, array $disallowedCalls, ?string $message = null): array { + $errors = []; foreach ($disallowedCalls as $disallowedCall) { if ( $this->identifier->matches($disallowedCall->getCall(), $name, $disallowedCall->getExcludes()) @@ -65,12 +66,10 @@ public function get(?CallLike $node, Scope $scope, string $name, ?string $displa if ($disallowedCall->getErrorTip()) { $errorBuilder->tip($disallowedCall->getErrorTip()); } - return [ - $errorBuilder->build(), - ]; + $errors[] = $errorBuilder->build(); } } - return []; + return $errors; }