@@ -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 | } |
@@ -69,7 +69,7 @@ |
||
69 | 69 | 'event' => $this->event, |
70 | 70 | 'retry' => $this->retry, |
71 | 71 | ], |
72 | - fn ($value) => null !== $value |
|
72 | + fn($value) => null !== $value |
|
73 | 73 | ); |
74 | 74 | } |
75 | 75 |