| Conditions | 3 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | public function cpu(): Cpu |
||
| 39 | { |
||
| 40 | $now = $this->clock->now(); |
||
| 41 | |||
| 42 | if ( |
||
| 43 | $this->cachedAt && |
||
| 44 | $this->threshold->longerThan( |
||
| 45 | $now->elapsedSince($this->cachedAt) |
||
| 46 | ) |
||
| 47 | ) { |
||
| 48 | return $this->data; |
||
| 49 | } |
||
| 50 | |||
| 51 | $this->data = $this->server->cpu(); |
||
| 52 | $this->cachedAt = $now; |
||
| 53 | |||
| 54 | return $this->data; |
||
| 55 | } |
||
| 82 |