@@ -43,13 +43,13 @@ |
||
| 43 | 43 | /** @phpstan-ignore-next-line */ |
| 44 | 44 | return $this->client->keys('users:*') |
| 45 | 45 | ->then( |
| 46 | - function (array $keys) { |
|
| 46 | + function(array $keys) { |
|
| 47 | 47 | $promises = []; |
| 48 | 48 | foreach ($keys as $key) { |
| 49 | 49 | $promises[] = $this->client->get($key); /** @phpstan-ignore-line */ |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - return all($promises)->then(fn (array $results): int => \array_sum($results)); |
|
| 52 | + return all($promises)->then(fn(array $results): int => \array_sum($results)); |
|
| 53 | 53 | } |
| 54 | 54 | ); |
| 55 | 55 | } |
@@ -46,13 +46,13 @@ discard block |
||
| 46 | 46 | $localAddress = $this->config[Configuration::ADDR]; |
| 47 | 47 | $this->shutdownSignal = null; |
| 48 | 48 | $this->metricsHandler->resetUsers($localAddress); |
| 49 | - $loop->addSignal(SIGINT, function ($signal) use ($loop) { |
|
| 49 | + $loop->addSignal(SIGINT, function($signal) use ($loop) { |
|
| 50 | 50 | $this->stop($signal, $loop); |
| 51 | 51 | }); |
| 52 | 52 | $loop->addPeriodicTimer( |
| 53 | 53 | 15, |
| 54 | 54 | fn() => $this->metricsHandler->getNbUsers()->then( |
| 55 | - function (int $nbUsers) { |
|
| 55 | + function(int $nbUsers) { |
|
| 56 | 56 | $memory = \memory_get_usage(true) / 1024 / 1024; |
| 57 | 57 | $this->logger()->debug("Users: {$nbUsers} - Memory: {$memory}MB"); |
| 58 | 58 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | private function stop(int $signal, LoopInterface $loop): void |
| 88 | 88 | { |
| 89 | 89 | $this->shutdownSignal = $signal; |
| 90 | - $loop->futureTick(function () use ($loop) { |
|
| 90 | + $loop->futureTick(function() use ($loop) { |
|
| 91 | 91 | $loop->stop(); |
| 92 | 92 | }); |
| 93 | 93 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $socket = new Socket\Server($localAddress, $loop); |
| 98 | 98 | $socket->on( |
| 99 | 99 | 'connection', |
| 100 | - function (Socket\ConnectionInterface $connection) use ($localAddress) { |
|
| 100 | + function(Socket\ConnectionInterface $connection) use ($localAddress) { |
|
| 101 | 101 | $this->metricsHandler->incrementUsers($localAddress); |
| 102 | 102 | $connection->on('close', fn() => $this->metricsHandler->decrementUsers($localAddress)); |
| 103 | 103 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | ->overrideWith($this->getInputOptions($input)) |
| 43 | 43 | ->asArray(); |
| 44 | 44 | |
| 45 | - $loop->futureTick(function () use ($config, $output) { |
|
| 45 | + $loop->futureTick(function() use ($config, $output) { |
|
| 46 | 46 | $this->displayConfiguration($config, $output); |
| 47 | 47 | }); |
| 48 | 48 | |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | $url = $url->withQuery($qs); |
| 64 | 64 | $nbSubscribers = (int) $input->getOption('subscribers'); |
| 65 | 65 | |
| 66 | - $requests = function (HttpClientInterface $client, string $url) use ($nbSubscribers) { |
|
| 66 | + $requests = function(HttpClientInterface $client, string $url) use ($nbSubscribers) { |
|
| 67 | 67 | for ($i = 0; $i < $nbSubscribers; $i++) { |
| 68 | 68 | yield $client->request('GET', $url); |
| 69 | 69 | } |