Skip to content

Commit 0868200

Browse files
authored
Merge pull request #116 from php-school/remove-right-margin
Do not print right margin
2 parents bfa4770 + 11e3e63 commit 0868200

17 files changed

+128
-130
lines changed

src/CliMenu.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ protected function drawMenuItem(MenuItemInterface $item, bool $selected = false)
387387

388388
return array_map(function ($row) use ($invertedColour, $notInvertedColour, $borderColour) {
389389
return sprintf(
390-
"%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
390+
"%s%s%s%s%s%s%s%s%s%s%s%s\n",
391391
str_repeat(' ', $this->style->getMargin()),
392392
$borderColour,
393393
str_repeat(' ', $this->style->getBorderLeftWidth()),
@@ -399,8 +399,7 @@ protected function drawMenuItem(MenuItemInterface $item, bool $selected = false)
399399
$notInvertedColour,
400400
$borderColour,
401401
str_repeat(' ', $this->style->getBorderRightWidth()),
402-
$this->style->getColoursResetCode(),
403-
str_repeat(' ', $this->style->getMargin())
402+
$this->style->getColoursResetCode()
404403
);
405404
}, $rows);
406405
}

src/MenuStyle.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,12 +489,11 @@ public function setTitleSeparator(string $actionSeparator) : self
489489
private function generateBorderRows() : void
490490
{
491491
$borderRow = sprintf(
492-
"%s%s%s%s%s\n",
492+
"%s%s%s%s\n",
493493
str_repeat(' ', $this->margin),
494494
$this->getBorderColourCode(),
495495
str_repeat(' ', $this->width),
496-
$this->coloursResetCode,
497-
str_repeat(' ', $this->margin)
496+
$this->coloursResetCode
498497
);
499498

500499
$this->borderTopRows = array_fill(0, $this->borderTopWidth, $borderRow);
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22

3-
 
4-
 PHP School FTW 
5-
 ========================================== 
6-
 ● Item 1 
7-
 
3+
 
4+
 PHP School FTW 
5+
 ========================================== 
6+
 ● Item 1 
7+
 
88

99

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22

3-
 
4-
 PHP School FTW 
5-
 ========================================== 
6-
 ● Item 1 
7-
 
3+
 
4+
 PHP School FTW 
5+
 ========================================== 
6+
 ● Item 1 
7+
 
88

99

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22

3-
 
4-
 PHP School FTW 
5-
 ========================================== 
6-
 ● Item 1 
7-
 
3+
 
4+
 PHP School FTW 
5+
 ========================================== 
6+
 ● Item 1 
7+
 
88

99

1010
 
@@ -14,10 +14,10 @@
1414
 
1515

1616

17-
 
18-
 PHP School FTW 
19-
 ========================================== 
20-
 ● Item 1 
21-
 
17+
 
18+
 PHP School FTW 
19+
 ========================================== 
20+
 ● Item 1 
21+
 
2222

2323

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22

3-
 
4-
 PHP School FTW 
5-
 ========================================== 
6-
 ● Item 1 
7-
 
3+
 
4+
 PHP School FTW 
5+
 ========================================== 
6+
 ● Item 1 
7+
 
88

99

1010
 
@@ -14,10 +14,10 @@
1414
 
1515

1616

17-
 
18-
 PHP School FTW 
19-
 ========================================== 
20-
 ● Item 1 
21-
 
17+
 
18+
 PHP School FTW 
19+
 ========================================== 
20+
 ● Item 1 
21+
 
2222

2323

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22

3-
 
4-
 PHP School FTW 
5-
 ========================================== 
6-
 ● Item 1 
7-
 
3+
 
4+
 PHP School FTW 
5+
 ========================================== 
6+
 ● Item 1 
7+
 
88

99

1010
 
@@ -14,10 +14,10 @@
1414
 
1515

1616

17-
 
18-
 PHP School FTW 
19-
 ========================================== 
20-
 ● Item 1 
21-
 
17+
 
18+
 PHP School FTW 
19+
 ========================================== 
20+
 ● Item 1 
21+
 
2222

2323

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22

3-
 
4-
 PHP School FTW 
5-
 ========================================== 
6-
 ● Item 1 
7-
 
3+
 
4+
 PHP School FTW 
5+
 ========================================== 
6+
 ● Item 1 
7+
 
88

99

1010
 
@@ -14,10 +14,10 @@
1414
 
1515

1616

17-
 
18-
 PHP School FTW 
19-
 ========================================== 
20-
 ● Item 1 
21-
 
17+
 
18+
 PHP School FTW 
19+
 ========================================== 
20+
 ● Item 1 
21+
 
2222

2323

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22

3-
 
4-
 PHP School FTW 
5-
 ========================================== 
6-
 ● Item 1 
7-
 
3+
 
4+
 PHP School FTW 
5+
 ========================================== 
6+
 ● Item 1 
7+
 
88

99

1010
 
@@ -14,10 +14,10 @@
1414
 
1515

1616

17-
 
18-
 PHP School FTW 
19-
 ========================================== 
20-
 ● Item 1 
21-
 
17+
 
18+
 PHP School FTW 
19+
 ========================================== 
20+
 ● Item 1 
21+
 
2222

2323

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11

22

3-
 
4-
 PHP School FTW 
5-
 ========================================== 
6-
 ● Item 1 
7-
 
3+
 
4+
 PHP School FTW 
5+
 ========================================== 
6+
 ● Item 1 
7+
 
88

99

1010
 
1111
 PHP School FTW! 
1212
 
1313

1414

15-
 
16-
 PHP School FTW 
17-
 ========================================== 
18-
 ● Item 1 
19-
 
15+
 
16+
 PHP School FTW 
17+
 ========================================== 
18+
 ● Item 1 
19+
 
2020

2121

test/res/testFlashWithEvenLength.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11

22

3-
 
4-
 PHP School FTW 
5-
 ========================================== 
6-
 ● Item 1 
7-
 
3+
 
4+
 PHP School FTW 
5+
 ========================================== 
6+
 ● Item 1 
7+
 
88

99

1010
 
1111
 PHP School FTW 
1212
 
1313

1414

15-
 
16-
 PHP School FTW 
17-
 ========================================== 
18-
 ● Item 1 
19-
 
15+
 
16+
 PHP School FTW 
17+
 ========================================== 
18+
 ● Item 1 
19+
 
2020

2121

test/res/testFlashWithOddLength.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11

22

3-
 
4-
 PHP School FTW 
5-
 ========================================== 
6-
 ● Item 1 
7-
 
3+
 
4+
 PHP School FTW 
5+
 ========================================== 
6+
 ● Item 1 
7+
 
88

99

1010
 
1111
 PHP School FTW! 
1212
 
1313

1414

15-
 
16-
 PHP School FTW 
17-
 ========================================== 
18-
 ● Item 1 
19-
 
15+
 
16+
 PHP School FTW 
17+
 ========================================== 
18+
 ● Item 1 
19+
 
2020

2121

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11

22

3-
 
4-
 PHP School FTW 
5-
 ========================================== 
6-
 ● Item 1 
7-
 
3+
 
4+
 PHP School FTW 
5+
 ========================================== 
6+
 ● Item 1 
7+
 
88

99

1010

1111

12-
 
13-
 PHP School FTW 
14-
 ========================================== 
15-
 ● Item 1 
16-
 
12+
 
13+
 PHP School FTW 
14+
 ========================================== 
15+
 ● Item 1 
16+
 
1717

1818

test/res/testSimpleOpenClose.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22

3-
 
4-
 PHP School FTW 
5-
 ========================================== 
6-
 ● Item 1 
7-
 
3+
 
4+
 PHP School FTW 
5+
 ========================================== 
6+
 ● Item 1 
7+
 
88

99

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22

3-
 
4-
   
5-
  PHP School FTW  
6-
  ======================================  
7-
  ● Item 1  
8-
   
9-
 
3+
 
4+
   
5+
  PHP School FTW  
6+
  ======================================  
7+
  ● Item 1  
8+
   
9+
 
1010

1111

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22

3-
   
4-
  PHP School FTW  
5-
  ======================================  
6-
  ● Item 1  
7-
   
3+
   
4+
  PHP School FTW  
5+
  ======================================  
6+
  ● Item 1  
7+
   
88

99

0 commit comments

Comments
 (0)