| Conditions | 5 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 14 | public function report(bool $rebuild = true): ReportInterface |
|
| 24 | { |
||
| 25 | 14 | if ($this instanceof Benchmark && $this->isNotLaunched()) { |
|
| 26 | 1 | throw new \RuntimeException('You should launch a benchmark by run() before getting a report'); |
|
| 27 | } |
||
| 28 | 14 | if (null === $this->reportObject || true === $rebuild) { |
|
| 29 | 14 | $this->prepareForReport(); |
|
| 30 | 14 | $this->reportObject = |
|
| 31 | 14 | Factory::makeReport( |
|
| 32 | /** @scrutinizer ignore-type */ |
||
| 33 | 14 | $this |
|
| 34 | ); |
||
| 35 | } |
||
| 36 | return |
||
| 37 | 14 | $this->reportObject; |
|
| 38 | } |
||
| 66 |