@@ -248,9 +248,9 @@ |
||
| 248 | 248 | |
| 249 | 249 | foreach ($choices as $choice => $desc) { |
| 250 | 250 | $this->writer->eol() |
| 251 | - ->cyan( |
|
| 252 | - str_pad(' [' . $choice . ']', $maxLength + 6) |
|
| 253 | - ); |
|
| 251 | + ->cyan( |
|
| 252 | + str_pad(' [' . $choice . ']', $maxLength + 6) |
|
| 253 | + ); |
|
| 254 | 254 | |
| 255 | 255 | $this->writer->dim($desc); |
| 256 | 256 | } |
@@ -58,8 +58,7 @@ discard block |
||
| 58 | 58 | * Class Interactor |
| 59 | 59 | * @package Platine\Console\IO |
| 60 | 60 | */ |
| 61 | -class Interactor |
|
| 62 | -{ |
|
| 61 | +class Interactor { |
|
| 63 | 62 | |
| 64 | 63 | /** |
| 65 | 64 | * Stream reader instance |
@@ -78,8 +77,7 @@ discard block |
||
| 78 | 77 | * @param string|null $input |
| 79 | 78 | * @param string|null $output |
| 80 | 79 | */ |
| 81 | - public function __construct(?string $input = null, ?string $output = null) |
|
| 82 | - { |
|
| 80 | + public function __construct(?string $input = null, ?string $output = null) { |
|
| 83 | 81 | $this->reader = new Reader($input); |
| 84 | 82 | $this->writer = new Writer($output); |
| 85 | 83 | } |
@@ -124,8 +122,7 @@ discard block |
||
| 124 | 122 | * |
| 125 | 123 | * @return mixed |
| 126 | 124 | */ |
| 127 | - public function choice(string $text, array $choices, $default = null, bool $case = false) |
|
| 128 | - { |
|
| 125 | + public function choice(string $text, array $choices, $default = null, bool $case = false) { |
|
| 129 | 126 | $this->writer->yellow($text); |
| 130 | 127 | |
| 131 | 128 | $this->listOptions($choices, $default, false); |
@@ -146,8 +143,7 @@ discard block |
||
| 146 | 143 | * |
| 147 | 144 | * @return mixed |
| 148 | 145 | */ |
| 149 | - public function choices(string $text, array $choices, $default = null, bool $case = false) |
|
| 150 | - { |
|
| 146 | + public function choices(string $text, array $choices, $default = null, bool $case = false) { |
|
| 151 | 147 | $this->writer->yellow($text); |
| 152 | 148 | |
| 153 | 149 | $this->listOptions($choices, $default, true); |
@@ -52,8 +52,7 @@ discard block |
||
| 52 | 52 | * Class Writer |
| 53 | 53 | * @package Platine\Console\Output |
| 54 | 54 | */ |
| 55 | -class Writer |
|
| 56 | -{ |
|
| 55 | +class Writer { |
|
| 57 | 56 | |
| 58 | 57 | /** |
| 59 | 58 | * The output stream |
@@ -90,8 +89,7 @@ discard block |
||
| 90 | 89 | * @param string|null $path the output write path |
| 91 | 90 | * @param Color|null $color the color instance |
| 92 | 91 | */ |
| 93 | - public function __construct(?string $path = null, ?Color $color = null) |
|
| 94 | - { |
|
| 92 | + public function __construct(?string $path = null, ?Color $color = null) { |
|
| 95 | 93 | $stream = null; |
| 96 | 94 | if ($path !== null) { |
| 97 | 95 | $stream = fopen($path, 'w'); |
@@ -52,8 +52,7 @@ |
||
| 52 | 52 | * Class Color |
| 53 | 53 | * @package Platine\Console\Output |
| 54 | 54 | */ |
| 55 | -class Color |
|
| 56 | -{ |
|
| 55 | +class Color { |
|
| 57 | 56 | |
| 58 | 57 | /** |
| 59 | 58 | * The color constants |
@@ -52,8 +52,7 @@ |
||
| 52 | 52 | * Class Cursor |
| 53 | 53 | * @package Platine\Console\Output |
| 54 | 54 | */ |
| 55 | -class Cursor |
|
| 56 | -{ |
|
| 55 | +class Cursor { |
|
| 57 | 56 | |
| 58 | 57 | /** |
| 59 | 58 | * Returns signal to move cursor up "count" times. |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | list($start, $end) = $normalizedStyles['head']; |
| 81 | 81 | foreach ($head as $col => $size) { |
| 82 | 82 | $dash[] = str_repeat('-', (int) $size + 2); |
| 83 | - $title[] = str_pad(Helper::toWords($col), (int)$size, ' '); |
|
| 83 | + $title[] = str_pad(Helper::toWords($col), (int) $size, ' '); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | $titleStr = '|' . $start . ' ' |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $parts = []; |
| 93 | 93 | list($start, $end) = $normalizedStyles[['even', 'odd'][(int) $odd]]; |
| 94 | 94 | foreach ($head as $col => $size) { |
| 95 | - $parts[] = str_pad(isset($row[$col]) ? $row[$col] : '', (int)$size, ' '); |
|
| 95 | + $parts[] = str_pad(isset($row[$col]) ? $row[$col] : '', (int) $size, ' '); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | $odd = !$odd; |
@@ -55,8 +55,7 @@ |
||
| 55 | 55 | * Class Table |
| 56 | 56 | * @package Platine\Console\Output |
| 57 | 57 | */ |
| 58 | -class Table |
|
| 59 | -{ |
|
| 58 | +class Table { |
|
| 60 | 59 | |
| 61 | 60 | /** |
| 62 | 61 | * Render table data |