| Conditions | 5 |
| Paths | 8 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 75 | function heartbeat(): string |
||
| 76 | { |
||
| 77 | 12 | static $heartCycle = 0; |
|
| 78 | 12 | if ($heartCycle >= 4) { |
|
| 79 | 2 | $heartCycle = 0; |
|
| 80 | } |
||
| 81 | 12 | switch (++$heartCycle) { |
|
| 82 | 12 | case 1: |
|
| 83 | 3 | return HEARTBEAT_0; |
|
| 84 | 9 | case 2: |
|
| 85 | 3 | return HEARTBEAT_1; |
|
| 86 | 6 | case 3: |
|
| 87 | 3 | return HEARTBEAT_2; |
|
| 88 | } |
||
| 89 | 3 | return HEARTBEAT_3; |
|
| 90 | } |
||
| 92 |