@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | : $this->selectedItem++; |
269 | 269 | |
270 | 270 | if (!array_key_exists($this->selectedItem, $this->items)) { |
271 | - $this->selectedItem = $direction === 'UP' |
|
271 | + $this->selectedItem = $direction === 'UP' |
|
272 | 272 | ? end($itemKeys) |
273 | 273 | : reset($itemKeys); |
274 | 274 | } elseif ($this->getSelectedItem()->canSelect()) { |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $frame->addRows($this->drawMenuItem(new LineBreakItem($this->style->getTitleSeparator()))); |
327 | 327 | } |
328 | 328 | |
329 | - array_map(function ($item, $index) use ($frame) { |
|
329 | + array_map(function($item, $index) use ($frame) { |
|
330 | 330 | $frame->addRows($this->drawMenuItem($item, $index === $this->selectedItem)); |
331 | 331 | }, $this->items, array_keys($this->items)); |
332 | 332 | |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | ? $this->style->getInvertedColoursSetCode() |
360 | 360 | : ''; |
361 | 361 | |
362 | - return array_map(function ($row) use ($setColour, $invertedColour, $resetColour) { |
|
362 | + return array_map(function($row) use ($setColour, $invertedColour, $resetColour) { |
|
363 | 363 | return sprintf( |
364 | 364 | "%s%s%s%s%s%s%s%s\n", |
365 | 365 | str_repeat(' ', $this->style->getMargin()), |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $this->emptyRow(); |
37 | 37 | |
38 | 38 | $confirmText = sprintf(' < %s > ', $confirmText); |
39 | - $leftFill = ($promptWidth / 2) - (mb_strlen($confirmText) / 2); |
|
39 | + $leftFill = ($promptWidth/2) - (mb_strlen($confirmText)/2); |
|
40 | 40 | |
41 | 41 | $this->write(sprintf( |
42 | 42 | "%s%s%s%s%s%s%s\n", |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace PhpSchool\CliMenu; |
4 | 4 | |
5 | -use PhpSchool\CliMenu\Exception\InvalidInstantiationException; |
|
6 | 5 | use PhpSchool\CliMenu\Terminal\TerminalFactory; |
7 | 6 | use PhpSchool\CliMenu\Util\ColourUtil; |
8 | 7 | use PhpSchool\Terminal\Terminal; |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | */ |
252 | 252 | protected function calculateContentWidth() : void |
253 | 253 | { |
254 | - $this->contentWidth = $this->width - ($this->padding * 2); |
|
254 | + $this->contentWidth = $this->width - ($this->padding*2); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | public function getFg() |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | public function setMarginAuto() : self |
331 | 331 | { |
332 | 332 | $this->marginAuto = true; |
333 | - $this->margin = floor(($this->terminal->getWidth() - $this->width) / 2); |
|
333 | + $this->margin = floor(($this->terminal->getWidth() - $this->width)/2); |
|
334 | 334 | |
335 | 335 | return $this; |
336 | 336 | } |