Use arrow function for app handler callbacks.

This commit is contained in:
Dave Smith-Hayes 2024-06-20 21:55:37 -04:00
parent 5cd04d5f02
commit 84a2f2361c

View File

@ -9,10 +9,7 @@ use Psr\Http\Message\ServerRequestInterface as Request;
$app = Bootstrap::init();
$http = new HttpServer(function (Request $request) use ($app) {
return $app->handle($request);
});
$http = new HttpServer(fn (Request $request) => $app->handle($request));
$address = "127.0.0.1:8000";
$socket = new SocketServer($address);
$http->listen($socket);