-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'michaelnabil230/events' into events
- Loading branch information
Showing
13 changed files
with
191 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Laravel\Reverb\Events\Concerns; | ||
|
||
use Laravel\Reverb\Loggers\Log; | ||
|
||
trait Dispatchable | ||
{ | ||
/** | ||
* Dispatch the event with the given arguments. | ||
* | ||
* @return mixed | ||
*/ | ||
public static function dispatch() | ||
{ | ||
try { | ||
return event(new static(...func_get_args())); | ||
} catch (\Exception $exception) { | ||
Log::error($exception->getMessage()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Laravel\Reverb\Events; | ||
|
||
use Laravel\Reverb\Contracts\Connection; | ||
use Laravel\Reverb\Events\Concerns\Dispatchable; | ||
|
||
class ConnectionClosed | ||
{ | ||
use Dispatchable; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct(public Connection $connection) | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Laravel\Reverb\Events; | ||
|
||
use Laravel\Reverb\Contracts\Connection; | ||
use Laravel\Reverb\Events\Concerns\Dispatchable; | ||
|
||
class ConnectionError | ||
{ | ||
use Dispatchable; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct(public Connection $connection, public \Exception $exception) | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Laravel\Reverb\Events; | ||
|
||
use Laravel\Reverb\Contracts\Connection; | ||
use Laravel\Reverb\Events\Concerns\Dispatchable; | ||
|
||
class NewConnection | ||
{ | ||
use Dispatchable; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct(public Connection $connection) | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Laravel\Reverb\Events; | ||
|
||
use Laravel\Reverb\Events\Concerns\Dispatchable; | ||
|
||
class ServerStarted | ||
{ | ||
use Dispatchable; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct() | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Laravel\Reverb\Events; | ||
|
||
use Laravel\Reverb\Events\Concerns\Dispatchable; | ||
|
||
class ServerStopped | ||
{ | ||
use Dispatchable; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct() | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Laravel\Reverb\Events; | ||
|
||
use Laravel\Reverb\Contracts\Connection; | ||
use Laravel\Reverb\Events\Concerns\Dispatchable; | ||
|
||
class SubscribedToChannel | ||
{ | ||
use Dispatchable; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Connection $connection, | ||
public string $channelName, | ||
public ?string $auth = null, | ||
) { | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Laravel\Reverb\Events; | ||
|
||
use Laravel\Reverb\Contracts\Connection; | ||
use Laravel\Reverb\Events\Concerns\Dispatchable; | ||
|
||
class UnsubscribedFromChannel | ||
{ | ||
use Dispatchable; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Connection $connection, | ||
public string $channelName, | ||
) { | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters