@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | protected function calculateContentWidth() : void |
348 | 348 | { |
349 | 349 | $this->contentWidth = $this->width |
350 | - - ($this->paddingLeftRight * 2) |
|
350 | + - ($this->paddingLeftRight*2) |
|
351 | 351 | - ($this->borderRightWidth + $this->borderLeftWidth); |
352 | 352 | |
353 | 353 | if ($this->contentWidth < 0) { |
@@ -417,8 +417,8 @@ discard block |
||
417 | 417 | |
418 | 418 | private function maybeShrinkWidth(int $margin, int $width) : int |
419 | 419 | { |
420 | - if ($width + ($margin * 2) >= $this->terminal->getWidth()) { |
|
421 | - $width = $this->terminal->getWidth() - ($margin * 2); |
|
420 | + if ($width + ($margin*2) >= $this->terminal->getWidth()) { |
|
421 | + $width = $this->terminal->getWidth() - ($margin*2); |
|
422 | 422 | |
423 | 423 | if ($width <= 0) { |
424 | 424 | throw CannotShrinkMenuException::fromMarginAndTerminalWidth($margin, $this->terminal->getWidth()); |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | |
534 | 534 | private function calculateMarginAuto(int $width) : void |
535 | 535 | { |
536 | - $this->margin = (int) floor(($this->terminal->getWidth() - ($width)) / 2); |
|
536 | + $this->margin = (int) floor(($this->terminal->getWidth() - ($width))/2); |
|
537 | 537 | } |
538 | 538 | |
539 | 539 | public function setMargin(int $margin) : self |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | ) |
71 | 71 | ); |
72 | 72 | |
73 | - return mapWithKeys($rows, function (int $key, string $row) use ($style, $length) { |
|
73 | + return mapWithKeys($rows, function(int $key, string $row) use ($style, $length) { |
|
74 | 74 | $text = $this->disabled ? $style->getDisabledItemText($row) : $row; |
75 | 75 | |
76 | 76 | if ($key === 0) { |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function getSelectAction() : ?callable |
111 | 111 | { |
112 | - return function (CliMenu $menu) { |
|
112 | + return function(CliMenu $menu) { |
|
113 | 113 | $this->showSubMenu($menu); |
114 | 114 | }; |
115 | 115 | } |
@@ -71,7 +71,7 @@ |
||
71 | 71 | ) |
72 | 72 | ); |
73 | 73 | |
74 | - return mapWithKeys($rows, function (int $key, string $row) use ($style, $length) { |
|
74 | + return mapWithKeys($rows, function(int $key, string $row) use ($style, $length) { |
|
75 | 75 | $text = $this->disabled ? $style->getDisabledItemText($row) : $row; |
76 | 76 | |
77 | 77 | if ($key === 0) { |
@@ -121,16 +121,16 @@ discard block |
||
121 | 121 | $largestItemExtra = $this->calculateItemExtra(); |
122 | 122 | |
123 | 123 | $length = $largestItemExtra > 0 |
124 | - ? floor($style->getContentWidth() / $numberOfItems) - ($largestItemExtra + 2) |
|
125 | - : floor($style->getContentWidth() / $numberOfItems); |
|
124 | + ? floor($style->getContentWidth()/$numberOfItems) - ($largestItemExtra + 2) |
|
125 | + : floor($style->getContentWidth()/$numberOfItems); |
|
126 | 126 | |
127 | 127 | $length -= $this->gutter; |
128 | 128 | $length = (int) $length; |
129 | 129 | |
130 | - $missingLength = $style->getContentWidth() % $numberOfItems; |
|
130 | + $missingLength = $style->getContentWidth()%$numberOfItems; |
|
131 | 131 | |
132 | 132 | return $this->buildRows( |
133 | - mapWithKeys($this->items, function (int $index, MenuItemInterface $item) use ($selected, $length, $style) { |
|
133 | + mapWithKeys($this->items, function(int $index, MenuItemInterface $item) use ($selected, $length, $style) { |
|
134 | 134 | $isSelected = $selected && $index === $this->selectedItemIndex; |
135 | 135 | |
136 | 136 | if ($item instanceof CheckboxItem || $item instanceof RadioItem) { |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $extraPadLength = $largestItemExtra > 0 ? 2 + $largestItemExtra : 0; |
179 | 179 | |
180 | 180 | return array_map( |
181 | - function ($i) use ($cells, $length, $missingLength, $extraPadLength) { |
|
181 | + function($i) use ($cells, $length, $missingLength, $extraPadLength) { |
|
182 | 182 | return $this->buildRow($cells, $i, $length, $missingLength, $extraPadLength); |
183 | 183 | }, |
184 | 184 | range(0, max(array_map('count', $cells)) - 1) |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | implode( |
193 | 193 | '', |
194 | 194 | array_map( |
195 | - function ($cell) use ($index, $length, $extraPadLength) { |
|
195 | + function($cell) use ($index, $length, $extraPadLength) { |
|
196 | 196 | return $cell[$index] ?? str_repeat(' ', $length + $this->gutter + $extraPadLength); |
197 | 197 | }, |
198 | 198 | $cells |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | bool $isSelected, |
210 | 210 | string $itemExtra |
211 | 211 | ) : array { |
212 | - return array_map(function ($row, $index) use ($length, $style, $isSelected, $itemExtra) { |
|
212 | + return array_map(function($row, $index) use ($length, $style, $isSelected, $itemExtra) { |
|
213 | 213 | $invertedColoursSetCode = $isSelected |
214 | 214 | ? $style->getInvertedColoursSetCode() |
215 | 215 | : ''; |