| Total Complexity | 3 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class ApolloServiceProcess implements CustomProcessInterface |
||
| 11 | { |
||
| 12 | /**@var Apollo $apollo */ |
||
| 13 | protected static $apollo; |
||
| 14 | |||
| 15 | public static function getDefinition() |
||
| 16 | { |
||
| 17 | return [ |
||
| 18 | 'apollo-service' => [ |
||
| 19 | 'class' => self::class, |
||
| 20 | 'redirect' => false, |
||
| 21 | 'pipe' => 0, |
||
| 22 | ], |
||
| 23 | ]; |
||
| 24 | } |
||
| 25 | |||
| 26 | public static function callback(Server $swoole, Process $process) |
||
| 27 | { |
||
| 28 | self::$apollo = Apollo::createFromEnv(); |
||
| 29 | self::$apollo->startWatchNotification(function (array $notifications) use ($swoole) { |
||
|
|
|||
| 30 | self::$apollo->pullAllAndSave(base_path('.env'), false); |
||
| 31 | $swoole->reload(); |
||
| 32 | Coroutine::sleep(3); |
||
| 33 | }); |
||
| 34 | } |
||
| 35 | |||
| 36 | public static function onReload(Server $swoole, Process $process) |
||
| 40 | } |
||
| 41 | } |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.