| Conditions | 3 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 53 | public function loadAverage(): LoadAverage |
||
| 54 | { |
||
| 55 | $now = $this->clock->now(); |
||
| 56 | |||
| 57 | if ( |
||
| 58 | $this->cachedAt && |
||
| 59 | $this->threshold->longerThan( |
||
| 60 | $now->elapsedSince($this->cachedAt) |
||
| 61 | ) |
||
| 62 | ) { |
||
| 63 | return $this->data; |
||
| 64 | } |
||
| 65 | |||
| 66 | $this->data = $this->server->loadAverage(); |
||
| 67 | $this->cachedAt = $now; |
||
| 68 | |||
| 69 | return $this->data; |
||
| 70 | } |
||
| 82 |