Passed
Pull Request — master (#13)
by Kris
19:43
created
lib/ShellColoredPrinter.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         'magenta'      => '35', 
38 38
         'cyan'         => '36', 
39 39
         'lightgray'    => '37', 
40
-        'default'      => '39',   // your default color
40
+        'default'      => '39', // your default color
41 41
         'darkgray'     => '90',
42 42
         'lightred'     => '91',
43 43
         'lightgreen'   => '92',
@@ -83,12 +83,12 @@  discard block
 block discarded – undo
83 83
      * @var    array
84 84
      */
85 85
     protected static $options = array(
86
-        'none'         => '0',    // reset all styles
87
-        'bold'         => '1',    // 
86
+        'none'         => '0', // reset all styles
87
+        'bold'         => '1', // 
88 88
         'dim'          => '2',
89 89
         'underlined'   => '4',    
90 90
         'blink'        => '5', 
91
-        'reverse'      => '7',    // reverse foreground/background color
91
+        'reverse'      => '7', // reverse foreground/background color
92 92
 
93 93
         //formats=(["bold"]=1 ["bright"]=1 ["dim"]=2 ["underlined"]=4 ["blink"]=5 ["reverse"]=7 ["hidden"]=8)
94 94
         //resets=(["all"]=0 ["bold"]=21 ["bright"]=21 ["dim"]=22 ["underlined"]=24 ["blink"]=25 ["reverse"]=27 ["hidden"]=28)
@@ -130,27 +130,27 @@  discard block
 block discarded – undo
130 130
         array_shift($args);
131 131
 
132 132
         // 
133
-        switch($command){
133
+        switch ($command) {
134 134
 
135 135
             // ****************************************
136 136
             // Get methods (return string)
137 137
             // ****************************************
138 138
 
139 139
             case'text':
140
-                return self::getCliString($str, $args);             // get formated text
140
+                return self::getCliString($str, $args); // get formated text
141 141
             
142 142
             // ****************************************
143 143
             // Print methods (echo and return null)
144 144
             // ****************************************
145 145
             
146 146
             case'print':
147
-                echo (self::getCliString($str, $args));               // print text
147
+                echo (self::getCliString($str, $args)); // print text
148 148
                 break;
149 149
             case'log':
150
-                echo (self::getCliString($str, $args) . self::$EOF );   // print text + newline
150
+                echo (self::getCliString($str, $args).self::$EOF); // print text + newline
151 151
                 break;
152 152
             case'relog':
153
-                echo (self::getCliString($str ."\r", $args));         // overwrite current line 
153
+                echo (self::getCliString($str."\r", $args)); // overwrite current line 
154 154
                 break;
155 155
 
156 156
             // *****************************************
@@ -158,19 +158,19 @@  discard block
 block discarded – undo
158 158
             // *****************************************
159 159
 
160 160
             case'ask':
161
-                echo (self::getCliString($str, $args));     // print question
162
-                return trim(fgets(STDIN));                  // reads and return one line from STDIN 
161
+                echo (self::getCliString($str, $args)); // print question
162
+                return trim(fgets(STDIN)); // reads and return one line from STDIN 
163 163
            
164 164
             case'askPassword':
165
-                self::hideInput();                          // hide 
166
-                echo (self::getCliString($str, $args));     // print question
167
-                $line= trim(fgets(STDIN));                  // reads one line from STDIN 
168
-                self::restoreInput();                       // restore 
169
-                return $line;                               // return line
165
+                self::hideInput(); // hide 
166
+                echo (self::getCliString($str, $args)); // print question
167
+                $line = trim(fgets(STDIN)); // reads one line from STDIN 
168
+                self::restoreInput(); // restore 
169
+                return $line; // return line
170 170
                 
171 171
             case 'askInt':
172
-                echo (self::getCliString($str, $args));     // print question
173
-                fscanf(STDIN, "%d\n", $number);             // reads number from STDIN
172
+                echo (self::getCliString($str, $args)); // print question
173
+                fscanf(STDIN, "%d\n", $number); // reads number from STDIN
174 174
                 return (is_int($number) ? $number : false); // return int value or false
175 175
         }
176 176
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
      */
191 191
     protected static function getCliString(string $str, array $arguments = [])
192 192
     {
193
-        if (empty($arguments)){
193
+        if (empty($arguments)) {
194 194
             return $str;
195 195
         }
196 196
 
@@ -203,25 +203,25 @@  discard block
 block discarded – undo
203 203
         foreach ($arguments as $argument) {
204 204
             
205 205
             // it's a color?
206
-            if(!$hasColor && isset(self::$foregroundColors[$argument])){
206
+            if (!$hasColor && isset(self::$foregroundColors[$argument])) {
207 207
                 $cliArgs[] = self::$foregroundColors[$argument];
208 208
                 $hasColor = true;
209 209
 
210 210
             // it's a backcolor?
211
-            } elseif ($hasColor && !$hasBackColor && isset(self::$backgroundColors[$argument])){
211
+            } elseif ($hasColor && !$hasBackColor && isset(self::$backgroundColors[$argument])) {
212 212
                 $cliArgs[] = self::$backgroundColors[$argument];
213 213
                 $hasBackColor = true;
214 214
 
215 215
             // or it's an option?
216
-            } elseif (isset(self::$options[$argument])){
216
+            } elseif (isset(self::$options[$argument])) {
217 217
                 $cliArgs[] = self::$options[$argument];
218 218
             }
219 219
         }
220 220
 
221 221
         // Add string and end coloring
222 222
         // todo \e[0m 
223
-        $coloredString .= "\033[" . implode(';',$cliArgs) .'m';
224
-        $coloredString .=  $str . "\033[0m";
223
+        $coloredString .= "\033[".implode(';', $cliArgs).'m';
224
+        $coloredString .= $str."\033[0m";
225 225
         return $coloredString;
226 226
     }
227 227
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
      */
306 306
     public static function askPassword()
307 307
     {
308
-        return self::cmd('askPassword',func_get_args());
308
+        return self::cmd('askPassword', func_get_args());
309 309
     }
310 310
 
311 311
     /**
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
      */
323 323
     public static function log()
324 324
     {
325
-        self::cmd('log',func_get_args());
325
+        self::cmd('log', func_get_args());
326 326
     }
327 327
 
328 328
     /**
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
      */
340 340
     public static function relog()
341 341
     {
342
-        self::cmd('relog',func_get_args());
342
+        self::cmd('relog', func_get_args());
343 343
     }  
344 344
        
345 345
     /**
@@ -356,20 +356,20 @@  discard block
 block discarded – undo
356 356
      */    
357 357
     public function pad($input, $padLength, $padString = ' ', $padType = STR_PAD_RIGHT)
358 358
     {
359
-        $diff = $padLength - strlen(preg_replace('#\\033\[[[0-9;*]{1,}m#', '', $input));
359
+        $diff = $padLength-strlen(preg_replace('#\\033\[[[0-9;*]{1,}m#', '', $input));
360 360
         
361
-        if ($diff > 0){
362
-            switch ($padType){
361
+        if ($diff > 0) {
362
+            switch ($padType) {
363 363
                 
364 364
                 case STR_PAD_RIGHT:
365
-                    return $input . str_repeat($padString, $diff);
365
+                    return $input.str_repeat($padString, $diff);
366 366
                 
367 367
                 case STR_PAD_LEFT:
368
-                    return str_repeat($padString, $diff ) . $input;
368
+                    return str_repeat($padString, $diff).$input;
369 369
                 
370 370
                 case STR_PAD_BOTH:
371 371
                     $padLeft = round(($diff)/2);
372
-                    return str_repeat($padString, $padLeft) . $input . str_repeat($padString, $diff - $padLeft);
372
+                    return str_repeat($padString, $padLeft).$input.str_repeat($padString, $diff-$padLeft);
373 373
             }
374 374
         }
375 375
         return $input;
Please login to merge, or discard this patch.
lib/Program.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     protected static function inArguments(array $arguments, string $shortArg, string $longArg)
49 49
     {
50
-          return array_key_exists($shortArg, $arguments) || array_key_exists($longArg, $arguments);
50
+            return array_key_exists($shortArg, $arguments) || array_key_exists($longArg, $arguments);
51 51
     }
52 52
 
53 53
     /**
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
      */
66 66
     protected static function getArgumentValue(array $arguments, string $shortArg, string $longArg)
67 67
     {
68
-          $val = array_key_exists($shortArg, $arguments) ? $arguments[$shortArg] : 
68
+            $val = array_key_exists($shortArg, $arguments) ? $arguments[$shortArg] : 
69 69
                  (array_key_exists($longArg, $arguments) ? $arguments[$longArg]  : null);
70 70
           
71 71
           
72
-          return $val;
72
+            return $val;
73 73
 
74 74
     }
75 75
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,8 +65,7 @@
 block discarded – undo
65 65
      */
66 66
     protected static function getArgumentValue(array $arguments, string $shortArg, string $longArg)
67 67
     {
68
-          $val = array_key_exists($shortArg, $arguments) ? $arguments[$shortArg] : 
69
-                 (array_key_exists($longArg, $arguments) ? $arguments[$longArg]  : null);
68
+          $val = array_key_exists($shortArg, $arguments) ? $arguments[$shortArg] : (array_key_exists($longArg, $arguments) ? $arguments[$longArg] : null);
70 69
           
71 70
           
72 71
           return $val;
Please login to merge, or discard this patch.
demo/demo.table.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ .'/../vendor/autoload.php';
2
+require_once __DIR__.'/../vendor/autoload.php';
3 3
 use Kristuff\Mishell\Console;
4 4
 
5 5
 console::resetDefaults();
6 6
 
7
-Console::log(' ' . Console::text('Basic sample', 'white', 'underlined'));
7
+Console::log(' '.Console::text('Basic sample', 'white', 'underlined'));
8 8
 Console::log();
9 9
 
10 10
 $rowHeaders = ['Index' => 10, 'Item'  => 25, 'Description' => 50];
11 11
 $rows = [
12
-    ['foo',       'some text for foo'],
13
-    ['bar',       'some text for bar'],
14
-    ['foobar',    'some text for foobar']
12
+    ['foo', 'some text for foo'],
13
+    ['bar', 'some text for bar'],
14
+    ['foobar', 'some text for foobar']
15 15
 ];
16 16
 Console::log(Console::tableSeparator($rowHeaders));
17 17
 Console::log(Console::tableRow($rowHeaders));
18 18
 Console::log(Console::tableRowSeparator($rowHeaders));
19 19
 
20
-foreach ($rows as $key => $value){
20
+foreach ($rows as $key => $value) {
21 21
     Console::log(Console::tableRow([
22 22
         $key            => 10, 
23 23
         $rows[$key][0]  => 25, 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 // -------------------------------
35 35
 // ------ ADVANCED SAMPLE --------
36 36
 // -------------------------------
37
-Console::log(' ' . Console::text('Advanced sample', 'white', 'underlined'));
37
+Console::log(' '.Console::text('Advanced sample', 'white', 'underlined'));
38 38
 Console::log();
39 39
 
40 40
 $rowHeaders = [
@@ -44,16 +44,16 @@  discard block
 block discarded – undo
44 44
 ];
45 45
 $rows = [
46 46
     [
47
-        Console::text('foo (on right)',   'white'),     
47
+        Console::text('foo (on right)', 'white'),     
48 48
         Console::text('some centered text red for foo', 'red')
49 49
     ],
50 50
     [
51
-        Console::text('bar (on right)',   'white'),     
52
-        Console::text( 'some centered text green for bar', 'green')
51
+        Console::text('bar (on right)', 'white'),     
52
+        Console::text('some centered text green for bar', 'green')
53 53
     ],
54 54
     [
55 55
         Console::text('foobar (on right)', 'white'),    
56
-        'some centered text ' .Console::text('on BLUE here', 'white', 'blue'). ' for foobar' 
56
+        'some centered text '.Console::text('on BLUE here', 'white', 'blue').' for foobar' 
57 57
     ]
58 58
 ];
59 59
 
@@ -66,24 +66,24 @@  discard block
 block discarded – undo
66 66
 Console::$tableCellPadding = '  '; // increase cell padding to 2 white chars (default is 1)
67 67
 
68 68
 // table start
69
-Console::log(Console::tableSeparator($rowHeaders));    // top line             |-----------------------  ...
70
-Console::log(Console::tableRow($rowHeaders));          // columns headers      | foo     | bar     |---  ...
69
+Console::log(Console::tableSeparator($rowHeaders)); // top line             |-----------------------  ...
70
+Console::log(Console::tableRow($rowHeaders)); // columns headers      | foo     | bar     |---  ...
71 71
 Console::log(Console::tableRowSeparator($rowHeaders)); // saparator            |---------|---------|---  ...
72
-Console::log(Console::tableRowEmpty($rowHeaders));     // empty row            |         |         |     ...
72
+Console::log(Console::tableRowEmpty($rowHeaders)); // empty row            |         |         |     ...
73 73
 
74 74
 // tables rows
75
-foreach ($rows as $key => $value){
75
+foreach ($rows as $key => $value) {
76 76
 
77 77
     Console::log(
78
-        Console::TableRowStart().    // start row with separator. Then, each cell will end with a separator 
79
-        Console::TableRowCell($key, 10).                                   //no align => default is left
80
-        Console::TableRowCell($rows[$key][0] , 25, Console::ALIGN_RIGHT).  //set align right
81
-        Console::TableRowCell($rows[$key][1] , 50, Console::ALIGN_CENTER)  //set align center
78
+        Console::TableRowStart().// start row with separator. Then, each cell will end with a separator 
79
+        Console::TableRowCell($key, 10).//no align => default is left
80
+        Console::TableRowCell($rows[$key][0], 25, Console::ALIGN_RIGHT).//set align right
81
+        Console::TableRowCell($rows[$key][1], 50, Console::ALIGN_CENTER)  //set align center
82 82
     );
83 83
 }
84 84
 
85 85
 // table end
86
-Console::log(Console::tableRowEmpty($rowHeaders));     // empty row            |         |         |     ...
86
+Console::log(Console::tableRowEmpty($rowHeaders)); // empty row            |         |         |     ...
87 87
 Console::log(Console::tableSeparator($rowHeaders)); // saparator               |-----------------------  ...
88 88
 console::resetDefaults();
89 89
 
Please login to merge, or discard this patch.
demo/demo.size.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ .'/../vendor/autoload.php';
2
+require_once __DIR__.'/../vendor/autoload.php';
3 3
 use Kristuff\Mishell\Console;
4 4
 
5
-Console::log(' '. Console::text('Overview:', 'underlined', 'bold'));
6
-Console::log("  - Use " .  Console::text("int ", 'blue'). Console::text("Console::getLines()", 'lightblue', 'underlined') . " get the number of lines in terminal.");
7
-Console::log("  - Use " .  Console::text("int ", 'blue'). Console::text("Console::getColumns()", 'lightblue', 'underlined') . " get the number of columns in terminal.");
5
+Console::log(' '.Console::text('Overview:', 'underlined', 'bold'));
6
+Console::log("  - Use ".Console::text("int ", 'blue').Console::text("Console::getLines()", 'lightblue', 'underlined')." get the number of lines in terminal.");
7
+Console::log("  - Use ".Console::text("int ", 'blue').Console::text("Console::getColumns()", 'lightblue', 'underlined')." get the number of columns in terminal.");
8 8
 Console::log();   
9 9
 Console::log();   
10
-Console::log(' '. Console::text('Sample:', 'underlined', 'bold'));
10
+Console::log(' '.Console::text('Sample:', 'underlined', 'bold'));
11 11
 Console::log();   
12 12
 
13 13
 // get columns and lines 
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 $cols  = Console::getColumns();
16 16
 
17 17
 // print value
18
-Console::log('  The number of lines is currently: ' .Console::text($lines, 'green'));
19
-Console::log('  The number of columns is currently: ' .Console::text($cols, 'green'));
18
+Console::log('  The number of lines is currently: '.Console::text($lines, 'green'));
19
+Console::log('  The number of columns is currently: '.Console::text($cols, 'green'));
20 20
 Console::log();   
21 21
 
22 22
 // build a 'full' row
Please login to merge, or discard this patch.
demo/demo.pad.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,30 +1,30 @@
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ .'/../vendor/autoload.php';
2
+require_once __DIR__.'/../vendor/autoload.php';
3 3
 use Kristuff\Mishell\Console;
4 4
 
5
-Console::log(' '. Console::text('Overview:', 'underlined', 'bold'));
6
-Console::log("  - Use " . Console::text("string ", 'blue'). Console::text("Console::pad()", 'lightblue', 'underlined') . "to get a text with given padding.");
7
-Console::log("  - The method is equivalent to php " . Console::text("str_pad()", 'lightblue', 'underlined'). " method, except that it handles not printable ANSI chars.");
5
+Console::log(' '.Console::text('Overview:', 'underlined', 'bold'));
6
+Console::log("  - Use ".Console::text("string ", 'blue').Console::text("Console::pad()", 'lightblue', 'underlined')."to get a text with given padding.");
7
+Console::log("  - The method is equivalent to php ".Console::text("str_pad()", 'lightblue', 'underlined')." method, except that it handles not printable ANSI chars.");
8 8
 Console::log();   
9
-Console::log(' '. Console::text('Sample:', 'underlined', 'bold'));
9
+Console::log(' '.Console::text('Sample:', 'underlined', 'bold'));
10 10
 
11 11
 // -----------------
12 12
 // sample start here
13 13
 // -----------------
14 14
 Console::log();     
15
-Console::log(' '. Console::text(' 1) Using ') . Console::text('php str_pad()', 'lightblue', 'underlined')); 
15
+Console::log(' '.Console::text(' 1) Using ').Console::text('php str_pad()', 'lightblue', 'underlined')); 
16 16
 Console::log();     
17 17
 Console::log(str_pad(' I am normal inside str_pad() {padLength:100, padString:\'*\'}', 100, '*'));
18 18
 Console::log(str_pad(Console::text(' I am colorized with ::text() inside str_pad() {padLength:100, padString:\'*\'}', 'lightcyan'), 100, '*'));
19 19
 Console::log();     
20
-Console::log(' '. Console::text(' => you should\'see what you expect. I guess second text has less than 100 chars... ', 'white', 'red')); 
20
+Console::log(' '.Console::text(' => you should\'see what you expect. I guess second text has less than 100 chars... ', 'white', 'red')); 
21 21
 Console::log();     
22 22
 Console::log();     
23
-Console::log(' '. Console::text(' 2) Using ') . Console::text('Console::pad()', 'lightblue', 'underlined')); 
23
+Console::log(' '.Console::text(' 2) Using ').Console::text('Console::pad()', 'lightblue', 'underlined')); 
24 24
 Console::log();     
25 25
 Console::log(Console::pad('  I am normal inside ::pad() {padLength:100, padString:\'*\'}', 100, '*'));
26 26
 Console::log(Console::pad(Console::text('  I am colorized with ::text() inside ::pad() {padLength:100, padString:\'*\'}', 'lightcyan'), 100, '*'));
27 27
 Console::log();     
28
-Console::log(' '. Console::text(' => should be OK ', 'white', 'green'));
28
+Console::log(' '.Console::text(' => should be OK ', 'white', 'green'));
29 29
 
30 30
 ?>
Please login to merge, or discard this patch.
demo/demo.progress.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 Console::log("   - you may need to use " . Console::text("php str_pad()", 'lightblue', 'underlined') . " method to be sure all previous text is overwitted.");
11 11
 Console::log("   - You can customize colors (foreground and background) and some styles in same way than ");
12 12
 Console::log('     with ' . Console::text("Console::text()", 'lightblue', 'underlined') . 
13
-                 ' and ' .  Console::text("Console::log()", 'lightblue', 'underlined'). ' methods.');
13
+                    ' and ' .  Console::text("Console::log()", 'lightblue', 'underlined'). ' methods.');
14 14
 Console::log();
15 15
 Console::log(' '. Console::text('Sample code:', 'underlined', 'bold'));
16 16
 Console::log();
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ .'/../vendor/autoload.php';
2
+require_once __DIR__.'/../vendor/autoload.php';
3 3
 use Kristuff\Mishell\Console;
4 4
 
5
-Console::log(' '. Console::text('Overview:', 'underlined', 'bold'));
6
-Console::log("  - Use " . Console::text("Console::relog()", 'lightblue', 'underlined') . " to overwrite the current line.", 'white');
5
+Console::log(' '.Console::text('Overview:', 'underlined', 'bold'));
6
+Console::log("  - Use ".Console::text("Console::relog()", 'lightblue', 'underlined')." to overwrite the current line.", 'white');
7 7
 Console::log();
8 8
 
9
-Console::log(' '. Console::text('Tips:', 'underlined', 'bold'));
10
-Console::log("   - you may need to use " . Console::text("php str_pad()", 'lightblue', 'underlined') . " method to be sure all previous text is overwitted.");
9
+Console::log(' '.Console::text('Tips:', 'underlined', 'bold'));
10
+Console::log("   - you may need to use ".Console::text("php str_pad()", 'lightblue', 'underlined')." method to be sure all previous text is overwitted.");
11 11
 Console::log("   - You can customize colors (foreground and background) and some styles in same way than ");
12
-Console::log('     with ' . Console::text("Console::text()", 'lightblue', 'underlined') . 
13
-                 ' and ' .  Console::text("Console::log()", 'lightblue', 'underlined'). ' methods.');
12
+Console::log('     with '.Console::text("Console::text()", 'lightblue', 'underlined'). 
13
+                 ' and '.Console::text("Console::log()", 'lightblue', 'underlined').' methods.');
14 14
 Console::log();
15
-Console::log(' '. Console::text('Sample code:', 'underlined', 'bold'));
15
+Console::log(' '.Console::text('Sample code:', 'underlined', 'bold'));
16 16
 Console::log();
17
-Console::log('    '.Console::text(str_pad('// fake progress loop ', 100),'green'));
17
+Console::log('    '.Console::text(str_pad('// fake progress loop ', 100), 'green'));
18 18
 Console::log('    '.Console::text(str_pad('for ($i=0 ; $i<=10 ; $i++) {', 100), 'lightgray'));
19
-Console::log('    '.Console::text(str_pad('    // Overwrite progress message.',  100), 'green'));
20
-Console::log('    '.Console::text(str_pad("    Console::relog(' I am a progress text... ['.Console::text($\i, 'green') .']% completed');",  100),'lightgray'));
19
+Console::log('    '.Console::text(str_pad('    // Overwrite progress message.', 100), 'green'));
20
+Console::log('    '.Console::text(str_pad("    Console::relog(' I am a progress text... ['.Console::text($\i, 'green') .']% completed');", 100), 'lightgray'));
21 21
 Console::log('    '.Console::text(str_pad("    // wait for a while, so we see the animation ", 100), 'green'));
22 22
 Console::log('    '.Console::text(str_pad('    usleep(300000);', 100), 'lightgray'));
23 23
 Console::log('    '.Console::text(str_pad('}', 100), 'lightgray'));
@@ -34,16 +34,16 @@  discard block
 block discarded – undo
34 34
 Console::log('    '.Console::text(str_pad("// note: you may need to use str_pad() method to be sure all previous text is overwritten", 100), 'green'));
35 35
 Console::log('    '.Console::text(str_pad("Console::relog(Console::text('Done!', 'white', 'green', 'underlined'). str_pad(' ', 100);", 100), 'lightgray'));
36 36
 Console::log();
37
-Console::log(' ' .'    '.Console::text('Sample result:', 'underlined', 'bold'));
37
+Console::log(' '.'    '.Console::text('Sample result:', 'underlined', 'bold'));
38 38
 // -----------------
39 39
 // sample start here
40 40
 // -----------------
41 41
 
42 42
 // fake progress message 
43
-for ($i=0 ; $i<=100 ; $i++) {
43
+for ($i = 0; $i <= 100; $i++) {
44 44
 
45 45
     // Overwrite progress message. 
46
-    Console::relog(' I am a progress text... ['.Console::text($i, 'green') .']% completed');
46
+    Console::relog(' I am a progress text... ['.Console::text($i, 'green').']% completed');
47 47
 
48 48
     // wait for a while, so we see the animation
49 49
     usleep(100000); 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
 // Overwrite progress message. 
61 61
 // note: you may need to use str_pad() method to be sure all previous text is overwritten.
62
-Console::relog(Console::text(' Done!', 'white', 'green', 'underlined'). str_pad(' ', 100));
62
+Console::relog(Console::text(' Done!', 'white', 'green', 'underlined').str_pad(' ', 100));
63 63
 Console::log('');
64 64
 
65 65
 ?>
Please login to merge, or discard this patch.
demo/demo.window.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ .'/../vendor/autoload.php';
2
+require_once __DIR__.'/../vendor/autoload.php';
3 3
 use Kristuff\Mishell\Console;
4 4
 
5 5
 Console::log(' Let say we are current window.');
6
-Console::log(' We will open a new window using ' . Console::text('Console::newWindow()', 'lightblue', 'underlined') . ' method.');
6
+Console::log(' We will open a new window using '.Console::text('Console::newWindow()', 'lightblue', 'underlined').' method.');
7 7
 Console::ask(' Press [Enter] to open new window > ');
8 8
 
9 9
 // ------------------
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 Console::log('          NEW WINDOW 1        ', 'green');
18 18
 Console::log(' _____________________________', 'green');
19 19
 Console::log();
20
-Console::log(' I am in new window. We will restore the window later using ' .  Console::text('Console::restoreWindow()', 'lightblue', 'underlined') . ' method.' );
20
+Console::log(' I am in new window. We will restore the window later using '.Console::text('Console::restoreWindow()', 'lightblue', 'underlined').' method.');
21 21
 Console::ask(' Press [Enter] to restore >');
22 22
 
23 23
 // ------------------
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 // ------------------
26 26
 Console::restoreWindow();
27 27
 
28
-Console::log(' We have now restored the current window using ' . Console::text('Console::restoreWindow()', 'lightblue', 'underlined') . ' method');
29
-Console::log(' We will reopen a new window using ' . Console::text('Console::newWindow()', 'lightblue', 'underlined') . ' method.');
28
+Console::log(' We have now restored the current window using '.Console::text('Console::restoreWindow()', 'lightblue', 'underlined').' method');
29
+Console::log(' We will reopen a new window using '.Console::text('Console::newWindow()', 'lightblue', 'underlined').' method.');
30 30
 Console::ask(' Press [Enter] to open new window > ');
31 31
 
32 32
 // ------------------
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 Console::log('          NEW WINDOW 2        ', 'yellow');
41 41
 Console::log(' _____________________________', 'yellow');
42 42
 Console::log();
43
-Console::log(' I am in new window. We will restore the window later using ' .  Console::text('Console::restoreWindow()', 'lightblue', 'underlined') . ' method.' );
43
+Console::log(' I am in new window. We will restore the window later using '.Console::text('Console::restoreWindow()', 'lightblue', 'underlined').' method.');
44 44
 Console::ask(' Press [Enter] to restore >');
45 45
 
46 46
 // ------------------
47 47
 // restore new window
48 48
 // ------------------
49 49
 Console::restoreWindow();
50
-Console::log(' We have now restored the current window using ' .  Console::text('Console::restoreWindow()', 'lightblue', 'underlined') . ' method. That\'s all.');
51
-Console::log(' Got it'. Console::text('?', 'green'));
50
+Console::log(' We have now restored the current window using '.Console::text('Console::restoreWindow()', 'lightblue', 'underlined').' method. That\'s all.');
51
+Console::log(' Got it'.Console::text('?', 'green'));
52 52
 
53 53
 ?>
Please login to merge, or discard this patch.
demo/demo.bgcolors.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
     $foregroundColor = ($bgcolor === 'black' || $bgcolor === 'default') ? 'white': 'black';
14 14
     Console::log('  '.Console::tableRow([
15 15
         $bgcolor        => 15, 
16
-       "\\033[" . $colorValue  .'m'  => 15, 
16
+        "\\033[" . $colorValue  .'m'  => 15, 
17 17
         Console::text(str_pad('I am a text color={' . $foregroundColor .'} on bgcolor={' . $bgcolor .'}', 48), $foregroundColor , $bgcolor) => 51
18 18
     ]));
19 19
     $i++;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ .'/../vendor/autoload.php';
2
+require_once __DIR__.'/../vendor/autoload.php';
3 3
 use Kristuff\Mishell\Console;
4 4
 
5 5
 $rowHeaders = ['Color name' => 15, ' ANSI Code'  => 15, ' Sample ouput' => 51];
@@ -9,12 +9,12 @@  discard block
 block discarded – undo
9 9
 
10 10
 // enum backgrounds
11 11
 $i = 1;
12
-foreach (Console::getStyles()['backgrounds'] as $bgcolor => $colorValue ){
13
-    $foregroundColor = ($bgcolor === 'black' || $bgcolor === 'default') ? 'white': 'black';
12
+foreach (Console::getStyles()['backgrounds'] as $bgcolor => $colorValue) {
13
+    $foregroundColor = ($bgcolor === 'black' || $bgcolor === 'default') ? 'white' : 'black';
14 14
     Console::log('  '.Console::tableRow([
15 15
         $bgcolor        => 15, 
16
-       "\\033[" . $colorValue  .'m'  => 15, 
17
-        Console::text(str_pad('I am a text color={' . $foregroundColor .'} on bgcolor={' . $bgcolor .'}', 48), $foregroundColor , $bgcolor) => 51
16
+       "\\033[".$colorValue.'m'  => 15, 
17
+        Console::text(str_pad('I am a text color={'.$foregroundColor.'} on bgcolor={'.$bgcolor.'}', 48), $foregroundColor, $bgcolor) => 51
18 18
     ]));
19 19
     $i++;
20 20
 }
Please login to merge, or discard this patch.
demo/index.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     Console::log();
117 117
 
118 118
     foreach (getIndex() as $key => $value){
119
-       if (file_exists( __DIR__ . '/'. $value[2])) {
119
+        if (file_exists( __DIR__ . '/'. $value[2])) {
120 120
             Console::log(''.
121 121
                 Console::TableRowStart().
122 122
                 Console::TableRowCell(Console::text($key,'lightgray'), 6, Console::ALIGN_CENTER).                                    //no align => default is left
@@ -162,24 +162,24 @@  discard block
 block discarded – undo
162 162
                 printSampleHeader($selectedIndex, $title);
163 163
 
164 164
                 Console::log($base . Console::text('Start running [', 'white') . 
165
-                                     Console::text( $title, 'lightcyan') . 
166
-                                     Console::text('] in file [', 'white')  .
167
-                                     Console::text( $fileName, 'lightcyan') . 
168
-                                     Console::text(']', 'white'));
165
+                                        Console::text( $title, 'lightcyan') . 
166
+                                        Console::text('] in file [', 'white')  .
167
+                                        Console::text( $fileName, 'lightcyan') . 
168
+                                        Console::text(']', 'white'));
169 169
 
170 170
                 if (file_exists($filePath)){
171 171
                     Console::log();
172 172
                     include $filePath;
173 173
                     Console::log();
174 174
                     Console::log($base . Console::text('End running [', 'white')  .
175
-                                     Console::text( $title, 'lightcyan') . 
176
-                                     Console::text(']', 'white')); 
175
+                                        Console::text( $title, 'lightcyan') . 
176
+                                        Console::text(']', 'white')); 
177 177
                     
178
-                                     $response = Console::ask($base . Console::text('Do you want to see the code that has been executed? (type y/Y to see the code) > ', 'white'));
179
-                     if (strtoupper($response) === 'Y') {
178
+                                        $response = Console::ask($base . Console::text('Do you want to see the code that has been executed? (type y/Y to see the code) > ', 'white'));
179
+                        if (strtoupper($response) === 'Y') {
180 180
                         Console::log($base . Console::text('The code in file [', 'white')  .
181
-                                     Console::text( $fileName, 'lightcyan') . 
182
-                                     Console::text('] is:', 'white')); 
181
+                                        Console::text( $fileName, 'lightcyan') . 
182
+                                        Console::text('] is:', 'white')); 
183 183
                         Console::log();
184 184
 
185 185
                         $lines = file($filePath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
@@ -197,10 +197,10 @@  discard block
 block discarded – undo
197 197
                         Console::log(Console::pad('  ', 100, '-'), 'darkgray');
198 198
                         Console::log();
199 199
                     }
200
-               } else {
200
+                } else {
201 201
                     Console::log($base . Console::text('Error' , 'red'));
202 202
                     Console::log($base . Console::text(' => File missing [' . $fileName . ']' , 'red'));
203
-               }
203
+                }
204 204
 
205 205
             } else {
206 206
                 Console::log($base . Console::text('Error:', 'red'));
Please login to merge, or discard this patch.
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ .'/../vendor/autoload.php';
2
+require_once __DIR__.'/../vendor/autoload.php';
3 3
 use Kristuff\Mishell\Console;
4 4
 
5 5
 Console::clear();
@@ -18,15 +18,15 @@  discard block
 block discarded – undo
18 18
 {
19 19
     Console::log();
20 20
     Console::log();
21
-    Console::log('    '. Console::text("             _  ____  _          _ _    ", 'red'));
22
-    Console::log('    '. Console::text("   _ __ ___ (_)/ ___|| |__   ___| | |   ", 'red'));
23
-    Console::log('    '. Console::text("  | '_ ` _ \| |\___ \| '_ \ / _ \ | |   ", 'red'));
24
-    Console::log('    '. Console::text("  | | | | | | | ___) | | | |  __/ | |   ", 'red'));
25
-    Console::log('    '. Console::text("  |_| |_| |_|_||____/|_| |_|\___|_|_|   ", 'red'));
26
-    Console::log('    '. Console::text("                                        ", 'red'));
27
-    Console::log('    '. Console::text("                 Version 1.2            ", 'red'));
28
-    Console::log('    '. Console::text("                 © 2017-2020 Kristuff   ", 'red'));
29
-    Console::log('    '. Console::text("                                        ", 'red'));
21
+    Console::log('    '.Console::text("             _  ____  _          _ _    ", 'red'));
22
+    Console::log('    '.Console::text("   _ __ ___ (_)/ ___|| |__   ___| | |   ", 'red'));
23
+    Console::log('    '.Console::text("  | '_ ` _ \| |\___ \| '_ \ / _ \ | |   ", 'red'));
24
+    Console::log('    '.Console::text("  | | | | | | | ___) | | | |  __/ | |   ", 'red'));
25
+    Console::log('    '.Console::text("  |_| |_| |_|_||____/|_| |_|\___|_|_|   ", 'red'));
26
+    Console::log('    '.Console::text("                                        ", 'red'));
27
+    Console::log('    '.Console::text("                 Version 1.2            ", 'red'));
28
+    Console::log('    '.Console::text("                 © 2017-2020 Kristuff   ", 'red'));
29
+    Console::log('    '.Console::text("                                        ", 'red'));
30 30
     Console::log();
31 31
     Console::log();
32 32
     Console::log();
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
     $pad = '    ';
35 35
 
36 36
     // fake progress message 
37
-    for ($i=0 ; $i<=100 ; $i++) {
37
+    for ($i = 0; $i <= 100; $i++) {
38 38
 
39 39
         // Overwrite progress message. 
40 40
         Console::relog($pad.Console::text('This is a fake progress message... [', 'white').
41
-                            Console::text($i .'%', 'green').
41
+                            Console::text($i.'%', 'green').
42 42
                             Console::text('] completed', 'white'));
43 43
 
44 44
         // wait for a while, so we see the animation
@@ -54,25 +54,25 @@  discard block
 block discarded – undo
54 54
 {
55 55
     $index = [];
56 56
     
57
-    $index[1] =   ['Styles',        'How to get available basic styles',                'demo.styles.php'];
58
-    $index[2] =   ['Colors',        'How to get available foreground colors',           'demo.colors.php'];
59
-    $index[3] =   ['Backgrounds',   'How to get available background colors',           'demo.bgcolors.php'];
57
+    $index[1] = ['Styles', 'How to get available basic styles', 'demo.styles.php'];
58
+    $index[2] = ['Colors', 'How to get available foreground colors', 'demo.colors.php'];
59
+    $index[3] = ['Backgrounds', 'How to get available background colors', 'demo.bgcolors.php'];
60 60
 //  $index[4] = ['Text',  'Console::text() overview',    'demo.log.php'];      
61 61
 //  $index[5] = ['Log',   'Console::log() overview',     'demo.log.php'];      
62 62
 //  $index[6] = ['ReLog', 'Console::relog() overview',   'demo.relog.php'];    
63
-    $index[7] = ['Pad',             'Console::pad() overview',                          'demo.pad.php'];
64
-    $index[8] = ['Size',  'How to get the number of columns and lines in terminal',     'demo.size.php'];
63
+    $index[7] = ['Pad', 'Console::pad() overview', 'demo.pad.php'];
64
+    $index[8] = ['Size', 'How to get the number of columns and lines in terminal', 'demo.size.php'];
65 65
     
66
-    $index[11] =  ['Ask',           'How to ask? (get user input)',                     'demo.ask.php'];
67
-    $index[12] =  ['Ask Number',    'How to ask and expect a number?',                  'demo.askint.php'];
68
-    $index[13] =  ['Ask Password',  'How to ask a password? (do not print user input)', 'demo.askpassword.php'];
66
+    $index[11] = ['Ask', 'How to ask? (get user input)', 'demo.ask.php'];
67
+    $index[12] = ['Ask Number', 'How to ask and expect a number?', 'demo.askint.php'];
68
+    $index[13] = ['Ask Password', 'How to ask a password? (do not print user input)', 'demo.askpassword.php'];
69 69
    
70
-    $index[14] =  ['Table',         'How to print a table?',                            'demo.table.php'];
71
-    $index[15] =  ['Bell',          'How to run the bell?',                             'demo.bell.php'];
72
-    $index[16] =  ['Progress',      'How to output progress message?',                  'demo.progress.php'];
73
-    $index[17] =  ['New window',    'How to open new/restore window?',                  'demo.window.php'];
70
+    $index[14] = ['Table', 'How to print a table?', 'demo.table.php'];
71
+    $index[15] = ['Bell', 'How to run the bell?', 'demo.bell.php'];
72
+    $index[16] = ['Progress', 'How to output progress message?', 'demo.progress.php'];
73
+    $index[17] = ['New window', 'How to open new/restore window?', 'demo.window.php'];
74 74
 
75
-    $index[20] = ['BlueScreen',  'Really nice full screen centered message sample',      'demo.bluescreen.php'];
75
+    $index[20] = ['BlueScreen', 'Really nice full screen centered message sample', 'demo.bluescreen.php'];
76 76
 
77 77
     return $index;
78 78
 }
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
 {
82 82
     Console::clear();
83 83
     Console::log();
84
-    Console::log(Console::text('  Kristuff/Mishell ', 'darkgray') . Console::text(' v1.2 ', 'white', 'green')); 
85
-    Console::log(Console::text('  Made with ', 'darkgray') . Console::text('♥', 'red') . Console::text(' in France', 'darkgray'));
84
+    Console::log(Console::text('  Kristuff/Mishell ', 'darkgray').Console::text(' v1.2 ', 'white', 'green')); 
85
+    Console::log(Console::text('  Made with ', 'darkgray').Console::text('♥', 'red').Console::text(' in France', 'darkgray'));
86 86
     Console::log(
87
-        Console::text('  © 2017-2020 Kristuff (', 'darkgray') . 
88
-        Console::text('https://github.com/kristuff)', 'darkgray', 'underlined') .
87
+        Console::text('  © 2017-2020 Kristuff (', 'darkgray'). 
88
+        Console::text('https://github.com/kristuff)', 'darkgray', 'underlined').
89 89
         Console::text(')', 'darkgray')
90 90
     );
91 91
     Console::log();    
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
 function printSampleHeader($index, $title)
97 97
 {
98
-    Console::log('   ' . Console::text(' - '. $index .' - ' . $title . ' ', 'white', 'blue'));
98
+    Console::log('   '.Console::text(' - '.$index.' - '.$title.' ', 'white', 'blue'));
99 99
     Console::log();
100 100
 }
101 101
 
@@ -115,11 +115,11 @@  discard block
 block discarded – undo
115 115
     Console::log(''.Console::tableRowSeparator($rowHeaders, 'darkgray'));
116 116
     Console::log();
117 117
 
118
-    foreach (getIndex() as $key => $value){
119
-       if (file_exists( __DIR__ . '/'. $value[2])) {
118
+    foreach (getIndex() as $key => $value) {
119
+       if (file_exists(__DIR__.'/'.$value[2])) {
120 120
             Console::log(''.
121 121
                 Console::TableRowStart().
122
-                Console::TableRowCell(Console::text($key,'lightgray'), 6, Console::ALIGN_CENTER).                                    //no align => default is left
122
+                Console::TableRowCell(Console::text($key, 'lightgray'), 6, Console::ALIGN_CENTER).//no align => default is left
123 123
                 Console::TableRowCell(Console::text($value[0], 'lightgray'), 15).
124 124
                 Console::TableRowCell(Console::text($value[1], 'lightgray'), 55)  
125 125
             );
@@ -129,8 +129,8 @@  discard block
 block discarded – undo
129 129
     Console::log('');
130 130
     Console::log(''.Console::tableRowSeparator($rowHeaders, 'darkgray'));
131 131
     Console::log('');
132
-    Console::log('   '. Console::text('Tips:', 'underlined', 'bold'));
133
-    Console::log('   '. Console::text(' - At any time you can stop this program using [') .Console::text('Ctrl+C', 'green') .Console::text(']'));
132
+    Console::log('   '.Console::text('Tips:', 'underlined', 'bold'));
133
+    Console::log('   '.Console::text(' - At any time you can stop this program using [').Console::text('Ctrl+C', 'green').Console::text(']'));
134 134
     Console::log('');
135 135
     // reset table separators to defaults
136 136
     Console::resetDefaults();
@@ -138,12 +138,12 @@  discard block
 block discarded – undo
138 138
 
139 139
 function askIndex()
140 140
 {
141
-    $base = Console::text(' kristuff/mishell-demo' , 'yellow');
142
-    $base .= Console::text('~$ ' , 'gray');
143
-    $selectedIndex = Console::askInt($base . Console::text(' Enter desired index then press [Enter] to run sample > ', 'white'));
141
+    $base = Console::text(' kristuff/mishell-demo', 'yellow');
142
+    $base .= Console::text('~$ ', 'gray');
143
+    $selectedIndex = Console::askInt($base.Console::text(' Enter desired index then press [Enter] to run sample > ', 'white'));
144 144
     $index = getIndex();
145 145
 
146
-    switch($selectedIndex){
146
+    switch ($selectedIndex) {
147 147
         case 0: 
148 148
             Console::log();
149 149
 //            Console::restoreWindow();
@@ -155,30 +155,30 @@  discard block
 block discarded – undo
155 155
 
156 156
                 $title      = $index[$selectedIndex][0];
157 157
                 $fileName   = $index[$selectedIndex][2];
158
-                $filePath   = __DIR__ . '/'. $fileName;
158
+                $filePath   = __DIR__.'/'.$fileName;
159 159
                 
160 160
                 Console::clear();
161 161
                 printHeader();
162 162
                 printSampleHeader($selectedIndex, $title);
163 163
 
164
-                Console::log($base . Console::text('Start running [', 'white') . 
165
-                                     Console::text( $title, 'lightcyan') . 
166
-                                     Console::text('] in file [', 'white')  .
167
-                                     Console::text( $fileName, 'lightcyan') . 
164
+                Console::log($base.Console::text('Start running [', 'white'). 
165
+                                     Console::text($title, 'lightcyan'). 
166
+                                     Console::text('] in file [', 'white').
167
+                                     Console::text($fileName, 'lightcyan'). 
168 168
                                      Console::text(']', 'white'));
169 169
 
170
-                if (file_exists($filePath)){
170
+                if (file_exists($filePath)) {
171 171
                     Console::log();
172 172
                     include $filePath;
173 173
                     Console::log();
174
-                    Console::log($base . Console::text('End running [', 'white')  .
175
-                                     Console::text( $title, 'lightcyan') . 
174
+                    Console::log($base.Console::text('End running [', 'white').
175
+                                     Console::text($title, 'lightcyan'). 
176 176
                                      Console::text(']', 'white')); 
177 177
                     
178
-                                     $response = Console::ask($base . Console::text('Do you want to see the code that has been executed? (type y/Y to see the code) > ', 'white'));
178
+                                     $response = Console::ask($base.Console::text('Do you want to see the code that has been executed? (type y/Y to see the code) > ', 'white'));
179 179
                      if (strtoupper($response) === 'Y') {
180
-                        Console::log($base . Console::text('The code in file [', 'white')  .
181
-                                     Console::text( $fileName, 'lightcyan') . 
180
+                        Console::log($base.Console::text('The code in file [', 'white').
181
+                                     Console::text($fileName, 'lightcyan'). 
182 182
                                      Console::text('] is:', 'white')); 
183 183
                         Console::log();
184 184
 
@@ -186,29 +186,29 @@  discard block
 block discarded – undo
186 186
                         $count = 1;
187 187
 
188 188
                         Console::log(Console::pad('   ', 100, '-'), 'darkgray');
189
-                        foreach($lines as $line){
189
+                        foreach ($lines as $line) {
190 190
                             $codeLine = rtrim($line);
191 191
                             $isComment = substr(ltrim($codeLine), 0, 2) === '//';
192 192
                             $isPhp = substr(ltrim($codeLine), 0, 5) === '<?php' || substr(ltrim($codeLine), 0, 2) === '?>';
193 193
                             $color = $isPhp ? 'blue' : ($isComment ? 'green' : 'lightgray');
194
-                            Console::log('   '. Console::text($codeLine, $color));
194
+                            Console::log('   '.Console::text($codeLine, $color));
195 195
                             $count++;
196 196
                         }
197 197
                         Console::log(Console::pad('  ', 100, '-'), 'darkgray');
198 198
                         Console::log();
199 199
                     }
200 200
                } else {
201
-                    Console::log($base . Console::text('Error' , 'red'));
202
-                    Console::log($base . Console::text(' => File missing [' . $fileName . ']' , 'red'));
201
+                    Console::log($base.Console::text('Error', 'red'));
202
+                    Console::log($base.Console::text(' => File missing ['.$fileName.']', 'red'));
203 203
                }
204 204
 
205 205
             } else {
206
-                Console::log($base . Console::text('Error:', 'red'));
207
-                Console::log($base . Console::text('=> the value you entered is not a valid index number.', 'red'));
206
+                Console::log($base.Console::text('Error:', 'red'));
207
+                Console::log($base.Console::text('=> the value you entered is not a valid index number.', 'red'));
208 208
                 askIndex();
209 209
             }
210 210
 
211
-            Console::ask($base . Console::text('Press [Enter] to go back to index > ', 'white'));
211
+            Console::ask($base.Console::text('Press [Enter] to go back to index > ', 'white'));
212 212
             goIndex();
213 213
     }
214 214
 }
215 215
\ No newline at end of file
Please login to merge, or discard this patch.