Completed
Pull Request — master (#222)
by Aydin
01:53
created
src/MenuItem/MenuMenuItem.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             )
61 61
         );
62 62
 
63
-        return array_map(function ($row, $key) use ($style, $length) {
63
+        return array_map(function($row, $key) use ($style, $length) {
64 64
             $text = $this->disabled ? $style->getDisabledItemText($row) : $row;
65 65
 
66 66
             if ($key === 0) {
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public function getSelectAction() : ?callable
85 85
     {
86
-        return function (CliMenu $menu) {
86
+        return function(CliMenu $menu) {
87 87
             $this->showSubMenu($menu);
88 88
         };
89 89
     }
Please login to merge, or discard this patch.
src/MenuItem/SplitItem.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -120,16 +120,16 @@  discard block
 block discarded – undo
120 120
         $largestItemExtra = $this->calculateItemExtra();
121 121
 
122 122
         $length = $largestItemExtra > 0
123
-            ? floor($style->getContentWidth() / $numberOfItems) - ($largestItemExtra + 2)
124
-            : floor($style->getContentWidth() / $numberOfItems);
123
+            ? floor($style->getContentWidth()/$numberOfItems) - ($largestItemExtra + 2)
124
+            : floor($style->getContentWidth()/$numberOfItems);
125 125
 
126 126
         $length -= $this->gutter;
127 127
         $length = (int) $length;
128 128
 
129
-        $missingLength = $style->getContentWidth() % $numberOfItems;
129
+        $missingLength = $style->getContentWidth()%$numberOfItems;
130 130
         
131 131
         return $this->buildRows(
132
-            array_map(function ($index, $item) use ($selected, $length, $style) {
132
+            array_map(function($index, $item) use ($selected, $length, $style) {
133 133
                 $isSelected = $selected && $index === $this->selectedItemIndex;
134 134
 
135 135
                 if ($item instanceof CheckboxItem || $item instanceof RadioItem) {
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         $extraPadLength = $largestItemExtra > 0 ? 2 + $largestItemExtra : 0;
178 178
         
179 179
         return array_map(
180
-            function ($i) use ($cells, $length, $missingLength, $extraPadLength) {
180
+            function($i) use ($cells, $length, $missingLength, $extraPadLength) {
181 181
                 return $this->buildRow($cells, $i, $length, $missingLength, $extraPadLength);
182 182
             },
183 183
             range(0, max(array_map('count', $cells)) - 1)
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
             implode(
192 192
                 '',
193 193
                 array_map(
194
-                    function ($cell) use ($index, $length, $extraPadLength) {
194
+                    function($cell) use ($index, $length, $extraPadLength) {
195 195
                         return $cell[$index] ?? str_repeat(' ', $length + $this->gutter + $extraPadLength);
196 196
                     },
197 197
                     $cells
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
         bool $isSelected,
209 209
         string $itemExtra
210 210
     ) : array {
211
-        return array_map(function ($row, $index) use ($length, $style, $isSelected, $itemExtra) {
211
+        return array_map(function($row, $index) use ($length, $style, $isSelected, $itemExtra) {
212 212
             $invertedColoursSetCode = $isSelected
213 213
                 ? $style->getInvertedColoursSetCode()
214 214
                 : '';
Please login to merge, or discard this patch.
src/MenuStyle.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
     protected function calculateContentWidth() : void
347 347
     {
348 348
         $this->contentWidth = $this->width
349
-            - ($this->paddingLeftRight * 2)
349
+            - ($this->paddingLeftRight*2)
350 350
             - ($this->borderRightWidth + $this->borderLeftWidth);
351 351
 
352 352
         if ($this->contentWidth < 0) {
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 
526 526
     private function calculateMarginAuto(int $width) : void
527 527
     {
528
-        $this->margin = (int) floor(($this->terminal->getWidth() - ($width)) / 2);
528
+        $this->margin = (int) floor(($this->terminal->getWidth() - ($width))/2);
529 529
     }
530 530
 
531 531
     public function setMargin(int $margin) : self
Please login to merge, or discard this patch.
src/CliMenu.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         $this->radioStyle      = new RadioStyle();
117 117
         $this->selectableStyle = new SelectableStyle();
118 118
 
119
-        $this->terminal->onSignal(SIGWINCH, function () {
119
+        $this->terminal->onSignal(SIGWINCH, function() {
120 120
             $this->style->windowResize();
121 121
 
122 122
             if ($this->isOpen()) {
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
                 : $this->selectedItem++;
359 359
 
360 360
             if ($this->selectedItem !== null && !array_key_exists($this->selectedItem, $this->items)) {
361
-                $this->selectedItem  = $direction === 'UP'
361
+                $this->selectedItem = $direction === 'UP'
362 362
                     ? (int) end($itemKeys)
363 363
                     : (int) reset($itemKeys);
364 364
             }
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
             $frame->addRows($this->drawMenuItem(new LineBreakItem($this->style->getTitleSeparator())));
529 529
         }
530 530
 
531
-        array_map(function ($item, $index) use ($frame) {
531
+        array_map(function($item, $index) use ($frame) {
532 532
             $frame->addRows($this->drawMenuItem($item, $index === $this->selectedItem));
533 533
         }, $this->items, array_keys($this->items));
534 534
 
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
             $borderColour = '';
580 580
         }
581 581
 
582
-        return array_map(function ($row) use ($invertedColoursSetCode, $invertedColoursUnsetCode, $borderColour) {
582
+        return array_map(function($row) use ($invertedColoursSetCode, $invertedColoursUnsetCode, $borderColour) {
583 583
             return sprintf(
584 584
                 "%s%s%s%s%s%s%s%s%s%s%s%s\n",
585 585
                 str_repeat(' ', $this->style->getMargin()),
Please login to merge, or discard this patch.