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();
|
$app = Bootstrap::init();
|
||||||
|
|
||||||
$http = new HttpServer(function (Request $request) use ($app) {
|
$http = new HttpServer(fn (Request $request) => $app->handle($request));
|
||||||
return $app->handle($request);
|
|
||||||
});
|
|
||||||
|
|
||||||
$address = "127.0.0.1:8000";
|
$address = "127.0.0.1:8000";
|
||||||
$socket = new SocketServer($address);
|
$socket = new SocketServer($address);
|
||||||
$http->listen($socket);
|
$http->listen($socket);
|
||||||
|
Loading…
Reference in New Issue
Block a user