Skip to content

Commit

Permalink
Update CommitCommand to use collect::transform()
Browse files Browse the repository at this point in the history
- Update CommitCommand to use collect::transform() instead of collect::map() to convert the JSON message to an array.
  • Loading branch information
[email protected] committed Nov 16, 2023
1 parent 7fe46c5 commit 5a21789
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Commands/CommitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5a21789

Please sign in to comment.