| Total Complexity | 5 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | final class ProcessDescriptorCache |
||
| 19 | { |
||
| 20 | /** @var array<int, TargetProcessDescriptor> */ |
||
| 21 | private $cache = []; |
||
| 22 | |||
| 23 | public function set(TargetProcessDescriptor $target_process_descriptor): void |
||
| 24 | { |
||
| 25 | $this->cache[$target_process_descriptor->pid] = $target_process_descriptor; |
||
| 26 | } |
||
| 27 | |||
| 28 | public function setInvalid(int $pid): void |
||
| 29 | { |
||
| 30 | $this->cache[$pid] = TargetProcessDescriptor::getInvalid(); |
||
| 31 | } |
||
| 32 | |||
| 33 | public function get(int $pid): ?TargetProcessDescriptor |
||
| 34 | { |
||
| 35 | return $this->cache[$pid] ?? null; |
||
| 36 | } |
||
| 37 | |||
| 38 | public function removeDisappeared(int ...$pids): void |
||
| 44 | } |
||
| 45 | } |
||
| 46 | } |
||
| 47 |