| @@ -38,10 +38,10 @@ discard block | ||
| 38 | 38 | $promises = [ | 
| 39 | 39 | 'async' => $factory->createClient($dsn) | 
| 40 | 40 | ->then( | 
| 41 | -                    function (AsynchronousClient $client) { | |
| 41 | +                    function(AsynchronousClient $client) { | |
| 42 | 42 | $client->on( | 
| 43 | 43 | 'close', | 
| 44 | -                            function () { | |
| 44 | +                            function() { | |
| 45 | 45 |                                  $this->logger()->error('Connection closed.'); | 
| 46 | 46 | $this->loop->stop(); | 
| 47 | 47 | } | 
| @@ -49,7 +49,7 @@ discard block | ||
| 49 | 49 | |
| 50 | 50 | return $client; | 
| 51 | 51 | }, | 
| 52 | -                    function (\Exception $exception) { | |
| 52 | +                    function(\Exception $exception) { | |
| 53 | 53 | $this->loop->stop(); | 
| 54 | 54 | $this->logger()->error($exception->getMessage()); | 
| 55 | 55 | } | 
| @@ -59,7 +59,7 @@ discard block | ||
| 59 | 59 | |
| 60 | 60 | return all($promises) | 
| 61 | 61 | ->then( | 
| 62 | -                function (iterable $results): array { | |
| 62 | +                function(iterable $results): array { | |
| 63 | 63 | $clients = []; | 
| 64 | 64 |                      foreach ($results as $key => $client) { | 
| 65 | 65 | $clients[$key] = $client; | 
| @@ -72,7 +72,7 @@ discard block | ||
| 72 | 72 | } | 
| 73 | 73 | ) | 
| 74 | 74 | ->then( | 
| 75 | - fn (array $clients): RedisStorage => new RedisStorage( | |
| 75 | + fn(array $clients): RedisStorage => new RedisStorage( | |
| 76 | 76 | $clients['async'], | 
| 77 | 77 | $clients['sync'], | 
| 78 | 78 | ) | 
| @@ -47,13 +47,13 @@ discard block | ||
| 47 | 47 | $localAddress = $this->config[Configuration::ADDR]; | 
| 48 | 48 | $this->shutdownSignal = null; | 
| 49 | 49 | $this->metricsHandler->resetUsers($localAddress); | 
| 50 | -        $loop->addSignal(SIGINT, function ($signal) use ($loop) { | |
| 50 | +        $loop->addSignal(SIGINT, function($signal) use ($loop) { | |
| 51 | 51 | $this->stop($signal, $loop); | 
| 52 | 52 | }); | 
| 53 | 53 | $loop->addPeriodicTimer( | 
| 54 | 54 | 15, | 
| 55 | 55 | fn() => $this->metricsHandler->getNbUsers()->then( | 
| 56 | -                function (int $nbUsers) { | |
| 56 | +                function(int $nbUsers) { | |
| 57 | 57 | $memory = \memory_get_usage(true) / 1024 / 1024; | 
| 58 | 58 |                      $this->logger()->debug("Users: {$nbUsers} - Memory: {$memory}MB"); | 
| 59 | 59 | } | 
| @@ -80,7 +80,7 @@ discard block | ||
| 80 | 80 | private function createSocketConnection(string $localAddress, LoopInterface $loop): Socket\Server | 
| 81 | 81 |      { | 
| 82 | 82 | $socket = new Socket\Server($localAddress, $loop); | 
| 83 | -        $socket->on('connection', function (ConnectionInterface $connection) use ($localAddress) { | |
| 83 | +        $socket->on('connection', function(ConnectionInterface $connection) use ($localAddress) { | |
| 84 | 84 | $this->metricsHandler->incrementUsers($localAddress); | 
| 85 | 85 |              $connection->on('close', fn() => $this->metricsHandler->decrementUsers($localAddress)); | 
| 86 | 86 | }); | 
| @@ -105,7 +105,7 @@ discard block | ||
| 105 | 105 | private function stop(int $signal, LoopInterface $loop): void | 
| 106 | 106 |      { | 
| 107 | 107 | $this->shutdownSignal = $signal; | 
| 108 | -        $loop->futureTick(function () use ($loop) { | |
| 108 | +        $loop->futureTick(function() use ($loop) { | |
| 109 | 109 | $loop->stop(); | 
| 110 | 110 | }); | 
| 111 | 111 | } | 
| @@ -36,10 +36,10 @@ discard block | ||
| 36 | 36 | $promises = [ | 
| 37 | 37 | 'subscriber' => $factory->createClient($dsn) | 
| 38 | 38 | ->then( | 
| 39 | -                    function (AsynchronousClient $client) { | |
| 39 | +                    function(AsynchronousClient $client) { | |
| 40 | 40 | $client->on( | 
| 41 | 41 | 'close', | 
| 42 | -                            function () { | |
| 42 | +                            function() { | |
| 43 | 43 |                                  $this->logger()->error('Connection closed.'); | 
| 44 | 44 | $this->loop->stop(); | 
| 45 | 45 | } | 
| @@ -47,17 +47,17 @@ discard block | ||
| 47 | 47 | |
| 48 | 48 | return $client; | 
| 49 | 49 | }, | 
| 50 | -                    function (\Exception $exception) { | |
| 50 | +                    function(\Exception $exception) { | |
| 51 | 51 | $this->loop->stop(); | 
| 52 | 52 | $this->logger->error($exception->getMessage()); | 
| 53 | 53 | } | 
| 54 | 54 | ), | 
| 55 | 55 | 'publisher' => $factory->createClient($dsn) | 
| 56 | 56 | ->then( | 
| 57 | -                    function (AsynchronousClient $client) { | |
| 57 | +                    function(AsynchronousClient $client) { | |
| 58 | 58 | $client->on( | 
| 59 | 59 | 'close', | 
| 60 | -                            function () { | |
| 60 | +                            function() { | |
| 61 | 61 |                                  $this->logger()->error('Connection closed.'); | 
| 62 | 62 | $this->loop->stop(); | 
| 63 | 63 | } | 
| @@ -65,7 +65,7 @@ discard block | ||
| 65 | 65 | |
| 66 | 66 | return $client; | 
| 67 | 67 | }, | 
| 68 | -                    function (\Exception $exception) { | |
| 68 | +                    function(\Exception $exception) { | |
| 69 | 69 | $this->loop->stop(); | 
| 70 | 70 | $this->logger()->error($exception->getMessage()); | 
| 71 | 71 | } | 
| @@ -74,7 +74,7 @@ discard block | ||
| 74 | 74 | |
| 75 | 75 | return all($promises) | 
| 76 | 76 | ->then( | 
| 77 | -                function (iterable $results): array { | |
| 77 | +                function(iterable $results): array { | |
| 78 | 78 | $clients = []; | 
| 79 | 79 |                      foreach ($results as $key => $client) { | 
| 80 | 80 | $clients[$key] = $client; | 
| @@ -87,7 +87,7 @@ discard block | ||
| 87 | 87 | } | 
| 88 | 88 | ) | 
| 89 | 89 | ->then( | 
| 90 | - fn (array $clients) => new RedisTransport($clients['subscriber'], $clients['publisher']) | |
| 90 | + fn(array $clients) => new RedisTransport($clients['subscriber'], $clients['publisher']) | |
| 91 | 91 | ); | 
| 92 | 92 | } | 
| 93 | 93 | } | 
| @@ -33,6 +33,6 @@ | ||
| 33 | 33 | $factory = new Factory($this->loop); | 
| 34 | 34 | |
| 35 | 35 | return $factory->createClient($dsn) | 
| 36 | - ->then(fn (AsynchronousClient $client) => new RedisMetricsHandler($client)); | |
| 36 | + ->then(fn(AsynchronousClient $client) => new RedisMetricsHandler($client)); | |
| 37 | 37 | } | 
| 38 | 38 | } |