@@ -31,11 +31,11 @@ discard block |
||
31 | 31 | $socket = new Server("0.0.0.0:{$port}", $loop); |
32 | 32 | $clients = new \SplObjectStorage(); |
33 | 33 | |
34 | - $socket->on('connection', function (ConnectionInterface $conn) use ($clients, $output) { |
|
34 | + $socket->on('connection', function(ConnectionInterface $conn) use ($clients, $output) { |
|
35 | 35 | $clients->attach($conn); |
36 | 36 | $output->writeln("Nova conexão! ({$conn->resourceId})"); |
37 | 37 | |
38 | - $conn->on('data', function ($data) use ($conn, $clients) { |
|
38 | + $conn->on('data', function($data) use ($conn, $clients) { |
|
39 | 39 | foreach ($clients as $client) { |
40 | 40 | if ($client !== $conn) { |
41 | 41 | $client->write($data); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | } |
44 | 44 | }); |
45 | 45 | |
46 | - $conn->on('close', function () use ($conn, $clients, $output) { |
|
46 | + $conn->on('close', function() use ($conn, $clients, $output) { |
|
47 | 47 | $clients->detach($conn); |
48 | 48 | $output->writeln("Conexão fechada! ({$conn->resourceId})"); |
49 | 49 | }); |