@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | public function handleClient(Gateway $gateway, Client $client, Request $request, Response $response): Promise |
| 51 | 51 | { |
| 52 | - return call(function () use ($gateway, $client, $request, $response) { |
|
| 53 | - $client->onClose(function (Client $client, int $code, string $reason) use ($gateway) { |
|
| 52 | + return call(function() use ($gateway, $client, $request, $response) { |
|
| 53 | + $client->onClose(function(Client $client, int $code, string $reason) use ($gateway) { |
|
| 54 | 54 | yield $this->processDisconnectingClient($gateway, $client, $code, $reason); |
| 55 | 55 | }); |
| 56 | 56 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | private function processDisconnectingClient(Gateway $gateway, Client $client, int $code, string $reason): Promise |
| 72 | 72 | { |
| 73 | - return call(function () use ($gateway, $client, $code, $reason) { |
|
| 73 | + return call(function() use ($gateway, $client, $code, $reason) { |
|
| 74 | 74 | $this->logger->info( |
| 75 | 75 | \sprintf( |
| 76 | 76 | 'Client %d disconnected. Code: %d Reason: %s. Total clients: %d', |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $this->gateway = $gateway; |
| 107 | 107 | |
| 108 | - asyncCall(function () { |
|
| 108 | + asyncCall(function() { |
|
| 109 | 109 | while (true) { |
| 110 | 110 | $this->emit(yield $this->provider->listen()); |
| 111 | 111 | |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function appendResponse(string $eventNamespace, Response $response): Promise |
| 31 | 31 | { |
| 32 | - return call(function () use ($eventNamespace, $response) { |
|
| 32 | + return call(function() use ($eventNamespace, $response) { |
|
| 33 | 33 | try { |
| 34 | 34 | $bufferedResponse = yield $response->getBody()->buffer(); |
| 35 | 35 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | private function request(): Promise |
| 42 | 42 | { |
| 43 | - return call(function () { |
|
| 43 | + return call(function() { |
|
| 44 | 44 | try { |
| 45 | 45 | $request = new Request(self::API_ENDPOINT, 'GET'); |
| 46 | 46 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | public function listen(): Promise |
| 74 | 74 | { |
| 75 | - return call(function () { |
|
| 75 | + return call(function() { |
|
| 76 | 76 | $response = yield $this->request(); |
| 77 | 77 | |
| 78 | 78 | return yield $this->resultFactory->build(self::EVENT_NAMESPACE, $response); |
@@ -12,12 +12,12 @@ |
||
| 12 | 12 | |
| 13 | 13 | $logger = (new LoggerFactory())->build($configuration->getLogLevel()); |
| 14 | 14 | |
| 15 | -Loop::setErrorHandler(function (\Throwable $e) use ($logger): void { |
|
| 15 | +Loop::setErrorHandler(function(\Throwable $e) use ($logger): void { |
|
| 16 | 16 | $logger->emergency('GitAmp blew up', ['exception' => $e]); |
| 17 | 17 | }); |
| 18 | 18 | |
| 19 | 19 | $server = new Server($logger, $configuration); |
| 20 | 20 | |
| 21 | -Loop::run(function () use ($server) { |
|
| 21 | +Loop::run(function() use ($server) { |
|
| 22 | 22 | yield $server->start(); |
| 23 | 23 | }); |
@@ -42,12 +42,12 @@ |
||
| 42 | 42 | private function getSockets(): array |
| 43 | 43 | { |
| 44 | 44 | $sockets = array_map( |
| 45 | - fn (ServerAddress $address) => SocketServer::listen($address->getUri()), |
|
| 45 | + fn(ServerAddress $address) => SocketServer::listen($address->getUri()), |
|
| 46 | 46 | $this->configuration->getServerAddresses(), |
| 47 | 47 | ); |
| 48 | 48 | |
| 49 | 49 | $sockets = array_merge($sockets, array_map( |
| 50 | - fn (SslServerAddress $address) => SocketServer::listen( |
|
| 50 | + fn(SslServerAddress $address) => SocketServer::listen( |
|
| 51 | 51 | $address->getUri(), |
| 52 | 52 | (new BindContext()) |
| 53 | 53 | ->withTlsContext((new ServerTlsContext())->withDefaultCertificate($address->getCertificate())), |