Passed
Push — develop ( add880...26f5dd )
by nguereza
02:36
created
src/Input/Reader.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@  discard block
 block discarded – undo
52 52
  * Class Reader
53 53
  * @package Platine\Console\Input
54 54
  */
55
-class Reader
56
-{
55
+class Reader {
57 56
 
58 57
     /**
59 58
      * The input stream
@@ -65,8 +64,7 @@  discard block
 block discarded – undo
65 64
      * Create new instance
66 65
      * @param string|null $path the input read path
67 66
      */
68
-    public function __construct(?string $path = null)
69
-    {
67
+    public function __construct(?string $path = null) {
70 68
         $stream = STDIN;
71 69
         if ($path !== null) {
72 70
             $stream = fopen($path, 'r');
@@ -81,8 +79,7 @@  discard block
 block discarded – undo
81 79
      * @param callable|null $callback The validator/sanitizer callback.
82 80
      * @return mixed
83 81
      */
84
-    public function read($default = null, ?callable $callback = null)
85
-    {
82
+    public function read($default = null, ?callable $callback = null) {
86 83
         $in = '';
87 84
         $read = fgets($this->stream);
88 85
 
@@ -104,8 +101,7 @@  discard block
 block discarded – undo
104 101
      * @param callable|null $callback The validator/sanitizer callback.
105 102
      * @return mixed
106 103
      */
107
-    public function readAll(?callable $callback = null)
108
-    {
104
+    public function readAll(?callable $callback = null) {
109 105
         $in = stream_get_contents($this->stream);
110 106
 
111 107
         return $callback !== null
@@ -118,8 +114,7 @@  discard block
 block discarded – undo
118 114
      * @param callable|null $callback The validator/sanitizer callback.
119 115
      * @return mixed
120 116
      */
121
-    public function readPipe(?callable $callback = null)
122
-    {
117
+    public function readPipe(?callable $callback = null) {
123 118
         $stdin = '';
124 119
         $read = [$this->stream];
125 120
         $write = [];
@@ -145,8 +140,7 @@  discard block
 block discarded – undo
145 140
      * @param callable|null $callback The validator/sanitizer callback.
146 141
      * @return mixed
147 142
      */
148
-    public function readHidden($default = null, ?callable $callback = null)
149
-    {
143
+    public function readHidden($default = null, ?callable $callback = null) {
150 144
         if (substr(strtoupper(PHP_OS), 0, 3) === 'WIN') {
151 145
             return $this->readHiddenWindows($default, $callback);
152 146
         }
@@ -167,8 +161,7 @@  discard block
 block discarded – undo
167 161
      * @param callable|null $callback The validator/sanitizer callback.
168 162
      * @return mixed
169 163
      */
170
-    protected function readHiddenWindows($default = null, ?callable $callback = null)
171
-    {
164
+    protected function readHiddenWindows($default = null, ?callable $callback = null) {
172 165
         $cmd = 'powershell -Command ' . implode('; ', array_filter([
173 166
                     '$pword = Read-Host -AsSecureString',
174 167
                     '$pword = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword)',
Please login to merge, or discard this patch.
src/Input/Option.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,10 +61,10 @@
 block discarded – undo
61 61
      */
62 62
     protected string $short = '';
63 63
 
64
-     /**
65
-     * The long option name
66
-     * @var string
67
-     */
64
+        /**
65
+         * The long option name
66
+         * @var string
67
+         */
68 68
     protected string $long = '';
69 69
 
70 70
     /**
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@
 block discarded – undo
52 52
  * Class Option
53 53
  * @package Platine\Console\Input
54 54
  */
55
-class Option extends Parameter
56
-{
55
+class Option extends Parameter {
57 56
 
58 57
     /**
59 58
      * The short option name
Please login to merge, or discard this patch.
src/Input/Parameter.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@  discard block
 block discarded – undo
54 54
  * Class Parameter
55 55
  * @package Platine\Console\Input
56 56
  */
57
-abstract class Parameter
58
-{
57
+abstract class Parameter {
59 58
 
60 59
     /**
61 60
      * The name of the parameter
@@ -183,8 +182,7 @@  discard block
 block discarded – undo
183 182
      * Return the parameter default value
184 183
      * @return mixed
185 184
      */
186
-    public function getDefault()
187
-    {
185
+    public function getDefault() {
188 186
         if ($this->isVariadic()) {
189 187
             return (array) $this->default;
190 188
         }
@@ -234,8 +232,7 @@  discard block
 block discarded – undo
234 232
      * @param mixed $raw
235 233
      * @return mixed
236 234
      */
237
-    public function filter($raw)
238
-    {
235
+    public function filter($raw) {
239 236
         if ($this->filter !== null) {
240 237
             $callback = $this->filter;
241 238
 
Please login to merge, or discard this patch.
src/Input/Argument.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@
 block discarded – undo
52 52
  * Class Argument
53 53
  * @package Platine\Console\Input
54 54
  */
55
-class Argument extends Parameter
56
-{
55
+class Argument extends Parameter {
57 56
 
58 57
     /**
59 58
      * {@inheritdoc}
Please login to merge, or discard this patch.
src/IO/Interactor.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -248,9 +248,9 @@
 block discarded – undo
248 248
 
249 249
         foreach ($choices as $choice => $desc) {
250 250
             $this->writer->eol()
251
-                         ->cyan(
252
-                             str_pad(' [' . $choice . ']', $maxLength + 6)
253
-                         );
251
+                            ->cyan(
252
+                                str_pad(' [' . $choice . ']', $maxLength + 6)
253
+                            );
254 254
 
255 255
             $this->writer->dim($desc);
256 256
         }
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@  discard block
 block discarded – undo
58 58
  * Class Interactor
59 59
  * @package Platine\Console\IO
60 60
  */
61
-class Interactor
62
-{
61
+class Interactor {
63 62
 
64 63
     /**
65 64
      * Stream reader instance
@@ -78,8 +77,7 @@  discard block
 block discarded – undo
78 77
      * @param string|null $input
79 78
      * @param string|null $output
80 79
      */
81
-    public function __construct(?string $input = null, ?string $output = null)
82
-    {
80
+    public function __construct(?string $input = null, ?string $output = null) {
83 81
         $this->reader = new Reader($input);
84 82
         $this->writer = new Writer($output);
85 83
     }
@@ -124,8 +122,7 @@  discard block
 block discarded – undo
124 122
      *
125 123
      * @return mixed
126 124
      */
127
-    public function choice(string $text, array $choices, $default = null, bool $case = false)
128
-    {
125
+    public function choice(string $text, array $choices, $default = null, bool $case = false) {
129 126
         $this->writer->yellow($text);
130 127
 
131 128
         $this->listOptions($choices, $default, false);
@@ -146,8 +143,7 @@  discard block
 block discarded – undo
146 143
      *
147 144
      * @return mixed
148 145
      */
149
-    public function choices(string $text, array $choices, $default = null, bool $case = false)
150
-    {
146
+    public function choices(string $text, array $choices, $default = null, bool $case = false) {
151 147
         $this->writer->yellow($text);
152 148
 
153 149
         $this->listOptions($choices, $default, true);
Please login to merge, or discard this patch.
src/Output/Writer.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@  discard block
 block discarded – undo
52 52
  * Class Writer
53 53
  * @package Platine\Console\Output
54 54
  */
55
-class Writer
56
-{
55
+class Writer {
57 56
 
58 57
     /**
59 58
      * The output stream
@@ -90,8 +89,7 @@  discard block
 block discarded – undo
90 89
      * @param string|null $path the output write path
91 90
      * @param Color|null $color the color instance
92 91
      */
93
-    public function __construct(?string $path = null, ?Color $color = null)
94
-    {
92
+    public function __construct(?string $path = null, ?Color $color = null) {
95 93
         $stream = null;
96 94
         if ($path !== null) {
97 95
             $stream = fopen($path, 'w');
Please login to merge, or discard this patch.
src/Output/Color.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@
 block discarded – undo
52 52
  * Class Color
53 53
  * @package Platine\Console\Output
54 54
  */
55
-class Color
56
-{
55
+class Color {
57 56
 
58 57
     /**
59 58
      * The color constants
Please login to merge, or discard this patch.
src/Output/Cursor.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@
 block discarded – undo
52 52
  * Class Cursor
53 53
  * @package Platine\Console\Output
54 54
  */
55
-class Cursor
56
-{
55
+class Cursor {
57 56
 
58 57
     /**
59 58
      * Returns signal to move cursor up "count" times.
Please login to merge, or discard this patch.
src/Output/Table.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         list($start, $end) = $normalizedStyles['head'];
81 81
         foreach ($head as $col => $size) {
82 82
             $dash[] = str_repeat('-', (int) $size + 2);
83
-            $title[] = str_pad(Helper::toWords($col), (int)$size, ' ');
83
+            $title[] = str_pad(Helper::toWords($col), (int) $size, ' ');
84 84
         }
85 85
 
86 86
         $titleStr = '|' . $start . ' '
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             $parts = [];
93 93
             list($start, $end) = $normalizedStyles[['even', 'odd'][(int) $odd]];
94 94
             foreach ($head as $col => $size) {
95
-                $parts[] = str_pad(isset($row[$col]) ? $row[$col] : '', (int)$size, ' ');
95
+                $parts[] = str_pad(isset($row[$col]) ? $row[$col] : '', (int) $size, ' ');
96 96
             }
97 97
 
98 98
             $odd = !$odd;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@
 block discarded – undo
55 55
  * Class Table
56 56
  * @package Platine\Console\Output
57 57
  */
58
-class Table
59
-{
58
+class Table {
60 59
 
61 60
     /**
62 61
      * Render table data
Please login to merge, or discard this patch.