Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
joedixon committed Dec 7, 2023
1 parent 89fba45 commit 00a8b45
Show file tree
Hide file tree
Showing 26 changed files with 88 additions and 21 deletions.
3 changes: 3 additions & 0 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

class Application
{
/**
* Create a new application instance.
*/
public function __construct(
protected string $id,
protected string $key,
Expand Down
3 changes: 3 additions & 0 deletions src/Channels/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class Channel
*/
protected $connections;

/**
* Create a new channel instance.
*/
public function __construct(protected string $name)
{
$this->connections = app(ChannelConnectionManager::class)->for($this->name);
Expand Down
4 changes: 4 additions & 0 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@

class ConfigProvider implements ApplicationProvider
{
/**
* Create a new config provider instance.
*/
public function __construct(protected Collection $applications)
{
//
}

/**
Expand Down
9 changes: 5 additions & 4 deletions src/Contracts/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ abstract class Connection
*/
protected $hasBeenPinged = false;

public function __construct(
protected Application $application,
protected ?string $origin
) {
/**
* Create a new connection instance.
*/
public function __construct(protected Application $application, protected ?string $origin)
{
$this->lastSeenAt = time();
}

Expand Down
3 changes: 3 additions & 0 deletions src/Http/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class Connection
*/
protected string $buffer = '';

/**
* Create a new connection instance.
*/
public function __construct(protected ConnectionInterface $connection)
{
$this->id = (int) $connection->stream;
Expand Down
3 changes: 3 additions & 0 deletions src/Http/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ class Route
{
use RouteTrait;

/**
* Create a new route instance.
*/
public function __construct(string $path)
{
$this->route = new BaseRoute($path);
Expand Down
3 changes: 3 additions & 0 deletions src/Http/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class Router
*/
protected ServerNegotiator $negotiator;

/**
* Create a new router instance.
*/
public function __construct(protected UrlMatcherInterface $matcher)
{
$this->negotiator = new ServerNegotiator(new RequestVerifier);
Expand Down
3 changes: 3 additions & 0 deletions src/Http/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class Server
{
use ClosesConnections;

/**
* Create a new Http server instance.
*/
public function __construct(protected ServerInterface $socket, protected Router $router, protected ?LoopInterface $loop = null)
{
gc_disable();
Expand Down
3 changes: 3 additions & 0 deletions src/Loggers/CliLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class CliLogger implements Logger
*/
protected $components;

/**
* Create a new CLI logger instance.
*/
public function __construct(protected OutputStyle $output)
{
$this->components = new Factory($output);
Expand Down
5 changes: 4 additions & 1 deletion src/Managers/CacheChannelConnectionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ class CacheChannelConnectionManager implements ChannelConnectionManager
{
protected string $name;

/**
* Create a new cache channel connection manager instance.
*/
public function __construct(
protected Repository $repository,
protected ConnectionManager $connections,
protected $prefix = 'reverb'
protected string $prefix = 'reverb'
) {
//
}
Expand Down
9 changes: 5 additions & 4 deletions src/Managers/CacheChannelManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ class CacheChannelManager implements ChannelManagerInterface
*/
protected $application;

public function __construct(
protected Repository $repository,
protected $prefix = 'reverb'
) {
/**
* Create a new cache channel manager instance.
*/
public function __construct(protected Repository $repository, protected string $prefix = 'reverb')
{
//
}

Expand Down
9 changes: 5 additions & 4 deletions src/Managers/CacheConnectionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

class CacheConnectionManager implements ConnectionManager
{
public function __construct(
protected Repository $repository,
protected $prefix = 'reverb'
) {
/**
* Create a new cache connection manager instance.
*/
public function __construct(protected Repository $repository, protected string $prefix = 'reverb')
{
//
}

Expand Down
3 changes: 3 additions & 0 deletions src/Pusher/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

class Event
{
/**
* Create a new Pusher event instance.
*/
public function __construct(protected ChannelManager $channels)
{
//
Expand Down
3 changes: 3 additions & 0 deletions src/Pusher/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

class Server
{
/**
* Create a new server instance.
*/
public function __construct(protected ChannelManager $channels, protected PusherEvent $pusher)
{
//
Expand Down
3 changes: 3 additions & 0 deletions src/ServerManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

class ServerManager extends Manager
{
/**
* Create a new server manager instance.
*/
public function __construct(protected Application $app)
{
parent::__construct($app);
Expand Down
5 changes: 4 additions & 1 deletion src/Servers/ApiGateway/ApiGatewayProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@

class ApiGatewayProvider extends ServerProvider
{
/**
* Create a new API Gateway server provider instance.
*/
public function __construct(protected Application $app, protected array $config)
{
//
//
}

/**
Expand Down
5 changes: 4 additions & 1 deletion src/Servers/ApiGateway/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace Laravel\Reverb\Servers\ApiGateway;

use Laravel\Reverb\Application;
use Laravel\Reverb\Pusher\Concerns\GeneratesPusherIdentifiers;
use Laravel\Reverb\Concerns\SerializesConnections;
use Laravel\Reverb\Contracts\Connection as BaseConnection;
use Laravel\Reverb\Contracts\ConnectionManager;
use Laravel\Reverb\Contracts\SerializableConnection;
use Laravel\Reverb\Pusher\Concerns\GeneratesPusherIdentifiers;
use Laravel\Reverb\Servers\ApiGateway\Jobs\SendToConnection;

class Connection extends BaseConnection implements SerializableConnection
Expand All @@ -21,6 +21,9 @@ class Connection extends BaseConnection implements SerializableConnection
*/
protected $id;

/**
* Create a new connection instance.
*/
public function __construct(
protected string $identifier,
protected Application $application,
Expand Down
1 change: 1 addition & 0 deletions src/Servers/ApiGateway/Jobs/SendToConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class SendToConnection implements ShouldQueue
*/
public function __construct(public string $connectionId, public string $message)
{
//
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/Servers/ApiGateway/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function __construct(
public string $connectionId,
public string $event
) {
//
}

/**
Expand Down
9 changes: 5 additions & 4 deletions src/Servers/ApiGateway/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ class Server
{
protected ConnectionManager $connections;

public function __construct(
protected PusherServer $server,
protected ApplicationProvider $applications,
) {
/**
* Create an new server instance.
*/
public function __construct(protected PusherServer $server, protected ApplicationProvider $applications)
{
$this->connections = app(ConnectionManager::class);
}

Expand Down
5 changes: 4 additions & 1 deletion src/Servers/Reverb/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Laravel\Reverb\Servers\Reverb;

use Laravel\Reverb\Application;
use Laravel\Reverb\Pusher\Concerns\GeneratesPusherIdentifiers;
use Laravel\Reverb\Contracts\Connection as ConnectionContract;
use Laravel\Reverb\Pusher\Concerns\GeneratesPusherIdentifiers;
use Laravel\Reverb\WebSockets\WsConnection;

class Connection extends ConnectionContract
Expand All @@ -21,6 +21,9 @@ class Connection extends ConnectionContract
*/
protected $hasBeenPinged = false;

/**
* Create a new connection instance.
*/
public function __construct(protected WsConnection $connection, Application $application, ?string $origin = null)
{
parent::__construct($application, $origin);
Expand Down
3 changes: 3 additions & 0 deletions src/Servers/Reverb/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

class Controller
{
/**
* Create a new controller instance.
*/
public function __construct(protected PusherServer $server, protected ApplicationProvider $applications)
{
//
Expand Down
3 changes: 3 additions & 0 deletions src/Servers/Reverb/ReverbProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class ReverbProvider extends ServerProvider
*/
protected $publishesEvents;

/**
* Create a new Reverb server provider instance.
*/
public function __construct(protected Application $app, protected array $config)
{
$this->publishesEvents = (bool) $this->config['publish_events']['enabled'] ?? false;
Expand Down
3 changes: 3 additions & 0 deletions src/WebSockets/WsConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class WsConnection extends EventEmitter
*/
protected $maxMessageSize;

/**
* Create a new websocket connection instance.
*/
public function __construct(public Connection $connection)
{
//
Expand Down
5 changes: 4 additions & 1 deletion tests/FakeConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use Illuminate\Testing\Assert;
use Laravel\Reverb\Application;
use Laravel\Reverb\Pusher\Concerns\GeneratesPusherIdentifiers;
use Laravel\Reverb\Contracts\ApplicationProvider;
use Laravel\Reverb\Contracts\Connection as BaseConnection;
use Laravel\Reverb\Pusher\Concerns\GeneratesPusherIdentifiers;

class FakeConnection extends BaseConnection
{
Expand All @@ -31,6 +31,9 @@ class FakeConnection extends BaseConnection
*/
public $id;

/**
* Create a new fake connection instance.
*/
public function __construct(?string $identifier = null)
{
if ($identifier) {
Expand Down
3 changes: 3 additions & 0 deletions tests/TestConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class TestConnection
*/
public $receivedMessages = [];

/**
* Create a new test connection instance.
*/
public function __construct(public WebSocket $connection)
{
$connection->on('message', function ($message) {
Expand Down

0 comments on commit 00a8b45

Please sign in to comment.