| Total Complexity | 6 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Coverage | 96.67% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class BenchmarkReportFormatter extends ReportFormatter |
||
| 11 | { |
||
| 12 | /** @var BenchmarkReport */ |
||
| 13 | protected $report; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * {@inheritdoc} |
||
| 17 | */ |
||
| 18 | 4 | public function getString(): string |
|
| 19 | { |
||
| 20 | 4 | $str = self::BENCHMARK . PHP_EOL; |
|
| 21 | /** @var BenchmarkFunction $function */ |
||
| 22 | 4 | foreach ($this->report->getFunctions() as $name => $function) { |
|
| 23 | 4 | $str .= (new BenchmarkFunctionFormatter($function))->getString(); |
|
| 24 | } |
||
| 25 | return |
||
| 26 | 4 | sprintf( |
|
| 27 | 4 | '%s%s%s%s', |
|
| 28 | 4 | $str, |
|
| 29 | 4 | $this->countersStatistics(), |
|
| 30 | 4 | $this->report->getMemoryUsageReport(), |
|
| 31 | 4 | PHP_EOL |
|
| 32 | ); |
||
| 33 | } |
||
| 34 | |||
| 35 | 4 | private function countersStatistics(): string |
|
| 52 | ); |
||
| 53 | } |
||
| 54 | |||
| 55 | 3 | private function countedExceptions($added, $benchmarked): string |
|
| 68 |