@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | $this->styles = $this->getStyles(); |
30 | 30 | |
31 | 31 | $this->str = $this->refineStr($str, $prefix, $suffix); |
32 | - $strLen = strlen($this->str . static::PADDING_STR) + 2; |
|
33 | - $this->resetStr = Strings::ESC . "[{$strLen}D"; |
|
32 | + $strLen = strlen($this->str.static::PADDING_STR) + 2; |
|
33 | + $this->resetStr = Strings::ESC."[{$strLen}D"; |
|
34 | 34 | $this->style = $this->getStyle(); |
35 | 35 | } |
36 | 36 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | protected function refineStr(string $str, string $prefix, string $suffix): string |
73 | 73 | { |
74 | - return $prefix . $str . $suffix; |
|
74 | + return $prefix.$str.$suffix; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -81,17 +81,17 @@ discard block |
||
81 | 81 | { |
82 | 82 | if (null === $this->styles) { |
83 | 83 | return |
84 | - function (): string { |
|
85 | - return static::PADDING_STR . $this->spinnerSymbols->value(); |
|
84 | + function(): string { |
|
85 | + return static::PADDING_STR.$this->spinnerSymbols->value(); |
|
86 | 86 | }; |
87 | 87 | } else { |
88 | 88 | return |
89 | - function (): string { |
|
89 | + function(): string { |
|
90 | 90 | return |
91 | - static::PADDING_STR . |
|
92 | - Strings::ESC . |
|
93 | - "[{$this->styles->value()}m{$this->spinnerSymbols->value()}" . |
|
94 | - Strings::ESC . '[0m'; |
|
91 | + static::PADDING_STR. |
|
92 | + Strings::ESC. |
|
93 | + "[{$this->styles->value()}m{$this->spinnerSymbols->value()}". |
|
94 | + Strings::ESC.'[0m'; |
|
95 | 95 | }; |
96 | 96 | } |
97 | 97 | } |
@@ -99,23 +99,23 @@ discard block |
||
99 | 99 | /** {@inheritDoc} */ |
100 | 100 | public function begin(): string |
101 | 101 | { |
102 | - return $this->work() . $this->resetStr; |
|
102 | + return $this->work().$this->resetStr; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | protected function work(): string |
106 | 106 | { |
107 | - return ($this->style)() . $this->str; |
|
107 | + return ($this->style)().$this->str; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** {@inheritDoc} */ |
111 | 111 | public function spin(): string |
112 | 112 | { |
113 | - return $this->work() . $this->resetStr; |
|
113 | + return $this->work().$this->resetStr; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** {@inheritDoc} */ |
117 | 117 | public function end(): string |
118 | 118 | { |
119 | - return $this->resetStr . Strings::ESC . '[K'; |
|
119 | + return $this->resetStr.Strings::ESC.'[K'; |
|
120 | 120 | } |
121 | 121 | } |
@@ -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 |