Skip to content

Commit

Permalink
WIP test
Browse files Browse the repository at this point in the history
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
  • Loading branch information
spaze committed Jul 1, 2023
1 parent f80ca03 commit effa003
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/RuleErrors/DisallowedCallsRuleErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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;
}


Expand Down

0 comments on commit effa003

Please sign in to comment.