@@ -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) |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $i = 0; |
| 126 | 126 | foreach (getIndex() as $key => $value){ |
| 127 | 127 | |
| 128 | - if (file_exists( __DIR__ . '/'. $value[2])) { |
|
| 128 | + if (file_exists( __DIR__ . '/'. $value[2])) { |
|
| 129 | 129 | Console::log(' '. |
| 130 | 130 | Console::tableRow([ |
| 131 | 131 | $key => 10, |
@@ -179,23 +179,23 @@ discard block |
||
| 179 | 179 | writeSampleHeader($selectedIndex, $title); |
| 180 | 180 | |
| 181 | 181 | Console::log($base . Console::text('Start running [', 'white') . |
| 182 | - Console::text( $title, 'lightcyan') . |
|
| 183 | - Console::text('] in file [', 'white') . |
|
| 184 | - Console::text( $fileName, 'lightcyan') . |
|
| 185 | - Console::text(']', 'white')); |
|
| 182 | + Console::text( $title, 'lightcyan') . |
|
| 183 | + Console::text('] in file [', 'white') . |
|
| 184 | + Console::text( $fileName, 'lightcyan') . |
|
| 185 | + Console::text(']', 'white')); |
|
| 186 | 186 | |
| 187 | 187 | if (file_exists($filePath)){ |
| 188 | 188 | Console::log(); |
| 189 | 189 | include $filePath; |
| 190 | 190 | Console::log(); |
| 191 | 191 | Console::log($base . Console::text('End running [', 'white') . |
| 192 | - Console::text( $title, 'lightcyan') . |
|
| 193 | - Console::text(']', 'white')); |
|
| 192 | + Console::text( $title, 'lightcyan') . |
|
| 193 | + Console::text(']', 'white')); |
|
| 194 | 194 | $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')); |
| 195 | - if (strtoupper($response) === 'Y') { |
|
| 195 | + if (strtoupper($response) === 'Y') { |
|
| 196 | 196 | Console::log($base . Console::text('The code in file [', 'white') . |
| 197 | - Console::text( $fileName, 'lightcyan') . |
|
| 198 | - Console::text('] is:', 'white')); |
|
| 197 | + Console::text( $fileName, 'lightcyan') . |
|
| 198 | + Console::text('] is:', 'white')); |
|
| 199 | 199 | Console::log(); |
| 200 | 200 | |
| 201 | 201 | $lines = file($filePath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
@@ -211,10 +211,10 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | Console::log(); |
| 213 | 213 | } |
| 214 | - } else { |
|
| 214 | + } else { |
|
| 215 | 215 | Console::log($base . Console::text('Error' , 'red')); |
| 216 | 216 | Console::log($base . Console::text(' => File missing [' . $fileName . ']' , 'red')); |
| 217 | - } |
|
| 217 | + } |
|
| 218 | 218 | |
| 219 | 219 | } else { |
| 220 | 220 | Console::log($base . Console::text('Error:', 'red')); |
@@ -19,11 +19,11 @@ |
||
| 19 | 19 | |
| 20 | 20 | foreach (Console::getStyles()[ 'options' ] as $option => $value){ |
| 21 | 21 | Console::log(' ' . |
| 22 | - Console::tableRow([ |
|
| 23 | - $index => 7, |
|
| 24 | - $option => 15, |
|
| 25 | - "\\033[" . $value .'m' => 15, |
|
| 26 | - Console::text(str_pad('I am a text style={' . $option .'}', 48), $option) => 50 |
|
| 22 | + Console::tableRow([ |
|
| 23 | + $index => 7, |
|
| 24 | + $option => 15, |
|
| 25 | + "\\033[" . $value .'m' => 15, |
|
| 26 | + Console::text(str_pad('I am a text style={' . $option .'}', 48), $option) => 50 |
|
| 27 | 27 | ])); |
| 28 | 28 | Console::log(' '.Console::tableRowEmpty($rowHeaders)); // add blank row between element |
| 29 | 29 | $index++; |
@@ -14,9 +14,9 @@ |
||
| 14 | 14 | |
| 15 | 15 | foreach (Console::getStyles()['foregrounds'] as $color => $colorValue ){ |
| 16 | 16 | Console::log(' '.Console::tableRow([ |
| 17 | - ' ' . $i => 7, |
|
| 17 | + ' ' . $i => 7, |
|
| 18 | 18 | $color => 15, |
| 19 | - "\\033[" . $colorValue .'m' => 15, |
|
| 19 | + "\\033[" . $colorValue .'m' => 15, |
|
| 20 | 20 | Console::text(str_pad('I am a text color={' . $color .'}', 48), $color) => 50 |
| 21 | 21 | ])); |
| 22 | 22 | $i++; |
@@ -13,9 +13,9 @@ |
||
| 13 | 13 | foreach (Console::getStyles()['backgrounds'] as $bgcolor => $colorValue ){ |
| 14 | 14 | $foregroundColor = $bgcolor === 'black' ? 'white': 'black'; |
| 15 | 15 | Console::log(' '.Console::tableRow([ |
| 16 | - ' ' . $i => 7, |
|
| 16 | + ' ' . $i => 7, |
|
| 17 | 17 | $bgcolor => 15, |
| 18 | - "\\033[" . $colorValue .'m' => 15, |
|
| 18 | + "\\033[" . $colorValue .'m' => 15, |
|
| 19 | 19 | Console::text(str_pad('I am a text color={' . $foregroundColor .'} on bgcolor={' . $bgcolor .'}', 48), $foregroundColor , $bgcolor) => 50 |
| 20 | 20 | ])); |
| 21 | 21 | $i++; |
@@ -16,13 +16,13 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | $headerStyles = [' ' => 31, |
| 19 | - 'none' => 6, |
|
| 20 | - 'bold' => 6, |
|
| 21 | - 'underline' => 12, |
|
| 22 | - 'blink' => 7, |
|
| 23 | - 'reverse' => 10, |
|
| 24 | - ' ' => 50 |
|
| 25 | - ]; |
|
| 19 | + 'none' => 6, |
|
| 20 | + 'bold' => 6, |
|
| 21 | + 'underline' => 12, |
|
| 22 | + 'blink' => 7, |
|
| 23 | + 'reverse' => 10, |
|
| 24 | + ' ' => 50 |
|
| 25 | + ]; |
|
| 26 | 26 | |
| 27 | 27 | Console::log(' '.Console::tableRowSeparator($rowHeaders1)); |
| 28 | 28 | Console::log(' '.Console::tableRow($rowHeaders1)); |
@@ -37,13 +37,13 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | foreach (Console::getStyles()['backgrounds'] as $color => $colorValue ){ |
| 39 | 39 | Console::log(' '.Console::tableRow([ |
| 40 | - ' ' . $i => 7, |
|
| 40 | + ' ' . $i => 7, |
|
| 41 | 41 | $color => 15, |
| 42 | - "\\033[" . $colorValue .'m' => 15, |
|
| 42 | + "\\033[" . $colorValue .'m' => 15, |
|
| 43 | 43 | Console::text(str_pad('I am a text color={normal} bgcolor={' . $color .'}', 48), 'normal', $color) => 50 |
| 44 | 44 | ])); |
| 45 | 45 | Console::log(' '.Console::tableEmptyRow(); |
| 46 | - $i++; |
|
| 46 | + $i++; |
|
| 47 | 47 | } |
| 48 | 48 | Console::log(' '.Console::tableRowEmpty($rowHeaders1)); |
| 49 | 49 | Console::log(' '.Console::tableRowSeparator($rowHeaders1)); |