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