Completed
Push — master ( 41fce2...558613 )
by Michael
9s
created
examples/remove-defaults.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@  discard block
 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
 
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     ->addItem('Second Item', $itemCallable)
16 16
     ->addItem('Third Item', $itemCallable)
17 17
     ->disableDefaultItems()
18
-    ->addItem('CUSTOM CLOSE', function (CliMenu $menu) {
18
+    ->addItem('CUSTOM CLOSE', function(CliMenu $menu) {
19 19
         $menu->close();
20 20
     })
21 21
     ->build();
Please login to merge, or discard this patch.
examples/submenu.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@  discard block
 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
 
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     ->addLineBreak('-')
17 17
     ->addSubMenu('Options')
18 18
         ->setTitle('CLI Menu > Options')
19
-        ->addItem('First option', function (CliMenu $menu) {
19
+        ->addItem('First option', function(CliMenu $menu) {
20 20
             echo sprintf('Executing option: %s', $menu->getSelectedItem()->getText());
21 21
         })
22 22
         ->addLineBreak('-')
Please login to merge, or discard this patch.
examples/useful-separation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@
 block discarded – undo
4 4
 use PhpSchool\CliMenu\CliMenuBuilder;
5 5
 use PhpSchool\CliMenu\MenuItem\MenuItem;
6 6
 
7
-require_once(__DIR__ . '/../vendor/autoload.php');
7
+require_once(__DIR__.'/../vendor/autoload.php');
8 8
 
9
-$itemCallable = function (CliMenu $menu) {
9
+$itemCallable = function(CliMenu $menu) {
10 10
     echo $menu->getSelectedItem()->getText();
11 11
 };
12 12
 
Please login to merge, or discard this patch.
src/MenuItem/AsciiArtItem.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
      */
54 54
     public function getRows(MenuStyle $style, $selected = false)
55 55
     {
56
-        return array_map(function ($row) use ($style) {
56
+        return array_map(function($row) use ($style) {
57 57
             $length = mb_strlen($row);
58 58
 
59 59
             $padding = $style->getContentWidth() - $length;
Please login to merge, or discard this patch.
src/MenuItem/SelectableTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
             )
48 48
         );
49 49
 
50
-        return array_map(function ($row, $key) use ($style, $marker, $length) {
50
+        return array_map(function($row, $key) use ($style, $marker, $length) {
51 51
             if ($key === 0) {
52 52
                 return $this->showItemExtra
53 53
                     ? sprintf('%s%s  %s', $row, str_repeat(' ', $length - mb_strlen($row)), $style->getItemExtra())
Please login to merge, or discard this patch.
src/MenuStyle.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -305,7 +305,7 @@
 block discarded – undo
305 305
      */
306 306
     public function setWidth($width)
307 307
     {
308
-        $availableWidth = $this->terminal->getWidth() - ($this->margin * 2) - ($this->padding * 2);
308
+        $availableWidth = $this->terminal->getWidth() - ($this->margin*2) - ($this->padding*2);
309 309
 
310 310
         if ($width >= $availableWidth) {
311 311
             $width = $availableWidth;
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -376,8 +376,8 @@
 block discarded – undo
376 376
     /**
377 377
      * Get padding for right had side of content
378 378
      *
379
-     * @param $contentLength
380
-     * @return int
379
+     * @param integer $contentLength
380
+     * @return double
381 381
      */
382 382
     public function getRightHandPadding($contentLength)
383 383
     {
Please login to merge, or discard this patch.
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;
4 4
 
5
-use PhpSchool\CliMenu\Exception\InvalidInstantiationException;
6 5
 use PhpSchool\CliMenu\Terminal\TerminalFactory;
7 6
 use PhpSchool\CliMenu\Terminal\TerminalInterface;
8 7
 
Please login to merge, or discard this patch.
src/Terminal/UnixTerminal.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
             exec('stty -icanon');
107 107
             $this->isCanonical = true;
108 108
         } else {
109
-            exec('stty ' . $this->getOriginalConfiguration());
109
+            exec('stty '.$this->getOriginalConfiguration());
110 110
             $this->isCanonical = false;
111 111
         }
112 112
     }
Please login to merge, or discard this patch.
src/Util/StringUtil.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     public static function wordwrap($str, $width, $break = "\n")
23 23
     {
24 24
         $length = 0;
25
-        return implode(" ", array_map(function ($word) use (&$length, $width, $break) {
25
+        return implode(" ", array_map(function($word) use (&$length, $width, $break) {
26 26
             $length += (mb_strlen($word) + 1);
27 27
 
28 28
             if ($length > $width) {
Please login to merge, or discard this patch.
examples/ascii-art.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@
 block discarded – undo
4 4
 use PhpSchool\CliMenu\CliMenuBuilder;
5 5
 use PhpSchool\CliMenu\MenuItem\MenuItem;
6 6
 
7
-require_once(__DIR__ . '/../vendor/autoload.php');
7
+require_once(__DIR__.'/../vendor/autoload.php');
8 8
 
9
-$itemCallable = function (CliMenu $menu) {
9
+$itemCallable = function(CliMenu $menu) {
10 10
     echo $menu->getSelectedItem()->getText();
11 11
 };
12 12
 
Please login to merge, or discard this patch.