@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | */ |
| 235 | 235 | protected function createMenuClosure($builder) : Closure |
| 236 | 236 | { |
| 237 | - return function () use ($builder) { |
|
| 237 | + return function() use ($builder) { |
|
| 238 | 238 | $menu = $builder->build(); |
| 239 | 239 | |
| 240 | 240 | $menu->setParent($this->menu); |
@@ -247,21 +247,21 @@ discard block |
||
| 247 | 247 | |
| 248 | 248 | // If user changed this style, persist to the menu so children CheckableItems may use it |
| 249 | 249 | if ($this->menu->getCheckableStyle()->getIsCustom()) { |
| 250 | - $menu->setCheckableStyle(function (CheckableStyle $style) { |
|
| 250 | + $menu->setCheckableStyle(function(CheckableStyle $style) { |
|
| 251 | 251 | $style->fromArray($this->menu->getCheckableStyle()->toArray()); |
| 252 | 252 | }); |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | // If user changed this style, persist to the menu so children RadioItems may use it |
| 256 | 256 | if ($this->menu->getRadioStyle()->getIsCustom()) { |
| 257 | - $menu->setRadioStyle(function (RadioStyle $style) { |
|
| 257 | + $menu->setRadioStyle(function(RadioStyle $style) { |
|
| 258 | 258 | $style->fromArray($this->menu->getRadioStyle()->toArray()); |
| 259 | 259 | }); |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | // If user changed this style, persist to the menu so children SelectableItems may use it |
| 263 | 263 | if ($this->menu->getSelectableStyle()->getIsCustom()) { |
| 264 | - $menu->setSelectableStyle(function (SelectableStyle $style) { |
|
| 264 | + $menu->setSelectableStyle(function(SelectableStyle $style) { |
|
| 265 | 265 | $style->fromArray($this->menu->getSelectableStyle()->toArray()); |
| 266 | 266 | }); |
| 267 | 267 | } |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | |
| 306 | 306 | private function processItemShortcut(MenuItemInterface $item) : void |
| 307 | 307 | { |
| 308 | - $this->processIndividualShortcut($item, function (CliMenu $menu) use ($item) { |
|
| 308 | + $this->processIndividualShortcut($item, function(CliMenu $menu) use ($item) { |
|
| 309 | 309 | $menu->executeAsSelected($item); |
| 310 | 310 | }); |
| 311 | 311 | } |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | private function processSplitItemShortcuts(SplitItem $splitItem) : void |
| 314 | 314 | { |
| 315 | 315 | foreach ($splitItem->getItems() as $item) { |
| 316 | - $this->processIndividualShortcut($item, function (CliMenu $menu) use ($splitItem, $item) { |
|
| 316 | + $this->processIndividualShortcut($item, function(CliMenu $menu) use ($splitItem, $item) { |
|
| 317 | 317 | $current = $splitItem->getSelectedItemIndex(); |
| 318 | 318 | |
| 319 | 319 | $splitItem->setSelectedItemIndex( |
@@ -353,21 +353,21 @@ discard block |
||
| 353 | 353 | |
| 354 | 354 | // If user changed this style, persist to the menu so children CheckableItems may use it |
| 355 | 355 | if ($this->menu->getCheckableStyle()->getIsCustom()) { |
| 356 | - $builder->setCheckableStyle(function (CheckableStyle $style) { |
|
| 356 | + $builder->setCheckableStyle(function(CheckableStyle $style) { |
|
| 357 | 357 | $style->fromArray($this->menu->getCheckableStyle()->toArray()); |
| 358 | 358 | }); |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | // If user changed this style, persist to the menu so children RadioItems may use it |
| 362 | 362 | if ($this->menu->getRadioStyle()->getIsCustom()) { |
| 363 | - $builder->setRadioStyle(function (RadioStyle $style) { |
|
| 363 | + $builder->setRadioStyle(function(RadioStyle $style) { |
|
| 364 | 364 | $style->fromArray($this->menu->getRadioStyle()->toArray()); |
| 365 | 365 | }); |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | // If user changed this style, persist to the menu so children SelectableItems may use it |
| 369 | 369 | if ($this->menu->getSelectableStyle()->getIsCustom()) { |
| 370 | - $builder->setSelectableStyle(function (SelectableStyle $style) { |
|
| 370 | + $builder->setSelectableStyle(function(SelectableStyle $style) { |
|
| 371 | 371 | $style->fromArray($this->menu->getSelectableStyle()->toArray()); |
| 372 | 372 | }); |
| 373 | 373 | } |
@@ -587,7 +587,7 @@ discard block |
||
| 587 | 587 | |
| 588 | 588 | private function itemsHaveExtra(array $items) : bool |
| 589 | 589 | { |
| 590 | - return !empty(array_filter($items, function (MenuItemInterface $item) { |
|
| 590 | + return !empty(array_filter($items, function(MenuItemInterface $item) { |
|
| 591 | 591 | return $item->showsItemExtra(); |
| 592 | 592 | })); |
| 593 | 593 | } |
@@ -202,28 +202,28 @@ |
||
| 202 | 202 | */ |
| 203 | 203 | protected function createMenuClosure(CliMenuBuilder $builder) : Closure |
| 204 | 204 | { |
| 205 | - return function () use ($builder) { |
|
| 205 | + return function() use ($builder) { |
|
| 206 | 206 | $menu = $builder->build(); |
| 207 | 207 | |
| 208 | 208 | $menu->setParent($this->menu); |
| 209 | 209 | |
| 210 | 210 | // If user changed this style, persist to the menu so children CheckableItems may use it |
| 211 | 211 | if ($this->menu->getCheckableStyle()->getIsCustom()) { |
| 212 | - $menu->setCheckableStyle(function (CheckableStyle $style) { |
|
| 212 | + $menu->setCheckableStyle(function(CheckableStyle $style) { |
|
| 213 | 213 | $style->fromArray($this->menu->getCheckableStyle()->toArray()); |
| 214 | 214 | }); |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | // If user changed this style, persist to the menu so children RadioItems may use it |
| 218 | 218 | if ($this->menu->getRadioStyle()->getIsCustom()) { |
| 219 | - $menu->setRadioStyle(function (RadioStyle $style) { |
|
| 219 | + $menu->setRadioStyle(function(RadioStyle $style) { |
|
| 220 | 220 | $style->fromArray($this->menu->getRadioStyle()->toArray()); |
| 221 | 221 | }); |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | // If user changed this style, persist to the menu so children SelectableItems may use it |
| 225 | 225 | if ($this->menu->getSelectableStyle()->getIsCustom()) { |
| 226 | - $menu->setSelectableStyle(function (SelectableStyle $style) { |
|
| 226 | + $menu->setSelectableStyle(function(SelectableStyle $style) { |
|
| 227 | 227 | $style->fromArray($this->menu->getSelectableStyle()->toArray()); |
| 228 | 228 | }); |
| 229 | 229 | } |
@@ -118,16 +118,16 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | $length = $style->getDisplaysExtra() |
| 121 | - ? floor($style->getContentWidth() / $numberOfItems) - (mb_strlen($style->getItemExtra()) + 2) |
|
| 122 | - : floor($style->getContentWidth() / $numberOfItems); |
|
| 121 | + ? floor($style->getContentWidth()/$numberOfItems) - (mb_strlen($style->getItemExtra()) + 2) |
|
| 122 | + : floor($style->getContentWidth()/$numberOfItems); |
|
| 123 | 123 | |
| 124 | 124 | $length -= $this->gutter; |
| 125 | 125 | $length = (int) $length; |
| 126 | 126 | |
| 127 | - $missingLength = $style->getContentWidth() % $numberOfItems; |
|
| 127 | + $missingLength = $style->getContentWidth()%$numberOfItems; |
|
| 128 | 128 | |
| 129 | 129 | return $this->buildRows( |
| 130 | - array_map(function ($index, $item) use ($selected, $length, $style) { |
|
| 130 | + array_map(function($index, $item) use ($selected, $length, $style) { |
|
| 131 | 131 | $isSelected = $selected && $index === $this->selectedItemIndex; |
| 132 | 132 | |
| 133 | 133 | if ($item instanceof ItemStyleInterface) { |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $extraPadLength = $style->getDisplaysExtra() ? 2 + mb_strlen($style->getItemExtra()) : 0; |
| 184 | 184 | |
| 185 | 185 | return array_map( |
| 186 | - function ($i) use ($cells, $length, $missingLength, $extraPadLength) { |
|
| 186 | + function($i) use ($cells, $length, $missingLength, $extraPadLength) { |
|
| 187 | 187 | return $this->buildRow($cells, $i, $length, $missingLength, $extraPadLength); |
| 188 | 188 | }, |
| 189 | 189 | range(0, max(array_map('count', $cells)) - 1) |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | implode( |
| 198 | 198 | '', |
| 199 | 199 | array_map( |
| 200 | - function ($cell) use ($index, $length, $extraPadLength) { |
|
| 200 | + function($cell) use ($index, $length, $extraPadLength) { |
|
| 201 | 201 | return $cell[$index] ?? str_repeat(' ', $length + $this->gutter + $extraPadLength); |
| 202 | 202 | }, |
| 203 | 203 | $cells |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | bool $isSelected, |
| 215 | 215 | string $itemExtra |
| 216 | 216 | ) : array { |
| 217 | - return array_map(function ($row, $index) use ($length, $style, $isSelected, $itemExtra) { |
|
| 217 | + return array_map(function($row, $index) use ($length, $style, $isSelected, $itemExtra) { |
|
| 218 | 218 | $invertedColoursSetCode = $isSelected |
| 219 | 219 | ? $style->getInvertedColoursSetCode() |
| 220 | 220 | : ''; |