| Conditions | 5 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | 9 | public static function createReport(ReportableInterface $reportable): ReportInterface |
|
| 26 | { |
||
| 27 | 9 | if ($reportable instanceof Timer) { |
|
| 28 | return |
||
| 29 | 7 | new TimerReport($reportable); |
|
| 30 | } |
||
| 31 | 7 | if ($reportable instanceof Counter) { |
|
| 32 | return |
||
| 33 | 6 | new CounterReport($reportable); |
|
| 34 | } |
||
| 35 | 6 | if ($reportable instanceof Profiler) { |
|
| 36 | return |
||
| 37 | 5 | new ProfilerReport($reportable); |
|
| 38 | } |
||
| 39 | 3 | if ($reportable instanceof Benchmark) { |
|
| 40 | return |
||
| 41 | 2 | new BenchmarkReport($reportable); |
|
| 42 | } |
||
| 43 | 1 | throw new \RuntimeException('Attempt to create unimplemented report: ' . typeOf($reportable)); |
|
| 44 | } |
||
| 46 |