diff --git a/src/CliMenu.php b/src/CliMenu.php index 3a2682bc..3d3c2abb 100644 --- a/src/CliMenu.php +++ b/src/CliMenu.php @@ -387,7 +387,7 @@ protected function drawMenuItem(MenuItemInterface $item, bool $selected = false) return array_map(function ($row) use ($invertedColour, $notInvertedColour, $borderColour) { return sprintf( - "%s%s%s%s%s%s%s%s%s%s%s%s%s\n", + "%s%s%s%s%s%s%s%s%s%s%s%s\n", str_repeat(' ', $this->style->getMargin()), $borderColour, str_repeat(' ', $this->style->getBorderLeftWidth()), @@ -399,8 +399,7 @@ protected function drawMenuItem(MenuItemInterface $item, bool $selected = false) $notInvertedColour, $borderColour, str_repeat(' ', $this->style->getBorderRightWidth()), - $this->style->getColoursResetCode(), - str_repeat(' ', $this->style->getMargin()) + $this->style->getColoursResetCode() ); }, $rows); } diff --git a/src/MenuStyle.php b/src/MenuStyle.php index 5ae37bcf..42b1bf4d 100644 --- a/src/MenuStyle.php +++ b/src/MenuStyle.php @@ -489,12 +489,11 @@ public function setTitleSeparator(string $actionSeparator) : self private function generateBorderRows() : void { $borderRow = sprintf( - "%s%s%s%s%s\n", + "%s%s%s%s\n", str_repeat(' ', $this->margin), $this->getBorderColourCode(), str_repeat(' ', $this->width), - $this->coloursResetCode, - str_repeat(' ', $this->margin) + $this->coloursResetCode ); $this->borderTopRows = array_fill(0, $this->borderTopWidth, $borderRow); diff --git a/test/res/testAddCustomControlMapping.txt b/test/res/testAddCustomControlMapping.txt index 6c1f18be..fdb9ed89 100644 --- a/test/res/testAddCustomControlMapping.txt +++ b/test/res/testAddCustomControlMapping.txt @@ -1,9 +1,9 @@ -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +   diff --git a/test/res/testAddCustomControlMappings.txt b/test/res/testAddCustomControlMappings.txt index 6c1f18be..fdb9ed89 100644 --- a/test/res/testAddCustomControlMappings.txt +++ b/test/res/testAddCustomControlMappings.txt @@ -1,9 +1,9 @@ -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +   diff --git a/test/res/testConfirmCanOnlyBeClosedWithEnter.txt b/test/res/testConfirmCanOnlyBeClosedWithEnter.txt index 14c9041f..8f10687f 100644 --- a/test/res/testConfirmCanOnlyBeClosedWithEnter.txt +++ b/test/res/testConfirmCanOnlyBeClosedWithEnter.txt @@ -1,10 +1,10 @@ -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +     @@ -14,10 +14,10 @@   -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +   diff --git a/test/res/testConfirmWithEvenLengthConfirmAndButton.txt b/test/res/testConfirmWithEvenLengthConfirmAndButton.txt index 81a4bcde..17aeeed0 100644 --- a/test/res/testConfirmWithEvenLengthConfirmAndButton.txt +++ b/test/res/testConfirmWithEvenLengthConfirmAndButton.txt @@ -1,10 +1,10 @@ -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +     @@ -14,10 +14,10 @@   -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +   diff --git a/test/res/testConfirmWithEvenLengthConfirmAndOddLengthButton.txt b/test/res/testConfirmWithEvenLengthConfirmAndOddLengthButton.txt index a1b0d288..feb6592a 100644 --- a/test/res/testConfirmWithEvenLengthConfirmAndOddLengthButton.txt +++ b/test/res/testConfirmWithEvenLengthConfirmAndOddLengthButton.txt @@ -1,10 +1,10 @@ -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +     @@ -14,10 +14,10 @@   -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +   diff --git a/test/res/testConfirmWithOddLengthConfirmAndButton.txt b/test/res/testConfirmWithOddLengthConfirmAndButton.txt index 481b9216..0e924e7e 100644 --- a/test/res/testConfirmWithOddLengthConfirmAndButton.txt +++ b/test/res/testConfirmWithOddLengthConfirmAndButton.txt @@ -1,10 +1,10 @@ -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +     @@ -14,10 +14,10 @@   -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +   diff --git a/test/res/testConfirmWithOddLengthConfirmAndEvenLengthButton.txt b/test/res/testConfirmWithOddLengthConfirmAndEvenLengthButton.txt index 14c9041f..8f10687f 100644 --- a/test/res/testConfirmWithOddLengthConfirmAndEvenLengthButton.txt +++ b/test/res/testConfirmWithOddLengthConfirmAndEvenLengthButton.txt @@ -1,10 +1,10 @@ -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +     @@ -14,10 +14,10 @@   -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +   diff --git a/test/res/testFlashCanBeClosedWithAnyKey.txt b/test/res/testFlashCanBeClosedWithAnyKey.txt index 3226bf8e..8c9eb4ea 100644 --- a/test/res/testFlashCanBeClosedWithAnyKey.txt +++ b/test/res/testFlashCanBeClosedWithAnyKey.txt @@ -1,10 +1,10 @@ -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +     @@ -12,10 +12,10 @@   -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +   diff --git a/test/res/testFlashWithEvenLength.txt b/test/res/testFlashWithEvenLength.txt index b4e577be..32f63616 100644 --- a/test/res/testFlashWithEvenLength.txt +++ b/test/res/testFlashWithEvenLength.txt @@ -1,10 +1,10 @@ -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +     @@ -12,10 +12,10 @@   -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +   diff --git a/test/res/testFlashWithOddLength.txt b/test/res/testFlashWithOddLength.txt index 3226bf8e..8c9eb4ea 100644 --- a/test/res/testFlashWithOddLength.txt +++ b/test/res/testFlashWithOddLength.txt @@ -1,10 +1,10 @@ -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +     @@ -12,10 +12,10 @@   -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +   diff --git a/test/res/testReDrawReDrawsImmediately.txt b/test/res/testReDrawReDrawsImmediately.txt index a3cdbaf5..47e1c60d 100644 --- a/test/res/testReDrawReDrawsImmediately.txt +++ b/test/res/testReDrawReDrawsImmediately.txt @@ -1,18 +1,18 @@ -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +   -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +   diff --git a/test/res/testSimpleOpenClose.txt b/test/res/testSimpleOpenClose.txt index 6c1f18be..fdb9ed89 100644 --- a/test/res/testSimpleOpenClose.txt +++ b/test/res/testSimpleOpenClose.txt @@ -1,9 +1,9 @@ -   -  PHP School FTW  -  ==========================================  -  ● Item 1  -   +   +  PHP School FTW  +  ==========================================  +  ● Item 1  +   diff --git a/test/res/testSimpleOpenCloseWithBorders.txt b/test/res/testSimpleOpenCloseWithBorders.txt index f5859c27..4a0c9750 100644 --- a/test/res/testSimpleOpenCloseWithBorders.txt +++ b/test/res/testSimpleOpenCloseWithBorders.txt @@ -1,11 +1,11 @@ -   -     -   PHP School FTW   -   ======================================   -   ● Item 1   -     -   +   +     +   PHP School FTW   +   ======================================   +   ● Item 1   +     +   diff --git a/test/res/testSimpleOpenCloseWithLeftAndRightBorders.txt b/test/res/testSimpleOpenCloseWithLeftAndRightBorders.txt index df89ab68..7c725002 100644 --- a/test/res/testSimpleOpenCloseWithLeftAndRightBorders.txt +++ b/test/res/testSimpleOpenCloseWithLeftAndRightBorders.txt @@ -1,9 +1,9 @@ -     -   PHP School FTW   -   ======================================   -   ● Item 1   -     +     +   PHP School FTW   +   ======================================   +   ● Item 1   +     diff --git a/test/res/testSimpleOpenCloseWithMarginAutoAndBorders.txt b/test/res/testSimpleOpenCloseWithMarginAutoAndBorders.txt index b6996228..2ac4b470 100644 --- a/test/res/testSimpleOpenCloseWithMarginAutoAndBorders.txt +++ b/test/res/testSimpleOpenCloseWithMarginAutoAndBorders.txt @@ -1,11 +1,11 @@ -   -     -   PHP School FTW   -   ======================   -   ● Item 1   -     -   +   +     +   PHP School FTW   +   ======================   +   ● Item 1   +     +