Skip to content

Commit

Permalink
Accept array of property names in violation reporters
Browse files Browse the repository at this point in the history
  • Loading branch information
stayallive committed Apr 24, 2024
1 parent 933e30a commit cb38a2e
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -35,8 +35,13 @@ public function __construct(?callable $callback, bool $suppressDuplicateReports,
$this->reportAfterResponse = $reportAfterResponse;
}

public function __invoke(Model $model, string $property): void
/** @param string|array<int, string> $propertyOrProperties */
public function __invoke(Model $model, $propertyOrProperties): void
{
$property = is_array($propertyOrProperties)
? implode(', ', $propertyOrProperties)
: $propertyOrProperties;

if (!$this->shouldReport($model, $property)) {
return;
}
Expand Down

0 comments on commit cb38a2e

Please sign in to comment.