Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
joedixon committed Nov 26, 2023
1 parent fe9a7ed commit 97ff501
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions src/Http/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -64,6 +69,7 @@ public function dispatch(RequestInterface $request, Connection $connection): mix

/**
* Get the controller callable for the route.
* @param array<string, mixed> $route
*/
protected function controller(array $route): callable
{
Expand Down
6 changes: 4 additions & 2 deletions src/Http/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Laravel\Reverb\Http;

use GuzzleHttp\Psr7\Message;
use Laravel\Reverb\Concerns\ClosesConnections;
use OverflowException;
use Psr\Http\Message\RequestInterface;
Expand All @@ -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);

Expand Down

0 comments on commit 97ff501

Please sign in to comment.