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