Completed
Push — master ( 1b9dfa...0adb34 )
by Aydin
21s queued 10s
created
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("\n", $string))
39 39
         );
40 40
     }
Please login to merge, or discard this patch.
src/Dialogue/Dialogue.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,12 +69,12 @@
 block discarded – undo
69 69
     {
70 70
         //y
71 71
         $textLines = count(explode("\n", $this->text)) + 2;
72
-        $this->y = (int) (ceil($this->parentMenu->getCurrentFrame()->count() / 2) - ceil($textLines / 2) + 1);
72
+        $this->y = (int) (ceil($this->parentMenu->getCurrentFrame()->count()/2) - ceil($textLines/2) + 1);
73 73
 
74 74
         //x
75 75
         $parentStyle = $this->parentMenu->getStyle();
76
-        $dialogueHalfLength = (int) ((mb_strlen($this->text) + ($this->style->getPaddingLeftRight() * 2)) / 2);
77
-        $widthHalfLength = (int) ceil($parentStyle->getWidth() / 2 + $parentStyle->getMargin());
76
+        $dialogueHalfLength = (int) ((mb_strlen($this->text) + ($this->style->getPaddingLeftRight()*2))/2);
77
+        $widthHalfLength = (int) ceil($parentStyle->getWidth()/2 + $parentStyle->getMargin());
78 78
         $this->x = $widthHalfLength - $dialogueHalfLength;
79 79
     }
80 80
 
Please login to merge, or discard this patch.
src/Dialogue/Confirm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         $this->emptyRow();
37 37
 
38 38
         $confirmText = sprintf(' < %s > ', $confirmText);
39
-        $leftFill    = (int) (($promptWidth / 2) - (mb_strlen($confirmText) / 2));
39
+        $leftFill    = (int) (($promptWidth/2) - (mb_strlen($confirmText)/2));
40 40
 
41 41
         $this->write(sprintf(
42 42
             "%s%s%s%s%s%s%s\n",
Please login to merge, or discard this patch.
src/Input/InputIO.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     {
99 99
         return max(
100 100
             array_map(
101
-                function (string $line) {
101
+                function(string $line) {
102 102
                     return mb_strlen($line);
103 103
                 },
104 104
                 $lines
@@ -110,14 +110,14 @@  discard block
 block discarded – undo
110 110
     {
111 111
         $lines = 5; //1. empty 2. prompt text 3. empty 4. input 5. empty
112 112
 
113
-        return (int) (ceil($this->parentMenu->getCurrentFrame()->count() / 2) - ceil($lines /2) + 1);
113
+        return (int) (ceil($this->parentMenu->getCurrentFrame()->count()/2) - ceil($lines/2) + 1);
114 114
     }
115 115
 
116 116
     private function calculateYPositionWithError() : int
117 117
     {
118 118
         $lines = 7; //1. empty 2. prompt text 3. empty 4. input 5. empty 6. error 7. empty
119 119
 
120
-        return (int) (ceil($this->parentMenu->getCurrentFrame()->count() / 2) - ceil($lines /2) + 1);
120
+        return (int) (ceil($this->parentMenu->getCurrentFrame()->count()/2) - ceil($lines/2) + 1);
121 121
     }
122 122
 
123 123
     private function calculateXPosition(Input $input, string $userInput) : int
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
         );
132 132
 
133 133
         $parentStyle     = $this->parentMenu->getStyle();
134
-        $halfWidth       = ($width + ($input->getStyle()->getPaddingLeftRight() * 2)) / 2;
135
-        $parentHalfWidth = ceil($parentStyle->getWidth() / 2 + $parentStyle->getMargin());
134
+        $halfWidth       = ($width + ($input->getStyle()->getPaddingLeftRight()*2))/2;
135
+        $parentHalfWidth = ceil($parentStyle->getWidth()/2 + $parentStyle->getMargin());
136 136
 
137 137
         return (int) ($parentHalfWidth - $halfWidth);
138 138
     }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         );
165 165
 
166 166
         $textLength = mb_strlen(StringUtil::stripAnsiEscapeSequence($text));
167
-        $leftFill   = (int) (($width / 2) - ($textLength / 2));
167
+        $leftFill   = (int) (($width/2) - ($textLength/2));
168 168
         $rightFill  = (int) ceil($width - $leftFill - $textLength);
169 169
 
170 170
         $this->drawLine(
Please login to merge, or discard this patch.
src/Input/Number.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,11 +79,11 @@
 block discarded – undo
79 79
 
80 80
     public function ask() : InputResult
81 81
     {
82
-        $this->inputIO->registerControlCallback(InputCharacter::UP, function (string $input) {
82
+        $this->inputIO->registerControlCallback(InputCharacter::UP, function(string $input) {
83 83
             return $this->validate($input) ? (int) $input + 1 : $input;
84 84
         });
85 85
 
86
-        $this->inputIO->registerControlCallback(InputCharacter::DOWN, function (string $input) {
86
+        $this->inputIO->registerControlCallback(InputCharacter::DOWN, function(string $input) {
87 87
             return $this->validate($input) ? (int) $input - 1 : $input;
88 88
         });
89 89
 
Please login to merge, or discard this patch.
src/MenuItem/AsciiArtItem.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         Assertion::inArray($position, [self::POSITION_CENTER, self::POSITION_RIGHT, self::POSITION_LEFT]);
43 43
 
44 44
         $this->setText($text);
45
-        $this->position  = $position;
45
+        $this->position = $position;
46 46
         $this->alternateText = $alt;
47 47
     }
48 48
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
         $padding = $style->getContentWidth() - $this->artLength;
60 60
 
61
-        return array_map(function ($row) use ($padding) {
61
+        return array_map(function($row) use ($padding) {
62 62
             switch ($this->position) {
63 63
                 case self::POSITION_LEFT:
64 64
                     break;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                     break;
68 68
                 case self::POSITION_CENTER:
69 69
                 default:
70
-                    $left = (int) ceil($padding / 2);
70
+                    $left = (int) ceil($padding/2);
71 71
                     $row = sprintf('%s%s', str_repeat(' ', $left), $row);
72 72
                     break;
73 73
             }
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      */
106 106
     public function setText(string $text) : void
107 107
     {
108
-        $this->text = implode("\n", array_map(function (string $line) {
108
+        $this->text = implode("\n", array_map(function(string $line) {
109 109
             return rtrim($line, ' ');
110 110
         }, explode("\n", $text)));
111 111
 
Please login to merge, or discard this patch.
src/Builder/CliMenuBuilder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
     private function processItemShortcut(MenuItemInterface $item) : void
193 193
     {
194
-        $this->processIndividualShortcut($item, function (CliMenu $menu) use ($item) {
194
+        $this->processIndividualShortcut($item, function(CliMenu $menu) use ($item) {
195 195
             $menu->executeAsSelected($item);
196 196
         });
197 197
     }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     private function processSplitItemShortcuts(SplitItem $splitItem) : void
200 200
     {
201 201
         foreach ($splitItem->getItems() as $item) {
202
-            $this->processIndividualShortcut($item, function (CliMenu $menu) use ($splitItem, $item) {
202
+            $this->processIndividualShortcut($item, function(CliMenu $menu) use ($splitItem, $item) {
203 203
                 $current = $splitItem->getSelectedItemIndex();
204 204
 
205 205
                 $splitItem->setSelectedItemIndex(
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 
431 431
     private function itemsHaveExtra(array $items) : bool
432 432
     {
433
-        return !empty(array_filter($items, function (MenuItemInterface $item) {
433
+        return !empty(array_filter($items, function(MenuItemInterface $item) {
434 434
             return $item->showsItemExtra();
435 435
         }));
436 436
     }
Please login to merge, or discard this patch.
src/CliMenu.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
                 : $this->selectedItem++;
312 312
 
313 313
             if ($this->selectedItem !== null && !array_key_exists($this->selectedItem, $this->items)) {
314
-                $this->selectedItem  = $direction === 'UP'
314
+                $this->selectedItem = $direction === 'UP'
315 315
                     ? (int) end($itemKeys)
316 316
                     : (int) reset($itemKeys);
317 317
             }
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
             $frame->addRows($this->drawMenuItem(new LineBreakItem($this->style->getTitleSeparator())));
464 464
         }
465 465
 
466
-        array_map(function ($item, $index) use ($frame) {
466
+        array_map(function($item, $index) use ($frame) {
467 467
             $frame->addRows($this->drawMenuItem($item, $index === $this->selectedItem));
468 468
         }, $this->items, array_keys($this->items));
469 469
 
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
             $borderColour = '';
515 515
         }
516 516
 
517
-        return array_map(function ($row) use ($invertedColoursSetCode, $invertedColoursUnsetCode, $borderColour) {
517
+        return array_map(function($row) use ($invertedColoursSetCode, $invertedColoursUnsetCode, $borderColour) {
518 518
             return sprintf(
519 519
                 "%s%s%s%s%s%s%s%s%s%s%s%s\n",
520 520
                 str_repeat(' ', $this->style->getMargin()),
Please login to merge, or discard this patch.
src/MenuItem/RadioItem.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             )
53 53
         );
54 54
 
55
-        return array_map(function ($row, $key) use ($style, $length, $itemExtra) {
55
+        return array_map(function($row, $key) use ($style, $length, $itemExtra) {
56 56
             $text = $this->disabled ? $style->getDisabledItemText($row) : $row;
57 57
 
58 58
             if ($key === 0) {
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      */
71 71
     public function getSelectAction() : ?callable
72 72
     {
73
-        return function (CliMenu $cliMenu) {
73
+        return function(CliMenu $cliMenu) {
74 74
             $parentItem = $cliMenu->getItemByIndex($cliMenu->getSelectedItemIndex());
75 75
 
76 76
             $siblings = $parentItem instanceof SplitItem
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
 
80 80
             $filtered = array_filter(
81 81
                 $siblings,
82
-                function (MenuItemInterface $item) {
82
+                function(MenuItemInterface $item) {
83 83
                     return $item instanceof self;
84 84
                 }
85 85
             );
86 86
 
87 87
             array_walk(
88 88
                 $filtered,
89
-                function (RadioItem $item) {
89
+                function(RadioItem $item) {
90 90
                     $item->setUnchecked();
91 91
                 }
92 92
             );
Please login to merge, or discard this patch.