for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Hhxsv5\LaravelS\Swoole\Process;
use Hhxsv5\LaravelS\Components\Apollo\Apollo;
use Swoole\Coroutine;
use Swoole\Http\Server;
use Swoole\Process;
class ApolloServiceProcess implements CustomProcessInterface
{
/**@var Apollo $apollo */
protected static $apollo;
public static function getDefinition()
return [
'apollo-service' => [
'class' => self::class,
'redirect' => false,
'pipe' => 0,
],
];
}
public static function callback(Server $swoole, Process $process)
self::$apollo = Apollo::createFromEnv();
self::$apollo->startWatchNotification(function (array $notifications) use ($swoole) {
$notifications
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
self::$apollo->startWatchNotification(function (/** @scrutinizer ignore-unused */ array $notifications) use ($swoole) {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
self::$apollo->pullAllAndSave(base_path('.env'), false);
$swoole->reload();
Coroutine::sleep(3);
});
public static function onReload(Server $swoole, Process $process)
// Stop the process...
self::$apollo->stopWatchNotification();
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.