diff --git a/src/Http/Request.php b/src/Http/Request.php index fd2b6077..a462e1ce 100644 --- a/src/Http/Request.php +++ b/src/Http/Request.php @@ -22,6 +22,9 @@ class Request */ const MAX_SIZE = 4096; + /** + * Turn the raw message into a Psr7 request. + */ public static function from(string $message, Connection $connection): ?RequestInterface { $connection->appendToBuffer($message); diff --git a/src/Http/Router.php b/src/Http/Router.php index 31f26210..679c7a0d 100644 --- a/src/Http/Router.php +++ b/src/Http/Router.php @@ -20,6 +20,11 @@ class Router { use ClosesConnections; + /** + * The server negotiator. + * + * @var \Ratchet\RFC6455\Handshake\ServerNegotiator + */ protected ServerNegotiator $negotiator; public function __construct(protected UrlMatcherInterface $matcher) @@ -64,6 +69,7 @@ public function dispatch(RequestInterface $request, Connection $connection): mix /** * Get the controller callable for the route. + * @param array $route */ protected function controller(array $route): callable { diff --git a/src/Http/Server.php b/src/Http/Server.php index c0c10651..6b82c905 100644 --- a/src/Http/Server.php +++ b/src/Http/Server.php @@ -2,7 +2,6 @@ namespace Laravel\Reverb\Http; -use GuzzleHttp\Psr7\Message; use Laravel\Reverb\Concerns\ClosesConnections; use OverflowException; use Psr\Http\Message\RequestInterface; @@ -22,7 +21,10 @@ public function __construct(protected ServerInterface $socket, protected Router $socket->on('connection', $this); } - public function __invoke(ConnectionInterface $connection) + /** + * Invoke the server. + */ + public function __invoke(ConnectionInterface $connection): void { $connection = new Connection($connection);