@@ -134,16 +134,16 @@ discard block |
||
| 134 | 134 | $largestItemExtra = $this->calculateItemExtra(); |
| 135 | 135 | |
| 136 | 136 | $length = $largestItemExtra > 0 |
| 137 | - ? floor($style->getContentWidth() / $numberOfItems) - ($largestItemExtra + 2) |
|
| 138 | - : floor($style->getContentWidth() / $numberOfItems); |
|
| 137 | + ? floor($style->getContentWidth()/$numberOfItems) - ($largestItemExtra + 2) |
|
| 138 | + : floor($style->getContentWidth()/$numberOfItems); |
|
| 139 | 139 | |
| 140 | 140 | $length -= $this->gutter; |
| 141 | 141 | $length = (int) $length; |
| 142 | 142 | |
| 143 | - $missingLength = $style->getContentWidth() % $numberOfItems; |
|
| 143 | + $missingLength = $style->getContentWidth()%$numberOfItems; |
|
| 144 | 144 | |
| 145 | 145 | return $this->buildRows( |
| 146 | - mapWithKeys($this->items, function (int $index, MenuItemInterface $item) use ($selected, $length, $style) { |
|
| 146 | + mapWithKeys($this->items, function(int $index, MenuItemInterface $item) use ($selected, $length, $style) { |
|
| 147 | 147 | $isSelected = $selected && $index === $this->selectedItemIndex; |
| 148 | 148 | |
| 149 | 149 | $marker = $item->getStyle()->getMarker($item, $isSelected); |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $extraPadLength = $largestItemExtra > 0 ? 2 + $largestItemExtra : 0; |
| 183 | 183 | |
| 184 | 184 | return array_map( |
| 185 | - function ($i) use ($cells, $length, $missingLength, $extraPadLength) { |
|
| 185 | + function($i) use ($cells, $length, $missingLength, $extraPadLength) { |
|
| 186 | 186 | return $this->buildRow($cells, $i, $length, $missingLength, $extraPadLength); |
| 187 | 187 | }, |
| 188 | 188 | range(0, max(array_map('count', $cells)) - 1) |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | implode( |
| 197 | 197 | '', |
| 198 | 198 | array_map( |
| 199 | - function ($cell) use ($index, $length, $extraPadLength) { |
|
| 199 | + function($cell) use ($index, $length, $extraPadLength) { |
|
| 200 | 200 | return $cell[$index] ?? str_repeat(' ', $length + $this->gutter + $extraPadLength); |
| 201 | 201 | }, |
| 202 | 202 | $cells |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | bool $isSelected, |
| 214 | 214 | string $itemExtra |
| 215 | 215 | ) : array { |
| 216 | - return array_map(function ($row, $index) use ($length, $style, $isSelected, $itemExtra) { |
|
| 216 | + return array_map(function($row, $index) use ($length, $style, $isSelected, $itemExtra) { |
|
| 217 | 217 | $invertedColoursSetCode = $isSelected |
| 218 | 218 | ? $style->getInvertedColoursSetCode() |
| 219 | 219 | : ''; |
@@ -337,10 +337,10 @@ discard block |
||
| 337 | 337 | private function calculateItemExtra() : int |
| 338 | 338 | { |
| 339 | 339 | return max(array_map( |
| 340 | - function (MenuItemInterface $item) { |
|
| 340 | + function(MenuItemInterface $item) { |
|
| 341 | 341 | return mb_strlen($item->getStyle()->getItemExtra()); |
| 342 | 342 | }, |
| 343 | - array_filter($this->items, function (MenuItemInterface $item) { |
|
| 343 | + array_filter($this->items, function(MenuItemInterface $item) { |
|
| 344 | 344 | return $item->getStyle()->getDisplaysExtra(); |
| 345 | 345 | }) |
| 346 | 346 | )); |
@@ -365,19 +365,19 @@ discard block |
||
| 365 | 365 | public function propagateStyles(CliMenu $parent): void |
| 366 | 366 | { |
| 367 | 367 | each( |
| 368 | - array_filter($this->getItems(), function (MenuItemInterface $item) { |
|
| 368 | + array_filter($this->getItems(), function(MenuItemInterface $item) { |
|
| 369 | 369 | return !$item->getStyle()->hasChangedFromDefaults(); |
| 370 | 370 | }), |
| 371 | - function ($index, $item) use ($parent) { |
|
| 371 | + function($index, $item) use ($parent) { |
|
| 372 | 372 | $item->setStyle(clone $parent->getItemStyleForItem($item)); |
| 373 | 373 | } |
| 374 | 374 | ); |
| 375 | 375 | |
| 376 | 376 | each( |
| 377 | - array_filter($this->getItems(), function (MenuItemInterface $item) { |
|
| 377 | + array_filter($this->getItems(), function(MenuItemInterface $item) { |
|
| 378 | 378 | return $item instanceof PropagatesStyles; |
| 379 | 379 | }), |
| 380 | - function ($index, PropagatesStyles $item) use ($parent) { |
|
| 380 | + function($index, PropagatesStyles $item) use ($parent) { |
|
| 381 | 381 | $item->propagateStyles($parent); |
| 382 | 382 | } |
| 383 | 383 | ); |