Skip to content

Commit

Permalink
Fix code styling
Browse files Browse the repository at this point in the history
  • Loading branch information
joedixon authored and github-actions[bot] committed Nov 27, 2023
1 parent 107575b commit 16c8a35
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions echo.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
use Laravel\Reverb\WebSockets\WsConnection;
use Psr\Http\Message\RequestInterface;
use React\EventLoop\Loop;
use React\Http\HttpServer;
use React\Socket\SocketServer;
use Symfony\Component\Routing\Matcher\UrlMatcher;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\RouteCollection;

require __DIR__ . '/vendor/autoload.php';
require __DIR__.'/vendor/autoload.php';

$loop = Loop::get();
$socket = new SocketServer("127.0.0.1:8080", [], $loop);
$socket = new SocketServer('127.0.0.1:8080', [], $loop);
$router = new Router(new UrlMatcher(routes(), new RequestContext));

$server = new Server($socket, $router, $loop);
Expand All @@ -28,7 +27,7 @@ function routes()
{
$routes = new RouteCollection;
$routes->add(
'sockets',
'sockets',
Route::get('/', function (RequestInterface $request, WsConnection $connection) {
$connection->onMessage(function ($message) use ($connection) {
$connection->send($message);
Expand All @@ -38,4 +37,4 @@ function routes()
);

return $routes;
}
}

0 comments on commit 16c8a35

Please sign in to comment.