@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | protected static $defaultVerticalSign = '|'; |
| 60 | 60 | |
| 61 | - /** |
|
| 62 | - * The default vertical sign. |
|
| 63 | - * |
|
| 64 | - * @access protected |
|
| 65 | - * @var string |
|
| 66 | - */ |
|
| 61 | + /** |
|
| 62 | + * The default vertical sign. |
|
| 63 | + * |
|
| 64 | + * @access protected |
|
| 65 | + * @var string |
|
| 66 | + */ |
|
| 67 | 67 | protected static $defaultVerticalInnerSign = '+'; |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | public static $verticalSeparator = '|'; |
| 100 | 100 | |
| 101 | - /** |
|
| 101 | + /** |
|
| 102 | 102 | * The vertical separator sign. |
| 103 | 103 | * |
| 104 | 104 | * @access public |
@@ -148,17 +148,17 @@ discard block |
||
| 148 | 148 | return self::getCliString(self::$verticalInnerSeparator === '' ? $str : substr($str, 0, strlen($str) -1). self::$verticalSeparator, $args); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - /** |
|
| 152 | - * Gets a formated table row separator |
|
| 153 | - * |
|
| 154 | - * @access public |
|
| 155 | - * @static method |
|
| 156 | - * @param string [$color] The text color for the wall row |
|
| 157 | - * @param string [$bgcolor] The back color for the wall row |
|
| 158 | - * @param string [$option]+... The text styles for the wall row |
|
| 159 | - * |
|
| 160 | - * @return string |
|
| 161 | - */ |
|
| 151 | + /** |
|
| 152 | + * Gets a formated table row separator |
|
| 153 | + * |
|
| 154 | + * @access public |
|
| 155 | + * @static method |
|
| 156 | + * @param string [$color] The text color for the wall row |
|
| 157 | + * @param string [$bgcolor] The back color for the wall row |
|
| 158 | + * @param string [$option]+... The text styles for the wall row |
|
| 159 | + * |
|
| 160 | + * @return string |
|
| 161 | + */ |
|
| 162 | 162 | public static function tableSeparator() |
| 163 | 163 | { |
| 164 | 164 | $args = func_get_args(); |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | * |
| 248 | 248 | * @return string |
| 249 | 249 | */ |
| 250 | - public static function tableRow() |
|
| 250 | + public static function tableRow() |
|
| 251 | 251 | { |
| 252 | 252 | // get and parse arguments: |
| 253 | 253 | // - extract first argument (columns list) |
@@ -47,7 +47,7 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -10,7 +10,7 @@ |
||
| 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(); |
@@ -13,7 +13,7 @@ |
||
| 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++; |
@@ -116,7 +116,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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')); |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | Console::log(' '. Console::text('Tips:', 'underlined', 'bold')); |
| 10 | 10 | Console::log(" - You can customize colors (foreground and background) and some styles in same way than "); |
| 11 | 11 | Console::log(' with ' . Console::text("Console::text()", 'lightblue', 'underlined') . |
| 12 | - ' and ' . Console::text("Console::log()", 'lightblue', 'underlined'). ' methods.'); |
|
| 12 | + ' and ' . Console::text("Console::log()", 'lightblue', 'underlined'). ' methods.'); |
|
| 13 | 13 | Console::log(); |
| 14 | 14 | Console::log(' '. Console::text('Usage:', 'underlined', 'bold')); |
| 15 | 15 | Console::log(' '. Console::text("\$value = Console::ask('Please enter something > ');", 'lightmagenta')); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | Console::log(' '. Console::text('Tips:', 'underlined', 'bold')); |
| 9 | 9 | Console::log(" - You can customize colors (foreground and background) and some styles in same way than "); |
| 10 | 10 | Console::log(' with ' . Console::text("Console::text()", 'lightblue', 'underlined') . |
| 11 | - ' and ' . Console::text("Console::log()", 'lightblue', 'underlined'). ' methods.'); |
|
| 11 | + ' and ' . Console::text("Console::log()", 'lightblue', 'underlined'). ' methods.'); |
|
| 12 | 12 | Console::log(); |
| 13 | 13 | Console::log(' '. Console::text('Warning:', 'underlined', 'bold')); |
| 14 | 14 | Console::log(' '. Console::text("User input are not hidden on windows platform (not supported)", 'red', 'yellow')); |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | Console::log(" - The method returns " . Console::text("int", 'blue') . " value or " . Console::text("false", 'blue'). " if the entered value is not a valid int number."); |
| 10 | 10 | Console::log(" - You can customize colors (foreground and background) and some styles in same way than "); |
| 11 | 11 | Console::log(' with ' . Console::text("Console::text()", 'lightblue', 'underlined') . |
| 12 | - ' and ' . Console::text("Console::log()", 'lightblue', 'underlined'). ' methods.'); |
|
| 12 | + ' and ' . Console::text("Console::log()", 'lightblue', 'underlined'). ' methods.'); |
|
| 13 | 13 | Console::log(); |
| 14 | 14 | Console::log(' '. Console::text('Usage:', 'underlined', 'bold')); |
| 15 | 15 | Console::log(' ' . Console::text("\$value = Console::askInt('Please enter a number > ');", 'lightmagenta')); |
@@ -12,9 +12,9 @@ |
||
| 12 | 12 | $i = 1; |
| 13 | 13 | foreach (Console::getStyles()['foregrounds'] as $color => $colorValue ){ |
| 14 | 14 | Console::log(' '.Console::tableRow([ |
| 15 | - ' ' . $i => 7, |
|
| 15 | + ' ' . $i => 7, |
|
| 16 | 16 | $color => 15, |
| 17 | - "\\033[" . $colorValue .'m' => 15, |
|
| 17 | + "\\033[" . $colorValue .'m' => 15, |
|
| 18 | 18 | Console::text(str_pad('I am a text color={' . $color .'}', 48), $color) => 50 |
| 19 | 19 | ])); |
| 20 | 20 | $i++; |