Completed
Pull Request — master (#77)
by
unknown
03:23
created
examples/confirm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@
 block discarded – undo
3 3
 use PhpSchool\CliMenu\CliMenu;
4 4
 use PhpSchool\CliMenu\CliMenuBuilder;
5 5
 
6
-require_once(__DIR__ . '/../vendor/autoload.php');
6
+require_once(__DIR__.'/../vendor/autoload.php');
7 7
 
8
-$itemCallable = function (CliMenu $menu) {
8
+$itemCallable = function(CliMenu $menu) {
9 9
     $menu->confirm('PHP School FTW!')
10 10
         ->display('OK');
11 11
 };
Please login to merge, or discard this patch.
examples/disabled-items.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@
 block discarded – undo
3 3
 use PhpSchool\CliMenu\CliMenu;
4 4
 use PhpSchool\CliMenu\CliMenuBuilder;
5 5
 
6
-require_once(__DIR__ . '/../vendor/autoload.php');
6
+require_once(__DIR__.'/../vendor/autoload.php');
7 7
 
8
-$itemCallable = function (CliMenu $menu) {
8
+$itemCallable = function(CliMenu $menu) {
9 9
     echo $menu->getSelectedItem()->getText();
10 10
 };
11 11
 
Please login to merge, or discard this patch.
src/MenuItem/SelectableTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
             )
53 53
         );
54 54
 
55
-        return array_map(function ($row, $key) use ($style, $marker, $length) {
55
+        return array_map(function($row, $key) use ($style, $marker, $length) {
56 56
             $text = $this->disabled ? $style->getDisabledItemText($row) : $row;
57 57
 
58 58
             if ($key === 0) {
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
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                 : $this->selectedItem++;
216 216
 
217 217
             if (!array_key_exists($this->selectedItem, $this->items)) {
218
-                $this->selectedItem  = $direction === 'up'
218
+                $this->selectedItem = $direction === 'up'
219 219
                     ? end($itemKeys)
220 220
                     : reset($itemKeys);
221 221
             } elseif ($this->getSelectedItem()->canSelect()) {
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
         if ($item->canSelect()) {
243 243
             $callable = $item->getSelectAction();
244 244
             $data = $item->getData();
245
-            $callable($this,$data);
245
+            $callable($this, $data);
246 246
         }
247 247
     }
248 248
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
             $frame->addRows($this->drawMenuItem(new LineBreakItem($this->style->getTitleSeparator())));
277 277
         }
278 278
 
279
-        array_map(function ($item, $index) use ($frame) {
279
+        array_map(function($item, $index) use ($frame) {
280 280
             $frame->addRows($this->drawMenuItem($item, $index === $this->selectedItem));
281 281
         }, $this->items, array_keys($this->items));
282 282
 
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
             ? $this->style->getSelectedUnsetCode()
311 311
             : $this->style->getUnselectedUnsetCode();
312 312
 
313
-        return array_map(function ($row) use ($setColour, $unsetColour) {
313
+        return array_map(function($row) use ($setColour, $unsetColour) {
314 314
             return sprintf(
315 315
                 "%s%s%s%s%s%s%s\n\r",
316 316
                 str_repeat(' ', $this->style->getMargin()),
Please login to merge, or discard this patch.