| Total Complexity | 6 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | class Harvester |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var HScanner |
||
| 19 | */ |
||
| 20 | private static $scanner = null; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param Telemetry $source |
||
| 24 | * @param int $period |
||
| 25 | * @return Telemetry |
||
| 26 | */ |
||
| 27 | public static function join(Telemetry $source, int $period = 5) : Telemetry |
||
| 28 | { |
||
| 29 | if (DI::has(Daemon::class)) { |
||
| 30 | (self::$scanner ?? self::$scanner = new HScanner(DI::get(Daemon::class))) |
||
| 31 | ->sourcing($source, $period) |
||
| 32 | ; |
||
| 33 | } |
||
| 34 | return $source; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param Telemetry $source |
||
| 39 | */ |
||
| 40 | public static function forget(Telemetry $source) : void |
||
| 41 | { |
||
| 42 | self::$scanner && self::$scanner->removing($source); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | */ |
||
| 47 | public static function shutdown() : void |
||
| 50 | } |
||
| 51 | } |
||
| 52 |