Conditions | 3 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public static function callback(Server $swoole, SwooleProcess $process) |
||
28 | { |
||
29 | $filename = base_path('.env'); |
||
30 | $env = getenv('LARAVELS_ENV'); |
||
31 | if ($env) { |
||
32 | $filename .= '.' . $env; |
||
33 | } |
||
34 | |||
35 | self::$apollo = Client::createFromEnv(); |
||
36 | self::$apollo->startWatchNotification(function (array $notifications) use ($process, $filename) { |
||
|
|||
37 | $configs = self::$apollo->pullAllAndSave($filename); |
||
38 | app('log')->info('[ApolloProcess] Pull all configurations', $configs); |
||
39 | $process->exec(PHP_BINARY, [base_path('bin/laravels'), 'reload']); |
||
40 | if (Context::inCoroutine()) { |
||
41 | Coroutine::sleep(5); |
||
42 | } else { |
||
43 | sleep(5); |
||
44 | } |
||
53 | } |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.