@@ -69,12 +69,12 @@ |
||
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 |
@@ -6,9 +6,9 @@ |
||
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'); |
@@ -3,9 +3,9 @@ |
||
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') |
@@ -3,9 +3,9 @@ |
||
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 |