Skip to content

Commit 9e526f0

Browse files
committed
Update routes command
1 parent 1526895 commit 9e526f0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: src/Routes.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types=1);
22
/*
33
* This file is part of Aplus Framework CLI Commands Library.
44
*
@@ -12,12 +12,16 @@
1212
use Framework\CLI\CLI;
1313
use Framework\CLI\Command;
1414
use Framework\MVC\App;
15-
use Framework\Routing\Route;
1615

16+
/**
17+
* Class Routes.
18+
*
19+
* @package cli-commands
20+
*/
1721
class Routes extends Command
1822
{
1923
protected string $name = 'routes';
20-
protected string $description = 'Show routes list.';
24+
protected string $description = 'Shows routes list.';
2125
protected string $usage = 'routes [options]';
2226
protected array $options = [
2327
'--order' => 'Order by column',
@@ -28,9 +32,6 @@ public function run() : void
2832
$body = [];
2933
foreach (App::router()->getRoutes() as $method => $routes) {
3034
foreach ($routes as $route) {
31-
/**
32-
* @var Route $route
33-
*/
3435
$body[] = [
3536
$method,
3637
$route->getOrigin(),
@@ -40,8 +41,7 @@ public function run() : void
4041
];
4142
}
4243
}
43-
$options = $this->console->getOptions();
44-
$index = $options['order'] ?? 1;
44+
$index = $this->console->getOption('order') ?? '1';
4545
\usort($body, static function ($str1, $str2) use ($index) {
4646
return \strcmp($str1[$index], $str2[$index]);
4747
});

0 commit comments

Comments
 (0)