@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | { |
| 368 | 368 | $actions = []; |
| 369 | 369 | if ($this->parent) { |
| 370 | - $actions[] = new SelectableItem($this->goBackButtonText, function (CliMenu $child) { |
|
| 370 | + $actions[] = new SelectableItem($this->goBackButtonText, function(CliMenu $child) { |
|
| 371 | 371 | if ($parent = $child->getParent()) { |
| 372 | 372 | $child->closeThis(); |
| 373 | 373 | $parent->open(); |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | }); |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | - $actions[] = new SelectableItem($this->exitButtonText, function (CliMenu $menu) { |
|
| 378 | + $actions[] = new SelectableItem($this->exitButtonText, function(CliMenu $menu) { |
|
| 379 | 379 | $menu->close(); |
| 380 | 380 | }); |
| 381 | 381 | return $actions; |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | */ |
| 398 | 398 | private function itemsHaveExtra(array $items) |
| 399 | 399 | { |
| 400 | - return !empty(array_filter($items, function (MenuItemInterface $item) { |
|
| 400 | + return !empty(array_filter($items, function(MenuItemInterface $item) { |
|
| 401 | 401 | return $item->showsItemExtra(); |
| 402 | 402 | })); |
| 403 | 403 | } |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | */ |
| 411 | 411 | private function getMenuStyle() |
| 412 | 412 | { |
| 413 | - $diff = array_udiff_assoc($this->style, $this->getStyleClassDefaults(), function ($current, $default) { |
|
| 413 | + $diff = array_udiff_assoc($this->style, $this->getStyleClassDefaults(), function($current, $default) { |
|
| 414 | 414 | if ($current instanceof TerminalInterface) { |
| 415 | 415 | return 0; |
| 416 | 416 | } |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | */ |
| 461 | 461 | private function buildSubMenus(array $items) |
| 462 | 462 | { |
| 463 | - return array_map(function ($item) { |
|
| 463 | + return array_map(function($item) { |
|
| 464 | 464 | if (!is_string($item)) { |
| 465 | 465 | return $item; |
| 466 | 466 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | */ |
| 54 | 54 | public function getRows(MenuStyle $style, $selected = false) |
| 55 | 55 | { |
| 56 | - return array_map(function ($row) use ($style) { |
|
| 56 | + return array_map(function($row) use ($style) { |
|
| 57 | 57 | $length = mb_strlen($row); |
| 58 | 58 | |
| 59 | 59 | $padding = $style->getContentWidth() - $length; |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | ) |
| 48 | 48 | ); |
| 49 | 49 | |
| 50 | - return array_map(function ($row, $key) use ($style, $marker, $length) { |
|
| 50 | + return array_map(function($row, $key) use ($style, $marker, $length) { |
|
| 51 | 51 | if ($key === 0) { |
| 52 | 52 | return $this->showItemExtra |
| 53 | 53 | ? sprintf('%s%s %s', $row, str_repeat(' ', $length - mb_strlen($row)), $style->getItemExtra()) |
@@ -305,7 +305,7 @@ |
||
| 305 | 305 | */ |
| 306 | 306 | public function setWidth($width) |
| 307 | 307 | { |
| 308 | - $availableWidth = $this->terminal->getWidth() - ($this->margin * 2) - ($this->padding * 2); |
|
| 308 | + $availableWidth = $this->terminal->getWidth() - ($this->margin*2) - ($this->padding*2); |
|
| 309 | 309 | |
| 310 | 310 | if ($width >= $availableWidth) { |
| 311 | 311 | $width = $availableWidth; |
@@ -106,7 +106,7 @@ |
||
| 106 | 106 | exec('stty -icanon'); |
| 107 | 107 | $this->isCanonical = true; |
| 108 | 108 | } else { |
| 109 | - exec('stty ' . $this->getOriginalConfiguration()); |
|
| 109 | + exec('stty '.$this->getOriginalConfiguration()); |
|
| 110 | 110 | $this->isCanonical = false; |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | public static function wordwrap($str, $width, $break = "\n") |
| 23 | 23 | { |
| 24 | 24 | $length = 0; |
| 25 | - return implode(" ", array_map(function ($word) use (&$length, $width, $break) { |
|
| 25 | + return implode(" ", array_map(function($word) use (&$length, $width, $break) { |
|
| 26 | 26 | $length += (mb_strlen($word) + 1); |
| 27 | 27 | |
| 28 | 28 | if ($length > $width) { |