| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | protected function formatTimelineData(): array |
||
| 40 | { |
||
| 41 | $data = []; |
||
| 42 | |||
| 43 | $benchmark = single_service('timer'); |
||
| 44 | $rows = $benchmark->getTimers(6); |
||
| 45 | |||
| 46 | foreach ($rows as $name => $info) { |
||
| 47 | if ($name === 'total_execution') { |
||
| 48 | continue; |
||
| 49 | } |
||
| 50 | |||
| 51 | $data[] = [ |
||
| 52 | 'name' => ucwords(str_replace('_', ' ', $name)), |
||
| 53 | 'component' => 'Timer', |
||
| 54 | 'start' => $info['start'], |
||
| 55 | 'duration' => $info['end'] - $info['start'], |
||
| 56 | ]; |
||
| 57 | } |
||
| 58 | |||
| 59 | return $data; |
||
| 60 | } |
||
| 62 |