@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | return |
50 | 50 | new BenchmarkReport($reportable); |
51 | 51 | } |
52 | - throw new \RuntimeException('Attempt to create unimplemented report for: ' . typeOf($reportable)); |
|
52 | + throw new \RuntimeException('Attempt to create unimplemented report for: '.typeOf($reportable)); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -74,6 +74,6 @@ discard block |
||
74 | 74 | return |
75 | 75 | new BenchmarkReportFormatter($report); |
76 | 76 | } |
77 | - throw new \RuntimeException('Attempt to create unimplemented formatter for: ' . typeOf($report)); |
|
77 | + throw new \RuntimeException('Attempt to create unimplemented formatter for: '.typeOf($report)); |
|
78 | 78 | } |
79 | 79 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | return |
38 | 38 | sprintf( |
39 | - self::ELAPSED . ': %s %s', |
|
39 | + self::ELAPSED.': %s %s', |
|
40 | 40 | $this->ftime($this->report->getElapsed()), |
41 | 41 | $eol ? PHP_EOL : '' |
42 | 42 | ); |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | { |
56 | 56 | $r = $this->report; |
57 | 57 | return sprintf( |
58 | - self::TIMER . '%s: ' . |
|
59 | - self::AVERAGE . ': %s, ' . |
|
60 | - self::LAST . ': %s, ' . |
|
61 | - self::MIN . '(%s): %s, ' . |
|
62 | - self::MAX . '(%s): %s, ' . |
|
63 | - self::COUNT . ': %s, ' . |
|
64 | - self::ELAPSED . ': %s%s', |
|
58 | + self::TIMER.'%s: '. |
|
59 | + self::AVERAGE.': %s, '. |
|
60 | + self::LAST.': %s, '. |
|
61 | + self::MIN.'(%s): %s, '. |
|
62 | + self::MAX.'(%s): %s, '. |
|
63 | + self::COUNT.': %s, '. |
|
64 | + self::ELAPSED.': %s%s', |
|
65 | 65 | $this->fname($r->getName()), |
66 | 66 | $this->ftime($r->getAverageValue()), |
67 | 67 | $this->ftime($r->getLastValue()), |
@@ -80,6 +80,6 @@ discard block |
||
80 | 80 | if (DEFAULT_NAME === $name) { |
81 | 81 | return ''; |
82 | 82 | } |
83 | - return '[' . $name . ']'; |
|
83 | + return '['.$name.']'; |
|
84 | 84 | } |
85 | 85 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | return |
37 | 37 | sprintf( |
38 | - self::COUNTER . ': %s%s', |
|
38 | + self::COUNTER.': %s%s', |
|
39 | 39 | (string)$this->report->getValue(), |
40 | 40 | $eol ? PHP_EOL : '' |
41 | 41 | ); |
@@ -49,15 +49,15 @@ discard block |
||
49 | 49 | { |
50 | 50 | return |
51 | 51 | sprintf( |
52 | - self::COUNTER . '[%s]: ' . |
|
53 | - self::VALUE . ': %s, ' . |
|
54 | - self::STEP . ': %s, ' . |
|
55 | - self::BUMPED . ': %s, ' . |
|
56 | - self::PATH . ': %s, ' . |
|
57 | - self::LENGTH . ': %s, ' . |
|
58 | - self::MAX . ': %s, ' . |
|
59 | - self::MIN . ': %s, ' . |
|
60 | - self::DIFF . ': %s %s', |
|
52 | + self::COUNTER.'[%s]: '. |
|
53 | + self::VALUE.': %s, '. |
|
54 | + self::STEP.': %s, '. |
|
55 | + self::BUMPED.': %s, '. |
|
56 | + self::PATH.': %s, '. |
|
57 | + self::LENGTH.': %s, '. |
|
58 | + self::MAX.': %s, '. |
|
59 | + self::MIN.': %s, '. |
|
60 | + self::DIFF.': %s %s', |
|
61 | 61 | $this->report->getName(), |
62 | 62 | (string)$this->report->getValue(), |
63 | 63 | (string)$this->report->getStep(), |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | private function computeBumped(): string |
78 | 78 | { |
79 | 79 | return sprintf( |
80 | - self::FORWARD . '%s ' . self::BACKWARD . '%s', |
|
80 | + self::FORWARD.'%s '.self::BACKWARD.'%s', |
|
81 | 81 | $this->report->getBumpedForward(), |
82 | 82 | $this->report->getBumpedBack() |
83 | 83 | ); |
@@ -33,17 +33,17 @@ |
||
33 | 33 | $this->progressBar = new ProgressBar($this->output, $this->advanceSteps); |
34 | 34 | $this->progressBar->setBarWidth($this->progressBarWidth); |
35 | 35 | $progressStart = |
36 | - function (): void { |
|
36 | + function(): void { |
|
37 | 37 | $this->progressBar->start(); |
38 | 38 | }; |
39 | 39 | |
40 | 40 | $progressAdvance = |
41 | - function (): void { |
|
41 | + function(): void { |
|
42 | 42 | $this->progressBar->advance(); |
43 | 43 | }; |
44 | 44 | |
45 | 45 | $progressFinish = |
46 | - function (): void { |
|
46 | + function(): void { |
|
47 | 47 | $this->progressBar->finish(); |
48 | 48 | $this->progressBar->clear(); |
49 | 49 | }; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | { |
52 | 52 | $this->iterations = $this->refineIterations($iterations); |
53 | 53 | |
54 | - $this->generatorFunction = function (int $iterations, int $i = 1): \Generator { |
|
54 | + $this->generatorFunction = function(int $iterations, int $i = 1): \Generator { |
|
55 | 55 | while ($i <= $iterations) { |
56 | 56 | yield $i++; |
57 | 57 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | $iterations = $iterations ?? self::MIN_ITERATIONS; |
67 | 67 | if ($iterations < self::MIN_ITERATIONS) { |
68 | - throw new \RuntimeException(__CLASS__ . ': Iterations should greater then ' . self::MIN_ITERATIONS); |
|
68 | + throw new \RuntimeException(__CLASS__.': Iterations should greater then '.self::MIN_ITERATIONS); |
|
69 | 69 | } |
70 | 70 | return $iterations; |
71 | 71 | } |
@@ -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 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function getString(): string |
19 | 19 | { |
20 | - $str = self::BENCHMARK . PHP_EOL; |
|
20 | + $str = self::BENCHMARK.PHP_EOL; |
|
21 | 21 | /** @var BenchmarkFunction $function */ |
22 | 22 | foreach ($this->report->getFunctions() as $name => $function) { |
23 | 23 | $str .= (new BenchmarkFunctionFormatter($function))->getString(); |
@@ -26,10 +26,10 @@ |
||
26 | 26 | public function getString(): string |
27 | 27 | { |
28 | 28 | return |
29 | - $this->formatBenchmarkRelative() . |
|
29 | + $this->formatBenchmarkRelative(). |
|
30 | 30 | (empty($exception = $this->formatException()) ? |
31 | 31 | PHP_EOL : |
32 | - static::EXCEPTIONS . PHP_EOL . $exception); |
|
32 | + static::EXCEPTIONS.PHP_EOL.$exception); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -31,7 +31,7 @@ |
||
31 | 31 | $r .= $report; |
32 | 32 | } |
33 | 33 | } |
34 | - return $r . $elapsed; |
|
34 | + return $r.$elapsed; |
|
35 | 35 | } |
36 | 36 | // public function getString(): string |
37 | 37 | // { |