@@ -67,7 +67,7 @@ |
||
67 | 67 | public function check(?int $iterationNumber = null): self |
68 | 68 | { |
69 | 69 | if ($this->isStopped()) { |
70 | - throw new \RuntimeException('Timer[' . $this->name . '] is already stopped.'); |
|
70 | + throw new \RuntimeException('Timer['.$this->name.'] is already stopped.'); |
|
71 | 71 | } |
72 | 72 | if ($this->isNotStarted()) { |
73 | 73 | $this->start(); |
@@ -4,4 +4,4 @@ |
||
4 | 4 | |
5 | 5 | // @codeCoverageIgnoreStart |
6 | 6 | /** @internal */ |
7 | -define(__NAMESPACE__ .'\HRTIMER_VALUE_COEFFICIENT', 1E9); |
|
7 | +define(__NAMESPACE__.'\HRTIMER_VALUE_COEFFICIENT', 1E9); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | protected function wrongReportable(string $expected, ReportableInterface $reportable): void |
28 | 28 | { |
29 | 29 | throw new \RuntimeException( |
30 | - 'Instance of [' . $expected . '] expected, [' . typeOf($reportable) . '] given' |
|
30 | + 'Instance of ['.$expected.'] expected, ['.typeOf($reportable).'] given' |
|
31 | 31 | ); |
32 | 32 | } |
33 | 33 | } |
@@ -18,13 +18,13 @@ |
||
18 | 18 | $this->progressBarWidth = $this->advanceSteps = $progressBarWidth ?? $this->advanceSteps; |
19 | 19 | |
20 | 20 | $progressAdvance = |
21 | - function (): void { |
|
21 | + function(): void { |
|
22 | 22 | echo '*'; |
23 | 23 | }; |
24 | 24 | |
25 | 25 | $progressFinish = |
26 | - function (): void { |
|
27 | - echo "\e[" . $this->progressBarWidth . 'D'; |
|
26 | + function(): void { |
|
27 | + echo "\e[".$this->progressBarWidth.'D'; |
|
28 | 28 | echo "\e[K"; |
29 | 29 | }; |
30 | 30 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | // There is almost no sense to use polyfill function. |
37 | 37 | // If you're REALLY need to use HRTimer set `$ignoreVersionRestrictions` to true. |
38 | 38 | // Otherwise use `Timer::class` instance instead. |
39 | - throw new \RuntimeException('[' . static::class . '] Your php version is below 7.3.0.'); |
|
39 | + throw new \RuntimeException('['.static::class.'] Your php version is below 7.3.0.'); |
|
40 | 40 | } |
41 | 41 | if (PHP_INT_SIZE < INT_SIZE_64BIT) { |
42 | 42 | // `HRTimer::class` is designed and tested in 64bit environment |
@@ -81,7 +81,7 @@ |
||
81 | 81 | return |
82 | 82 | static::getBenchmarkFunctionFormatter(); |
83 | 83 | } |
84 | - throw new \RuntimeException('Formatter [' . typeOf($formatter) . '] is not accepted.'); |
|
84 | + throw new \RuntimeException('Formatter ['.typeOf($formatter).'] is not accepted.'); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -42,17 +42,17 @@ discard block |
||
42 | 42 | $this->progressBar->setFormat(static::DEFAULT_PROGRESSBAR_FORMAT); |
43 | 43 | |
44 | 44 | $progressStart = |
45 | - function (): void { |
|
45 | + function(): void { |
|
46 | 46 | $this->progressBar->start(); |
47 | 47 | }; |
48 | 48 | |
49 | 49 | $progressAdvance = |
50 | - function (): void { |
|
50 | + function(): void { |
|
51 | 51 | $this->progressBar->advance(); |
52 | 52 | }; |
53 | 53 | |
54 | 54 | $progressFinish = |
55 | - function (): void { |
|
55 | + function(): void { |
|
56 | 56 | $this->progressBar->finish(); |
57 | 57 | $this->progressBar->clear(); |
58 | 58 | }; |
@@ -108,11 +108,11 @@ discard block |
||
108 | 108 | |
109 | 109 | protected function showComment(string $comment = ''): void |
110 | 110 | { |
111 | - $this->output->writeln('<comment>' . $comment . '</>'); |
|
111 | + $this->output->writeln('<comment>'.$comment.'</>'); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | protected function sectionSeparator(?string $char): string |
115 | 115 | { |
116 | - return str_repeat($char ?? static::DEFAULT_SEPARATOR_CHAR, $this->terminalWidth) . PHP_EOL. PHP_EOL; |
|
116 | + return str_repeat($char ?? static::DEFAULT_SEPARATOR_CHAR, $this->terminalWidth).PHP_EOL.PHP_EOL; |
|
117 | 117 | } |
118 | 118 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | /** @var CounterValuesInterface $report */ |
36 | 36 | return |
37 | 37 | sprintf( |
38 | - self::COUNTER . ': %s%s', |
|
38 | + self::COUNTER.': %s%s', |
|
39 | 39 | (string)$report->getValue(), |
40 | 40 | $eol ? PHP_EOL : '' |
41 | 41 | ); |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | { |
51 | 51 | return |
52 | 52 | sprintf( |
53 | - self::COUNTER . '[%s]: ' . |
|
54 | - self::VALUE . ': %s, ' . |
|
55 | - self::STEP . ': %s, ' . |
|
56 | - self::BUMPED . ': %s%s', |
|
53 | + self::COUNTER.'[%s]: '. |
|
54 | + self::VALUE.': %s, '. |
|
55 | + self::STEP.': %s, '. |
|
56 | + self::BUMPED.': %s%s', |
|
57 | 57 | $report->getName(), |
58 | 58 | (string)$report->getValue(), |
59 | 59 | (string)$report->getStep(), |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | { |
71 | 71 | return |
72 | 72 | sprintf( |
73 | - self::FORWARD . '%s ', |
|
73 | + self::FORWARD.'%s ', |
|
74 | 74 | $report->getBumped() |
75 | 75 | ); |
76 | 76 | } |
@@ -38,8 +38,7 @@ discard block |
||
38 | 38 | return |
39 | 39 | $this->theme->dark( |
40 | 40 | 'array' === $type ? |
41 | - $str : |
|
42 | - sprintf( |
|
41 | + $str : sprintf( |
|
43 | 42 | '%s(%s)', |
44 | 43 | $type, |
45 | 44 | $str |
@@ -80,8 +79,7 @@ discard block |
||
80 | 79 | { |
81 | 80 | return |
82 | 81 | $rank === 1 ? |
83 | - $this->averageFirst($average) : |
|
84 | - $this->average($average); |
|
82 | + $this->averageFirst($average) : $this->average($average); |
|
85 | 83 | } |
86 | 84 | |
87 | 85 | protected function averageFirst(float $average): string |