Completed
Push — master ( e3b994...207c5b )
by Aydin
13s
created
src/CliMenu.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
                 : $this->selectedItem++;
286 286
 
287 287
             if (!array_key_exists($this->selectedItem, $this->items)) {
288
-                $this->selectedItem  = $direction === 'UP'
288
+                $this->selectedItem = $direction === 'UP'
289 289
                     ? end($itemKeys)
290 290
                     : reset($itemKeys);
291 291
             }
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
             $frame->addRows($this->drawMenuItem(new LineBreakItem($this->style->getTitleSeparator())));
388 388
         }
389 389
 
390
-        array_map(function ($item, $index) use ($frame) {
390
+        array_map(function($item, $index) use ($frame) {
391 391
             $frame->addRows($this->drawMenuItem($item, $index === $this->selectedItem));
392 392
         }, $this->items, array_keys($this->items));
393 393
 
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
             $borderColour = '';
439 439
         }
440 440
 
441
-        return array_map(function ($row) use ($invertedColoursSetCode, $invertedColoursUnsetCode, $borderColour) {
441
+        return array_map(function($row) use ($invertedColoursSetCode, $invertedColoursUnsetCode, $borderColour) {
442 442
             return sprintf(
443 443
                 "%s%s%s%s%s%s%s%s%s%s%s%s\n",
444 444
                 str_repeat(' ', $this->style->getMargin()),
Please login to merge, or discard this patch.
src/Util/StringUtil.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     {
16 16
         return implode(
17 17
             $break,
18
-            array_map(function (string $line) use ($width, $break) {
18
+            array_map(function(string $line) use ($width, $break) {
19 19
                 $line = rtrim($line);
20 20
                 if (mb_strlen($line) <= $width) {
21 21
                     return $line;
@@ -25,16 +25,16 @@  discard block
 block discarded – undo
25 25
                 $line   = '';
26 26
                 $actual = '';
27 27
                 foreach ($words as $word) {
28
-                    if (mb_strlen($actual . $word) <= $width) {
29
-                        $actual .= $word . ' ';
28
+                    if (mb_strlen($actual.$word) <= $width) {
29
+                        $actual .= $word.' ';
30 30
                     } else {
31 31
                         if ($actual !== '') {
32
-                            $line .= rtrim($actual) . $break;
32
+                            $line .= rtrim($actual).$break;
33 33
                         }
34
-                        $actual = $word . ' ';
34
+                        $actual = $word.' ';
35 35
                     }
36 36
                 }
37
-                return $line . trim($actual);
37
+                return $line.trim($actual);
38 38
             }, explode($break, $string))
39 39
         );
40 40
     }
Please login to merge, or discard this patch.
examples/remove-defaults.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@  discard block
 block discarded – undo
3 3
 use PhpSchool\CliMenu\CliMenu;
4 4
 use PhpSchool\CliMenu\Builder\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
 
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     ->addItem('Second Item', $itemCallable)
16 16
     ->addItem('Third Item', $itemCallable)
17 17
     ->disableDefaultItems()
18
-    ->addItem('CUSTOM CLOSE', function (CliMenu $menu) {
18
+    ->addItem('CUSTOM CLOSE', function(CliMenu $menu) {
19 19
         $menu->close();
20 20
     })
21 21
     ->build();
Please login to merge, or discard this patch.
examples/input-number.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\Builder\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
     $number = $menu->askNumber();
10 10
     $number->getStyle()
11 11
         ->setBg('180')
Please login to merge, or discard this patch.
examples/input-password.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@
 block discarded – undo
3 3
 use PhpSchool\CliMenu\CliMenu;
4 4
 use PhpSchool\CliMenu\Builder\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
     $result = $menu->askPassword()
10 10
         ->setPlaceholderText('')
11
-        ->setValidator(function ($password) {
11
+        ->setValidator(function($password) {
12 12
             if ($password === 'password') {
13 13
                 $this->setValidationFailedText('Password is too weak');
14 14
                 return false;
Please login to merge, or discard this patch.
examples/toggle-item-extra.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
4 4
 use PhpSchool\CliMenu\Builder\CliMenuBuilder;
5 5
 use PhpSchool\CliMenu\MenuItem\MenuItemInterface;
6 6
 
7
-require_once(__DIR__ . '/../vendor/autoload.php');
7
+require_once(__DIR__.'/../vendor/autoload.php');
8 8
 
9
-$itemCallable = function (CliMenu $menu) {
9
+$itemCallable = function(CliMenu $menu) {
10 10
     static $i = 1;
11 11
 
12 12
     foreach ($menu->getItems() as $item) {
13
-        $i % 2 === 0
13
+        $i%2 === 0
14 14
             ? $item->showItemExtra()
15 15
             : $item->hideItemExtra();
16 16
 
Please login to merge, or discard this patch.
examples/basic.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\Builder\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.
examples/flash.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\Builder\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
     $flash = $menu->flash("PHP School FTW!!");
10 10
     $flash->getStyle()->setBg('green');
11 11
     $flash->display();
Please login to merge, or discard this patch.
examples/custom-mapping.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\Builder\CliMenuBuilder;
5 5
 
6
-require_once(__DIR__ . '/../vendor/autoload.php');
6
+require_once(__DIR__.'/../vendor/autoload.php');
7 7
 
8
-$exit = function (CliMenu $menu) {
8
+$exit = function(CliMenu $menu) {
9 9
     $menu->close();
10 10
 };
11 11
 
Please login to merge, or discard this patch.