@@ -28,6 +28,6 @@ |
||
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | - return $r . $elapsed; |
|
| 31 | + return $r.$elapsed; |
|
| 32 | 32 | } |
| 33 | 33 | } |
@@ -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 | |
@@ -25,10 +25,10 @@ |
||
| 25 | 25 | public function getString(): string |
| 26 | 26 | { |
| 27 | 27 | return |
| 28 | - $this->formatBenchmarkRelative() . |
|
| 28 | + $this->formatBenchmarkRelative(). |
|
| 29 | 29 | (empty($exception = $this->formatException()) ? |
| 30 | 30 | PHP_EOL : |
| 31 | - 'Exceptions:' . PHP_EOL . $exception); |
|
| 31 | + 'Exceptions:'.PHP_EOL.$exception); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -17,14 +17,14 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function getString(): string |
| 19 | 19 | { |
| 20 | - $r = 'Benchmark:' . PHP_EOL; |
|
| 20 | + $r = 'Benchmark:'.PHP_EOL; |
|
| 21 | 21 | /** @var BenchmarkFunction $function */ |
| 22 | 22 | foreach ($this->report->getFunctions() as $name => $function) { |
| 23 | 23 | $r .= (new BenchmarkFunctionFormatter($function))->getString(); |
| 24 | 24 | } |
| 25 | 25 | return |
| 26 | - $r . PHP_EOL . |
|
| 27 | - $this->report->getMemoryUsageReport() . PHP_EOL . |
|
| 26 | + $r.PHP_EOL. |
|
| 27 | + $this->report->getMemoryUsageReport().PHP_EOL. |
|
| 28 | 28 | $this->report->getProfiler()->getReport(); |
| 29 | 29 | } |
| 30 | 30 | } |