@@ -27,6 +27,9 @@ private function parseCommands(array $commands) : void {
2727 }
2828
2929 private function categories (array $ commands ) : void {
30+ $ this ->output ->print (array (
31+ 'Settings -> Categories '
32+ ));
3033 if ( isset ($ commands [0 ])){
3134 $ cmd = $ commands [0 ];
3235 if ( in_array ($ cmd , ['add ' , 'del ' , 'list ' ])){
@@ -50,11 +53,14 @@ private function categories(array $commands) : void {
5053 }
5154 }
5255 else if ($ cmd == 'del ' ){
53- $ clist = array (" ID \t : \t Category " );
56+ $ clist = array ();
5457 foreach ( $ cats as $ id => $ cat ){
55- $ clist [] = $ id . "\t: \t" . $ cat ;
58+ $ clist [] = array (
59+ 'ID ' => strval ($ id ),
60+ 'Category ' => $ cat
61+ );
5662 }
57- $ this ->output ->print ($ clist, null , 2 );
63+ $ this ->output ->table ($ clist );
5864
5965 $ delid = $ this ->output ->readline ("Type ID to delete category, else abort: " , CLIOutput::RED , 1 );
6066 if ( isset ($ cats [$ delid ]) ){
@@ -72,17 +78,19 @@ private function categories(array $commands) : void {
7278 }
7379 }
7480 else {
75- $ clist = array (" ID \t : \t Category " );
81+ $ clist = array ();
7682 foreach ( $ cats as $ id => $ cat ){
77- $ clist [] = $ id . "\t: \t" . $ cat ;
83+ $ clist [] = array (
84+ 'ID ' => strval ($ id ),
85+ 'Category ' => $ cat
86+ );
7887 }
79- $ this ->output ->print ($ clist, null , 1 );
88+ $ this ->output ->table ($ clist );
8089 }
8190 return ;
8291 }
8392 }
8493 $ this ->output ->print (array (
85- 'Settings -> Categories ' ,
8694 array (
8795 'There are more commands for categories ' ,
8896 array (
@@ -94,6 +102,10 @@ private function categories(array $commands) : void {
94102 }
95103
96104 private function merge () : void {
105+ $ this ->output ->print (array (
106+ 'Settings -> Merge '
107+ ));
108+
97109 $ s = new StatsData ();
98110 $ allnames = $ s ->getAllNames ();
99111 $ color = null ;
@@ -136,8 +148,5 @@ private function commandList() : void {
136148 )
137149 ));
138150 }
139-
140-
141-
142151}
143152?>
0 commit comments