Use arrow function for app handler callbacks.
This commit is contained in:
parent
5cd04d5f02
commit
84a2f2361c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user