Completed
Pull Request — master (#125)
by
unknown
10:44
created
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            = ceil($this->parentMenu->getCurrentFrame()->count() / 2) - ceil($textLines / 2) + 1;
72
+        $this->y            = ceil($this->parentMenu->getCurrentFrame()->count()/2) - ceil($textLines/2) + 1;
73 73
 
74 74
         //x
75 75
         $parentStyle        = $this->parentMenu->getStyle();
76
-        $dialogueHalfLength = (mb_strlen($this->text) + ($this->style->getPaddingLeftRight() * 2)) / 2;
77
-        $widthHalfLength    = ceil($parentStyle->getWidth() / 2 + $parentStyle->getMargin());
76
+        $dialogueHalfLength = (mb_strlen($this->text) + ($this->style->getPaddingLeftRight()*2))/2;
77
+        $widthHalfLength    = 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/MenuItem/SplitItem.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace PhpSchool\CliMenu\MenuItem;
4 4
 
5
-use Assert\Assertion;
6 5
 use PhpSchool\CliMenu\CliMenu;
7 6
 use PhpSchool\CliMenu\CliMenuBuilder;
8 7
 use PhpSchool\CliMenu\MenuStyle;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
     public function end() : CliMenuBuilder
98 98
     {
99
-        $this->items = array_map(function ($item) {
99
+        $this->items = array_map(function($item) {
100 100
             if (!is_string($item) || empty($this->subMenuBuilders[$item])) {
101 101
                 return $item;
102 102
             }
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
         }
126 126
 
127 127
         $length = $style->getDisplaysExtra()
128
-            ? floor(($style->getContentWidth() - mb_strlen($style->getItemExtra()) + 2) / $numberOfItems) - $this->margin
129
-            : floor($style->getContentWidth() / $numberOfItems) - $this->margin;
130
-        $missingLength = $style->getContentWidth() % $numberOfItems;
128
+            ? floor(($style->getContentWidth() - mb_strlen($style->getItemExtra()) + 2)/$numberOfItems) - $this->margin
129
+            : floor($style->getContentWidth()/$numberOfItems) - $this->margin;
130
+        $missingLength = $style->getContentWidth()%$numberOfItems;
131 131
 
132 132
         $lines = 0;
133 133
         $cells = [];
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                 sprintf('%s%s', $marker, $item->getText()),
139 139
                 $length
140 140
             );
141
-            $cell = array_map(function ($row) use ($index, $length, $style, $isSelected) {
141
+            $cell = array_map(function($row) use ($index, $length, $style, $isSelected) {
142 142
                 $invertedColoursSetCode = $isSelected
143 143
                     ? $style->getInvertedColoursSetCode()
144 144
                     : '';
Please login to merge, or discard this patch.
examples/input-custom.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@
 block discarded – undo
6 6
 use PhpSchool\CliMenu\Input\InputIO;
7 7
 use PhpSchool\CliMenu\MenuStyle;
8 8
 
9
-require_once(__DIR__ . '/../vendor/autoload.php');
9
+require_once(__DIR__.'/../vendor/autoload.php');
10 10
 
11
-$itemCallable = function (CliMenu $menu) {
11
+$itemCallable = function(CliMenu $menu) {
12 12
     $style = (new MenuStyle())
13 13
         ->setBg('yellow')
14 14
         ->setFg('black');
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\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/borders.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.