mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-05 23:03:11 +08:00
Replaced regular callbacks by arrow functions when possible
This commit is contained in:
@@ -69,12 +69,10 @@ class ValidationException extends InvalidArgumentException implements ProblemDet
|
||||
|
||||
private function invalidElementsToString(): string
|
||||
{
|
||||
return reduce_left($this->getInvalidElements(), function ($messageSet, string $name, $_, string $acc) {
|
||||
return $acc . sprintf(
|
||||
"\n '%s' => %s",
|
||||
$name,
|
||||
is_array($messageSet) ? print_r($messageSet, true) : $messageSet
|
||||
);
|
||||
}, '');
|
||||
return reduce_left($this->getInvalidElements(), fn ($messages, string $name, $_, string $acc) => $acc . sprintf(
|
||||
"\n '%s' => %s",
|
||||
$name,
|
||||
is_array($messages) ? print_r($messages, true) : $messages
|
||||
), '');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user