This commit is contained in:
Marcel Pociot
2020-04-27 12:47:12 +02:00
parent 981adc9a24
commit af3c5d9afe
3 changed files with 32 additions and 22 deletions

View File

@@ -60,19 +60,6 @@ class RouteGenerator
protected function getRoute(string $method, string $uri, $action, string $condition = ''): Route
{
$action = is_subclass_of($action, MessageComponentInterface::class)
? $this->createWebSocketsServer($action)
: app($action);
return new Route($uri, ['_controller' => $action], [], [], null, [], [$method], $condition);
}
protected function createWebSocketsServer(string $action): WsServer
{
$wServer = new WsServer(app($action));
$wServer->enableKeepAlive(app(LoopInterface::class));
return $wServer;
return new Route($uri, ['_controller' => app($action)], [], [], null, [], [$method], $condition);
}
}