@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | protected function calculateContentWidth() : void |
| 314 | 314 | { |
| 315 | 315 | $this->contentWidth = $this->width |
| 316 | - - ($this->paddingLeftRight * 2) |
|
| 316 | + - ($this->paddingLeftRight*2) |
|
| 317 | 317 | - ($this->borderRightWidth + $this->borderLeftWidth); |
| 318 | 318 | |
| 319 | 319 | if ($this->contentWidth < 0) { |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | public function setMarginAuto() : self |
| 467 | 467 | { |
| 468 | 468 | $this->marginAuto = true; |
| 469 | - $this->margin = floor(($this->terminal->getWidth() - $this->width) / 2); |
|
| 469 | + $this->margin = floor(($this->terminal->getWidth() - $this->width)/2); |
|
| 470 | 470 | |
| 471 | 471 | $this->generateBorderRows(); |
| 472 | 472 | $this->generatePaddingTopBottomRows(); |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | : $this->selectedItem++; |
| 284 | 284 | |
| 285 | 285 | if (!array_key_exists($this->selectedItem, $this->items)) { |
| 286 | - $this->selectedItem = $direction === 'UP' |
|
| 286 | + $this->selectedItem = $direction === 'UP' |
|
| 287 | 287 | ? end($itemKeys) |
| 288 | 288 | : reset($itemKeys); |
| 289 | 289 | } elseif ($this->getSelectedItem()->canSelect()) { |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | $frame->addRows($this->drawMenuItem(new LineBreakItem($this->style->getTitleSeparator()))); |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | - array_map(function ($item, $index) use ($frame) { |
|
| 390 | + array_map(function($item, $index) use ($frame) { |
|
| 391 | 391 | $frame->addRows($this->drawMenuItem($item, $index === $this->selectedItem)); |
| 392 | 392 | }, $this->items, array_keys($this->items)); |
| 393 | 393 | |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | $borderColour = ''; |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | - return array_map(function ($row) use ($invertedColoursSetCode, $invertedColoursUnsetCode, $borderColour) { |
|
| 441 | + return array_map(function($row) use ($invertedColoursSetCode, $invertedColoursUnsetCode, $borderColour) { |
|
| 442 | 442 | return sprintf( |
| 443 | 443 | "%s%s%s%s%s%s%s%s%s%s%s%s\n", |
| 444 | 444 | str_repeat(' ', $this->style->getMargin()), |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | public function end() : CliMenuBuilder |
| 98 | 98 | { |
| 99 | - $this->items = array_map(function ($item) { |
|
| 99 | + $this->items = array_map(function($item) { |
|
| 100 | 100 | if (!is_string($item) || empty($this->subMenuBuilders[$item])) { |
| 101 | 101 | return $item; |
| 102 | 102 | } |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $length = $style->getDisplaysExtra() |
| 128 | - ? floor(($style->getContentWidth() - mb_strlen($style->getItemExtra()) + 2) / $numberOfItems) - $this->margin |
|
| 129 | - : floor($style->getContentWidth() / $numberOfItems) - $this->margin; |
|
| 130 | - $missingLength = $style->getContentWidth() % $numberOfItems; |
|
| 128 | + ? floor(($style->getContentWidth() - mb_strlen($style->getItemExtra()) + 2)/$numberOfItems) - $this->margin |
|
| 129 | + : floor($style->getContentWidth()/$numberOfItems) - $this->margin; |
|
| 130 | + $missingLength = $style->getContentWidth()%$numberOfItems; |
|
| 131 | 131 | |
| 132 | 132 | $lines = 0; |
| 133 | 133 | $cells = []; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | sprintf('%s%s', $marker, $item->getText()), |
| 139 | 139 | $length |
| 140 | 140 | ); |
| 141 | - $cell = array_map(function ($row) use ($index, $length, $style, $isSelected) { |
|
| 141 | + $cell = array_map(function($row) use ($index, $length, $style, $isSelected) { |
|
| 142 | 142 | $invertedColoursSetCode = $isSelected |
| 143 | 143 | ? $style->getInvertedColoursSetCode() |
| 144 | 144 | : ''; |