@@ -70,7 +70,7 @@ |
||
70 | 70 | |
71 | 71 | public function listen(): Promise |
72 | 72 | { |
73 | - return call(function () { |
|
73 | + return call(function() { |
|
74 | 74 | $response = yield from $this->request(); |
75 | 75 | |
76 | 76 | return yield $this->resultFactory->build(self::EVENT_NAMESPACE, $response); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | public function handleClient(Gateway $gateway, Client $client, Request $request, Response $response): Promise |
51 | 51 | { |
52 | - $client->onClose(function (Client $client, int $code, string $reason) use ($gateway) { |
|
52 | + $client->onClose(function(Client $client, int $code, string $reason) use ($gateway) { |
|
53 | 53 | $this->logger->info( |
54 | 54 | \sprintf( |
55 | 55 | 'Client %d disconnected. Code: %d Reason: %s. Total clients: %d', |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $client->send($this->lastEvents->jsonEncode()); |
74 | 74 | } |
75 | 75 | |
76 | - return call(function () use ($gateway, $client): \Generator { |
|
76 | + return call(function() use ($gateway, $client): \Generator { |
|
77 | 77 | while ($message = yield $client->receive()) { |
78 | 78 | // intentionally keep receiving, otherwise the connection closes instantly for some reason |
79 | 79 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | { |
101 | 101 | $this->gateway = $gateway; |
102 | 102 | |
103 | - asyncCall(function () { |
|
103 | + asyncCall(function() { |
|
104 | 104 | while (true) { |
105 | 105 | $this->emit(yield $this->provider->listen()); |
106 | 106 |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | $injector = new Injector; |
29 | 29 | |
30 | -$injector->delegate(HttpClient::class, function () { |
|
30 | +$injector->delegate(HttpClient::class, function() { |
|
31 | 31 | return HttpClientBuilder::buildDefault(); |
32 | 32 | }); |
33 | 33 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $injector->alias(LoggerInterface::class, Logger::class); |
43 | 43 | $injector->share(Logger::class); |
44 | 44 | |
45 | -$injector->delegate(Logger::class, function () use ($configuration) { |
|
45 | +$injector->delegate(Logger::class, function() use ($configuration) { |
|
46 | 46 | $logHandler = new StreamHandler(getStdout()->getResource(), $configuration['logLevel']); |
47 | 47 | $logHandler->setFormatter(new ConsoleFormatter()); |
48 | 48 | |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | |
63 | 63 | $websocket = new Websocket($clientHandler); |
64 | 64 | |
65 | -Amp\Loop::setErrorHandler(function (Throwable $e) use ($logger) { |
|
65 | +Amp\Loop::setErrorHandler(function(Throwable $e) use ($logger) { |
|
66 | 66 | $logger->emergency('GitAmp blew up', ['exception' => $e]); |
67 | 67 | }); |
68 | 68 | |
69 | -Loop::run(function () use ($websocket, $configuration, $logger): Promise { |
|
69 | +Loop::run(function() use ($websocket, $configuration, $logger): Promise { |
|
70 | 70 | $sockets = [ |
71 | 71 | Server::listen(sprintf('%s:%d', $configuration['expose']['ip'], $configuration['expose']['port'])), |
72 | 72 | ]; |