From 5a21789cc87831484909c8fde0d08e3fd3e69674 Mon Sep 17 00:00:00 2001 From: "ityaozm@gmail.com" Date: Thu, 16 Nov 2023 17:44:02 +0800 Subject: [PATCH] Update CommitCommand to use collect::transform() - Update CommitCommand to use collect::transform() instead of collect::map() to convert the JSON message to an array. --- app/Commands/CommitCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Commands/CommitCommand.php b/app/Commands/CommitCommand.php index baeec2f..092c26d 100644 --- a/app/Commands/CommitCommand.php +++ b/app/Commands/CommitCommand.php @@ -104,7 +104,7 @@ function ($attempts) use ($cachedDiff): string { $this->task('2. Choosing commit message', function () use (&$message, $messages): void { $message = collect(json_decode($messages, true, 512, JSON_THROW_ON_ERROR)) - ->transform(function (array $message): array { + ->transform(static function (array $message): array { if (\is_array($message['body'])) { $message['body'] = collect($message['body']) ->transform(static function (string $line): string {