@@ -18,17 +18,17 @@ |
||
18 | 18 | if (!$quiet) { |
19 | 19 | $s = $spinner ?? new SnakeSpinner('Benchmarking'); |
20 | 20 | $progressStart = |
21 | - static function () use ($s): void { |
|
21 | + static function() use ($s): void { |
|
22 | 22 | echo $s->begin(); |
23 | 23 | }; |
24 | 24 | |
25 | 25 | $progressAdvance = |
26 | - static function () use ($s): void { |
|
26 | + static function() use ($s): void { |
|
27 | 27 | echo $s->spin(); |
28 | 28 | }; |
29 | 29 | |
30 | 30 | $progressFinish = |
31 | - static function () use ($s): void { |
|
31 | + static function() use ($s): void { |
|
32 | 32 | echo $s->end(); |
33 | 33 | }; |
34 | 34 |
@@ -13,18 +13,18 @@ |
||
13 | 13 | // @codeCoverageIgnoreStart |
14 | 14 | if (!$quiet) { |
15 | 15 | $progressStart = |
16 | - static function () use ($width): void { |
|
17 | - echo ' [' . str_repeat('░', $width) . ']'; |
|
18 | - echo "\e[" . ($width + 1) . 'D'; |
|
16 | + static function() use ($width): void { |
|
17 | + echo ' ['.str_repeat('░', $width).']'; |
|
18 | + echo "\e[".($width + 1).'D'; |
|
19 | 19 | }; |
20 | 20 | $progressAdvance = |
21 | - static function (): void { |
|
21 | + static function(): void { |
|
22 | 22 | echo '█'; |
23 | 23 | }; |
24 | 24 | |
25 | 25 | $progressFinish = |
26 | - static function () use ($width): void { |
|
27 | - echo "\e[" . ($width + 1) . 'D'; |
|
26 | + static function() use ($width): void { |
|
27 | + echo "\e[".($width + 1).'D'; |
|
28 | 28 | echo "\e[K"; |
29 | 29 | }; |
30 | 30 |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | $this->styles = $this->getStyles(); |
33 | 33 | |
34 | 34 | $this->message = $this->refineStr($message, $prefix, $suffix); |
35 | - $strLen = strlen($this->message . static::PADDING_STR) + 2; |
|
36 | - $this->resetStr = Strings::ESC . "[{$strLen}D"; |
|
35 | + $strLen = strlen($this->message.static::PADDING_STR) + 2; |
|
36 | + $this->resetStr = Strings::ESC."[{$strLen}D"; |
|
37 | 37 | $this->style = $this->getStyle(); |
38 | 38 | } |
39 | 39 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | protected function refineStr(string $str, string $prefix, string $suffix): string |
78 | 78 | { |
79 | - return $prefix . $str . $suffix; |
|
79 | + return $prefix.$str.$suffix; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -86,40 +86,40 @@ discard block |
||
86 | 86 | { |
87 | 87 | if (null === $this->styles) { |
88 | 88 | return |
89 | - function (): string { |
|
90 | - return static::PADDING_STR . $this->spinnerSymbols->value(); |
|
89 | + function(): string { |
|
90 | + return static::PADDING_STR.$this->spinnerSymbols->value(); |
|
91 | 91 | }; |
92 | 92 | } |
93 | 93 | return |
94 | - function (): string { |
|
94 | + function(): string { |
|
95 | 95 | return |
96 | - static::PADDING_STR . |
|
97 | - Strings::ESC . |
|
98 | - "[{$this->styles->value()}m{$this->spinnerSymbols->value()}" . |
|
99 | - Strings::ESC . '[0m'; |
|
96 | + static::PADDING_STR. |
|
97 | + Strings::ESC. |
|
98 | + "[{$this->styles->value()}m{$this->spinnerSymbols->value()}". |
|
99 | + Strings::ESC.'[0m'; |
|
100 | 100 | }; |
101 | 101 | } |
102 | 102 | |
103 | 103 | /** {@inheritDoc} */ |
104 | 104 | public function begin(): string |
105 | 105 | { |
106 | - return $this->work() . $this->resetStr; |
|
106 | + return $this->work().$this->resetStr; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | protected function work(): string |
110 | 110 | { |
111 | - return ($this->style)() . $this->message; |
|
111 | + return ($this->style)().$this->message; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** {@inheritDoc} */ |
115 | 115 | public function spin(): string |
116 | 116 | { |
117 | - return $this->work() . $this->resetStr; |
|
117 | + return $this->work().$this->resetStr; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** {@inheritDoc} */ |
121 | 121 | public function end(): string |
122 | 122 | { |
123 | - return $this->resetStr . Strings::ESC . '[K'; |
|
123 | + return $this->resetStr.Strings::ESC.'[K'; |
|
124 | 124 | } |
125 | 125 | } |