File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
- <?php
1
+ <?php declare (strict_types= 1 );
2
2
/*
3
3
* This file is part of Aplus Framework CLI Commands Library.
4
4
*
12
12
use Framework \CLI \CLI ;
13
13
use Framework \CLI \Command ;
14
14
use Framework \MVC \App ;
15
- use Framework \Routing \Route ;
16
15
16
+ /**
17
+ * Class Routes.
18
+ *
19
+ * @package cli-commands
20
+ */
17
21
class Routes extends Command
18
22
{
19
23
protected string $ name = 'routes ' ;
20
- protected string $ description = 'Show routes list. ' ;
24
+ protected string $ description = 'Shows routes list. ' ;
21
25
protected string $ usage = 'routes [options] ' ;
22
26
protected array $ options = [
23
27
'--order ' => 'Order by column ' ,
@@ -28,9 +32,6 @@ public function run() : void
28
32
$ body = [];
29
33
foreach (App::router ()->getRoutes () as $ method => $ routes ) {
30
34
foreach ($ routes as $ route ) {
31
- /**
32
- * @var Route $route
33
- */
34
35
$ body [] = [
35
36
$ method ,
36
37
$ route ->getOrigin (),
@@ -40,8 +41,7 @@ public function run() : void
40
41
];
41
42
}
42
43
}
43
- $ options = $ this ->console ->getOptions ();
44
- $ index = $ options ['order ' ] ?? 1 ;
44
+ $ index = $ this ->console ->getOption ('order ' ) ?? '1 ' ;
45
45
\usort ($ body , static function ($ str1 , $ str2 ) use ($ index ) {
46
46
return \strcmp ($ str1 [$ index ], $ str2 [$ index ]);
47
47
});
You can’t perform that action at this time.
0 commit comments