@@ -9,7 +9,6 @@ |
||
9 | 9 | use PhpSchool\CliMenu\MenuItem\MenuItemInterface; |
10 | 10 | use PhpSchool\CliMenu\MenuItem\MenuMenuItem; |
11 | 11 | use PhpSchool\CliMenu\MenuItem\SelectableItem; |
12 | -use PhpSchool\CliMenu\MenuItem\SplitItem; |
|
13 | 12 | use PhpSchool\CliMenu\MenuItem\StaticItem; |
14 | 13 | use PhpSchool\CliMenu\Terminal\TerminalFactory; |
15 | 14 | use Assert\Assertion; |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | $length = $style->getDisplaysExtra() |
59 | - ? floor(($style->getContentWidth() - mb_strlen($style->getItemExtra()) + 2) / $numberOfItems) - $this->margin |
|
60 | - : floor($style->getContentWidth() / $numberOfItems) - $this->margin; |
|
61 | - $missingLength = $style->getContentWidth() % $numberOfItems; |
|
59 | + ? floor(($style->getContentWidth() - mb_strlen($style->getItemExtra()) + 2)/$numberOfItems) - $this->margin |
|
60 | + : floor($style->getContentWidth()/$numberOfItems) - $this->margin; |
|
61 | + $missingLength = $style->getContentWidth()%$numberOfItems; |
|
62 | 62 | |
63 | 63 | $lines = 0; |
64 | 64 | $cells = []; |
@@ -68,14 +68,14 @@ discard block |
||
68 | 68 | sprintf('%s%s', $marker, $item->getText()), |
69 | 69 | $length |
70 | 70 | ); |
71 | - $cell = array_map(function ($row) use ($index, $length, $style) { |
|
72 | - $row = $row . str_repeat(' ', $length - strlen($row)); |
|
71 | + $cell = array_map(function($row) use ($index, $length, $style) { |
|
72 | + $row = $row.str_repeat(' ', $length - strlen($row)); |
|
73 | 73 | if ($index === $this->selectedItemIndex) { |
74 | - $row = $style->getSelectedSetCode() . $row . $style->getSelectedUnsetCode(); |
|
74 | + $row = $style->getSelectedSetCode().$row.$style->getSelectedUnsetCode(); |
|
75 | 75 | } else { |
76 | - $row = $style->getUnselectedSetCode() . $row . $style->getUnselectedUnsetCode(); |
|
76 | + $row = $style->getUnselectedSetCode().$row.$style->getUnselectedUnsetCode(); |
|
77 | 77 | } |
78 | - $row .= $style->getUnselectedSetCode() . str_repeat(' ', $this->margin); |
|
78 | + $row .= $style->getUnselectedSetCode().str_repeat(' ', $this->margin); |
|
79 | 79 | return $row; |
80 | 80 | }, explode("\n", $content)); |
81 | 81 | $lineCount = count($cell); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | : $this->selectedItem++; |
211 | 211 | |
212 | 212 | if (!array_key_exists($this->selectedItem, $this->items)) { |
213 | - $this->selectedItem = $direction === 'UP' |
|
213 | + $this->selectedItem = $direction === 'UP' |
|
214 | 214 | ? end($itemKeys) |
215 | 215 | : reset($itemKeys); |
216 | 216 | } elseif ($this->getSelectedItem()->canSelect()) { |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | $frame->addRows($this->drawMenuItem(new LineBreakItem($this->style->getTitleSeparator()))); |
302 | 302 | } |
303 | 303 | |
304 | - array_map(function ($item, $index) use ($frame) { |
|
304 | + array_map(function($item, $index) use ($frame) { |
|
305 | 305 | $frame->addRows($this->drawMenuItem($item, $index === $this->selectedItem)); |
306 | 306 | }, $this->items, array_keys($this->items)); |
307 | 307 | |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | ? $this->style->getSelectedUnsetCode() |
336 | 336 | : $this->style->getUnselectedUnsetCode(); |
337 | 337 | |
338 | - return array_map(function ($row) use ($setColour, $unsetColour) { |
|
338 | + return array_map(function($row) use ($setColour, $unsetColour) { |
|
339 | 339 | return sprintf( |
340 | 340 | "%s%s%s%s%s%s%s\n", |
341 | 341 | str_repeat(' ', $this->style->getMargin()), |