@@ -3,9 +3,9 @@ |
||
| 3 | 3 | use PhpSchool\CliMenu\CliMenu; |
| 4 | 4 | use PhpSchool\CliMenu\CliMenuBuilder; |
| 5 | 5 | |
| 6 | -require_once(__DIR__ . '/../vendor/autoload.php'); |
|
| 6 | +require_once(__DIR__.'/../vendor/autoload.php'); |
|
| 7 | 7 | |
| 8 | -$itemCallable = function (CliMenu $menu) { |
|
| 8 | +$itemCallable = function(CliMenu $menu) { |
|
| 9 | 9 | $menu->confirm('PHP School FTW!') |
| 10 | 10 | ->display('OK'); |
| 11 | 11 | }; |
@@ -3,9 +3,9 @@ |
||
| 3 | 3 | use PhpSchool\CliMenu\CliMenu; |
| 4 | 4 | use PhpSchool\CliMenu\CliMenuBuilder; |
| 5 | 5 | |
| 6 | -require_once(__DIR__ . '/../vendor/autoload.php'); |
|
| 6 | +require_once(__DIR__.'/../vendor/autoload.php'); |
|
| 7 | 7 | |
| 8 | -$itemCallable = function (CliMenu $menu) { |
|
| 8 | +$itemCallable = function(CliMenu $menu) { |
|
| 9 | 9 | echo $menu->getSelectedItem()->getText(); |
| 10 | 10 | }; |
| 11 | 11 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | : $this->selectedItem++; |
| 216 | 216 | |
| 217 | 217 | if (!array_key_exists($this->selectedItem, $this->items)) { |
| 218 | - $this->selectedItem = $direction === 'up' |
|
| 218 | + $this->selectedItem = $direction === 'up' |
|
| 219 | 219 | ? end($itemKeys) |
| 220 | 220 | : reset($itemKeys); |
| 221 | 221 | } elseif ($this->getSelectedItem()->canSelect()) { |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | $frame->addRows($this->drawMenuItem(new LineBreakItem($this->style->getTitleSeparator()))); |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | - array_map(function ($item, $index) use ($frame) { |
|
| 278 | + array_map(function($item, $index) use ($frame) { |
|
| 279 | 279 | $frame->addRows($this->drawMenuItem($item, $index === $this->selectedItem)); |
| 280 | 280 | }, $this->items, array_keys($this->items)); |
| 281 | 281 | |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | ? $this->style->getSelectedUnsetCode() |
| 310 | 310 | : $this->style->getUnselectedUnsetCode(); |
| 311 | 311 | |
| 312 | - return array_map(function ($row) use ($setColour, $unsetColour) { |
|
| 312 | + return array_map(function($row) use ($setColour, $unsetColour) { |
|
| 313 | 313 | return sprintf( |
| 314 | 314 | "%s%s%s%s%s%s%s\n\r", |
| 315 | 315 | str_repeat(' ', $this->style->getMargin()), |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | unset($this->items[$key]); |
| 387 | - $this->items =array_values($this->items); |
|
| 387 | + $this->items = array_values($this->items); |
|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | /** |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | ) |
| 53 | 53 | ); |
| 54 | 54 | |
| 55 | - return array_map(function ($row, $key) use ($style, $marker, $length) { |
|
| 55 | + return array_map(function($row, $key) use ($style, $marker, $length) { |
|
| 56 | 56 | $text = $this->disabled ? $style->getDisabledItemText($row) : $row; |
| 57 | 57 | |
| 58 | 58 | if ($key === 0) { |