@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | return |
51 | 51 | new BenchmarkReport($reportable); |
52 | 52 | } |
53 | - throw new \RuntimeException('Attempt to create unimplemented report for: ' . typeOf($reportable)); |
|
53 | + throw new \RuntimeException('Attempt to create unimplemented report for: '.typeOf($reportable)); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | return |
76 | 76 | new BenchmarkReportFormatter($report); |
77 | 77 | } |
78 | - throw new \RuntimeException('Attempt to create unimplemented formatter for: ' . typeOf($report)); |
|
78 | + throw new \RuntimeException('Attempt to create unimplemented formatter for: '.typeOf($report)); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function full(): string |
56 | 56 | { |
57 | - $name = $this->report->getName(); |
|
57 | + $name = $this->report->getName(); |
|
58 | 58 | try { |
59 | 59 | $str = sprintf( |
60 | - 'Timer[%s]: Average: %s, Last: %s, Min(%s): %s, Max(%s): %s, Count: %s' . PHP_EOL, |
|
60 | + 'Timer[%s]: Average: %s, Last: %s, Min(%s): %s, Max(%s): %s, Count: %s'.PHP_EOL, |
|
61 | 61 | $this->themed->info($name), |
62 | 62 | $this->themed->comment(format_time_auto($this->report->getAverageValue())), |
63 | 63 | format_time_auto($this->report->getLastValue()), |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } catch (\Throwable $e) { |
71 | 71 | $str = |
72 | 72 | sprintf( |
73 | - 'Timer[%s]: %s' . PHP_EOL, |
|
73 | + 'Timer[%s]: %s'.PHP_EOL, |
|
74 | 74 | $this->themed->red($name), |
75 | 75 | $this->themed->comment('Exception encountered') |
76 | 76 | ); |
@@ -102,7 +102,7 @@ |
||
102 | 102 | public function enumeratedName(): string |
103 | 103 | { |
104 | 104 | return |
105 | - brackets((string)$this->index, BRACKETS_ANGLE) . ' ' . $this->name; |
|
105 | + brackets((string)$this->index, BRACKETS_ANGLE).' '.$this->name; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $this->verbose = false; |
63 | 63 | $this->rewindable = |
64 | 64 | new Rewindable( |
65 | - function (int $iterations, int $i = 1): \Generator { |
|
65 | + function(int $iterations, int $i = 1): \Generator { |
|
66 | 66 | while ($i <= $iterations) { |
67 | 67 | yield $i++; |
68 | 68 | } |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | |
94 | 94 | if ($this->verbose) { |
95 | 95 | $this->erase(); |
96 | - echo ' 100%' . PHP_EOL; |
|
97 | - echo ' λ Done!' . PHP_EOL; |
|
96 | + echo ' 100%'.PHP_EOL; |
|
97 | + echo ' λ Done!'.PHP_EOL; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | if ($printReport) { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | try { |
138 | 138 | $result = $function(...$args); |
139 | 139 | } catch (\Throwable $e) { |
140 | - $this->exceptionMessages[$f->getIndexedName()] = $result = brackets(typeOf($e)) . ': ' . $e->getMessage(); |
|
140 | + $this->exceptionMessages[$f->getIndexedName()] = $result = brackets(typeOf($e)).': '.$e->getMessage(); |
|
141 | 141 | $this->exceptions[$f->getIndexedName()] = $e; |
142 | 142 | $f->setException($e); |
143 | 143 | } |
@@ -111,7 +111,7 @@ |
||
111 | 111 | $timers = []; |
112 | 112 | /** @var BenchmarkFunction $f */ |
113 | 113 | foreach ($this->functions as $f) { |
114 | - $timers[]=$f->getTimer(); |
|
114 | + $timers[] = $f->getTimer(); |
|
115 | 115 | } |
116 | 116 | return $timers; |
117 | 117 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | $rank = 0; |
29 | 29 | $profilerReport = (string)$this->report->getProfiler()->getReport(); |
30 | - $r = 'Benchmark:' . PHP_EOL; |
|
30 | + $r = 'Benchmark:'.PHP_EOL; |
|
31 | 31 | /** @var BenchmarkRelative $result */ |
32 | 32 | foreach ($this->report->getRelatives() as $indexName => $result) { |
33 | 33 | $relative = $result->getRelative(); |
@@ -68,18 +68,18 @@ discard block |
||
68 | 68 | ); |
69 | 69 | if ($this->report->isWithResults()) { |
70 | 70 | $result = $function->getResult(); |
71 | - $r .= $this->themed->dark('return: ' . str_replace('double', 'float', typeOf($result)) . ' "' |
|
72 | - . var_export($function->getResult(), true) . '" ') . PHP_EOL; |
|
71 | + $r .= $this->themed->dark('return: '.str_replace('double', 'float', typeOf($result)).' "' |
|
72 | + . var_export($function->getResult(), true).'" ').PHP_EOL; |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | if (!empty($exceptionMessages = $this->report->getExceptionMessages())) { |
76 | - $r .= 'Exceptions:' . PHP_EOL; |
|
76 | + $r .= 'Exceptions:'.PHP_EOL; |
|
77 | 77 | foreach ($exceptionMessages as $name => $exceptionMessage) { |
78 | - $r .= brackets($name) . ': ' . $this->themed->red($exceptionMessage) . PHP_EOL; |
|
78 | + $r .= brackets($name).': '.$this->themed->red($exceptionMessage).PHP_EOL; |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 | return |
82 | - $r . PHP_EOL . $profilerReport; |
|
82 | + $r.PHP_EOL.$profilerReport; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -15,6 +15,6 @@ |
||
15 | 15 | { |
16 | 16 | $prefix = $prefix ?? ''; |
17 | 17 | return |
18 | - $prefix . number_format($relative * 100, 1) . '%'; |
|
18 | + $prefix.number_format($relative * 100, 1).'%'; |
|
19 | 19 | } |
20 | 20 | } |