Passed
Push — develop ( d23fdb...c69d0d )
by nguereza
01:56
created
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 1 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/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 1 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.
src/Output/Writer.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -607,8 +607,7 @@  discard block
 block discarded – undo
607 607
  * @method Writer darkgrayBgWhite(string $text, bool $eol = false)
608 608
  * @method Writer darkgrayBgGray(string $text, bool $eol = false)
609 609
  */
610
-class Writer
611
-{
610
+class Writer {
612 611
 
613 612
     /**
614 613
      * The output stream
@@ -645,8 +644,7 @@  discard block
 block discarded – undo
645 644
      * @param string|null $path the output write path
646 645
      * @param Color|null $color the color instance
647 646
      */
648
-    public function __construct(?string $path = null, ?Color $color = null)
649
-    {
647
+    public function __construct(?string $path = null, ?Color $color = null) {
650 648
         $stream = null;
651 649
         if ($path !== null) {
652 650
             $stream = fopen($path, 'w');
@@ -773,8 +771,7 @@  discard block
 block discarded – undo
773 771
      * @param array<int, mixed> $args
774 772
      * @return $this
775 773
      */
776
-    public function __call(string $method, array $args = [])
777
-    {
774
+    public function __call(string $method, array $args = []) {
778 775
         if (method_exists($this->cursor, $method)) {
779 776
             return $this->cursor->{$method}(...$args);
780 777
         }
Please login to merge, or discard this patch.
src/Output/Color.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -609,8 +609,7 @@  discard block
 block discarded – undo
609 609
  * @method string darkgrayBgWhite(string $text)
610 610
  * @method string darkgrayBgGray(string $text)
611 611
 */
612
-class Color
613
-{
612
+class Color {
614 613
 
615 614
     /**
616 615
      * The color constants
@@ -766,8 +765,7 @@  discard block
 block discarded – undo
766 765
      * @return mixed
767 766
      * @throws Error
768 767
      */
769
-    public function __call(string $method, array $args = [])
770
-    {
768
+    public function __call(string $method, array $args = []) {
771 769
         $colors = [
772 770
             'black' => self::BLACK,
773 771
             'red' => self::RED,
Please login to merge, or discard this patch.
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
         $input = '';
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
         $input = 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/Parser.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@  discard block
 block discarded – undo
56 56
  * Class Parser
57 57
  * @package Platine\Console\Input
58 58
  */
59
-abstract class Parser
60
-{
59
+abstract class Parser {
61 60
 
62 61
     /**
63 62
      * The last seen variadic option name
@@ -190,8 +189,7 @@  discard block
 block discarded – undo
190 189
      * @param string $arg
191 190
      * @return mixed
192 191
      */
193
-    protected function parseArgument(string $arg)
194
-    {
192
+    protected function parseArgument(string $arg) {
195 193
         if ($this->lastVariadic) {
196 194
             return $this->set($this->lastVariadic, $arg, true);
197 195
         }
@@ -216,8 +214,7 @@  discard block
 block discarded – undo
216 214
      * @param string|null $nextArg
217 215
      * @return mixed|bool
218 216
      */
219
-    protected function parseOptions(string $arg, ?string $nextArg = null)
220
-    {
217
+    protected function parseOptions(string $arg, ?string $nextArg = null) {
221 218
         $value = null;
222 219
         if ($nextArg !== null && substr($nextArg, 0, 1) !== '-') {
223 220
             $value =  $nextArg;
Please login to merge, or discard this patch.
src/Command/Command.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -64,8 +64,7 @@  discard block
 block discarded – undo
64 64
  * Class Command
65 65
  * @package Platine\Console\Command
66 66
  */
67
-class Command extends Parser
68
-{
67
+class Command extends Parser {
69 68
 
70 69
     /**
71 70
      * The command version
@@ -396,8 +395,7 @@  discard block
 block discarded – undo
396 395
      * Show this command help and abort
397 396
      * @return mixed
398 397
      */
399
-    public function showHelp()
400
-    {
398
+    public function showHelp() {
401 399
         $io = $this->io();
402 400
         $helper = new OutputHelper($io->writer());
403 401
 
@@ -443,8 +441,7 @@  discard block
 block discarded – undo
443 441
      * Show this command version and abort
444 442
      * @return mixed
445 443
      */
446
-    public function showVersion()
447
-    {
444
+    public function showVersion() {
448 445
         $this->writer()->bold(
449 446
             sprintf(
450 447
                 '%s, %s',
@@ -461,8 +458,7 @@  discard block
 block discarded – undo
461 458
      * Execute the command
462 459
      * @return mixed
463 460
      */
464
-    public function execute()
465
-    {
461
+    public function execute() {
466 462
     }
467 463
 
468 464
     /**
@@ -481,16 +477,14 @@  discard block
 block discarded – undo
481 477
      * @param mixed $object
482 478
      * @return mixed
483 479
      */
484
-    public function tap($object = null)
485
-    {
480
+    public function tap($object = null) {
486 481
         return $object ?? $this->app;
487 482
     }
488 483
 
489 484
     /**
490 485
      * {@inheritdoc}
491 486
      */
492
-    public function emit(string $event, $value = null)
493
-    {
487
+    public function emit(string $event, $value = null) {
494 488
         if (empty($this->events[$event])) {
495 489
             return null;
496 490
         }
@@ -503,8 +497,7 @@  discard block
 block discarded – undo
503 497
      * @param string $longName
504 498
      * @return mixed|null
505 499
      */
506
-    public function getOptionValue(string $longName)
507
-    {
500
+    public function getOptionValue(string $longName) {
508 501
         $values = $this->values();
509 502
 
510 503
         return array_key_exists($longName, $values)
@@ -517,8 +510,7 @@  discard block
 block discarded – undo
517 510
      * @param string $name
518 511
      * @return mixed|null
519 512
      */
520
-    public function getArgumentValue(string $name)
521
-    {
513
+    public function getArgumentValue(string $name) {
522 514
         $values = $this->values();
523 515
 
524 516
         return array_key_exists($name, $values)
@@ -551,8 +543,7 @@  discard block
 block discarded – undo
551 543
     /**
552 544
      * {@inheritdoc}
553 545
      */
554
-    protected function handleUnknown(string $arg, $value = null)
555
-    {
546
+    protected function handleUnknown(string $arg, $value = null) {
556 547
         if ($this->allowUnknown) {
557 548
             return $this->set(Helper::toCamelCase($arg), $value);
558 549
         }
Please login to merge, or discard this patch.