Skip to content

Commit

Permalink
Merge pull request #1725 from hydephp/route-list-formats
Browse files Browse the repository at this point in the history
Clean up and refactor route list command code
  • Loading branch information
caendesilva committed Jun 12, 2024
2 parents a898d43 + a41727b commit 40dc339
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/framework/src/Console/Commands/RouteListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
namespace Hyde\Console\Commands;

use Hyde\Hyde;
use Illuminate\Support\Arr;
use Hyde\Console\Concerns\Command;
use Hyde\Support\Internal\RouteListItem;

use function array_map;
use function array_keys;
use function json_encode;
use function array_values;
Expand Down Expand Up @@ -38,13 +38,13 @@ public function handle(): int
/** @return array<integer, array<string, string>> */
protected function generate(): array
{
return array_map(RouteListItem::format(...), array_values(Hyde::routes()->all()));
return Arr::map(array_values(Hyde::routes()->all()), RouteListItem::format(...));
}

/** @param array<integer, array<string, string>> $routes */
protected function makeHeader(array $routes): array
{
return array_map(Hyde::makeTitle(...), array_keys($routes[0]));
return Arr::map(array_keys($routes[0]), Hyde::makeTitle(...));

Check failure on line 47 in packages/framework/src/Console/Commands/RouteListCommand.php

View workflow job for this annotation

GitHub Actions / run-static-analysis-phpstan

Creating callable from a non-native static method Hyde\Hyde::makeTitle().
}

/** Write a message without ANSI formatting */
Expand Down

0 comments on commit 40dc339

Please sign in to comment.