diff --git a/src/Apps/ConfigAppManager.php b/src/Apps/ConfigAppManager.php index 0b1b52f3c0..903cf45753 100644 --- a/src/Apps/ConfigAppManager.php +++ b/src/Apps/ConfigAppManager.php @@ -4,6 +4,7 @@ use BeyondCode\LaravelWebSockets\Contracts\AppManager; use React\Promise\PromiseInterface; + use function React\Promise\resolve as resolvePromise; class ConfigAppManager implements AppManager diff --git a/src/ChannelManagers/LocalChannelManager.php b/src/ChannelManagers/LocalChannelManager.php index a95376306a..7f8d3e66f0 100644 --- a/src/ChannelManagers/LocalChannelManager.php +++ b/src/ChannelManagers/LocalChannelManager.php @@ -13,10 +13,11 @@ use Illuminate\Support\Str; use Ratchet\ConnectionInterface; use React\EventLoop\LoopInterface; -use function React\Promise\all; use React\Promise\PromiseInterface; use stdClass; +use function React\Promise\all; + class LocalChannelManager implements ChannelManager { /** diff --git a/src/ChannelManagers/RedisChannelManager.php b/src/ChannelManagers/RedisChannelManager.php index 04755f81c0..c407f192f7 100644 --- a/src/ChannelManagers/RedisChannelManager.php +++ b/src/ChannelManagers/RedisChannelManager.php @@ -14,10 +14,11 @@ use Illuminate\Support\Str; use Ratchet\ConnectionInterface; use React\EventLoop\LoopInterface; -use function React\Promise\all; use React\Promise\PromiseInterface; use stdClass; +use function React\Promise\all; + class RedisChannelManager extends LocalChannelManager { /** diff --git a/src/Console/Commands/StartServer.php b/src/Console/Commands/StartServer.php index af2de1925c..41a236b412 100644 --- a/src/Console/Commands/StartServer.php +++ b/src/Console/Commands/StartServer.php @@ -13,9 +13,10 @@ use Illuminate\Support\Facades\Cache; use React\EventLoop\Factory as LoopFactory; use React\EventLoop\LoopInterface; -use function React\Promise\all; use Symfony\Component\Console\Output\OutputInterface; +use function React\Promise\all; + class StartServer extends Command { /** diff --git a/src/Contracts/AppManager.php b/src/Contracts/AppManager.php index f16b691799..da5d4b9660 100644 --- a/src/Contracts/AppManager.php +++ b/src/Contracts/AppManager.php @@ -41,7 +41,7 @@ public function findBySecret($appSecret): PromiseInterface; /** * Create a new app. * - * @param $appData + * @param $appData * @return PromiseInterface */ public function createApp($appData): PromiseInterface; diff --git a/src/Dashboard/Http/Controllers/AuthenticateDashboard.php b/src/Dashboard/Http/Controllers/AuthenticateDashboard.php index f1f21fb836..d940674c93 100644 --- a/src/Dashboard/Http/Controllers/AuthenticateDashboard.php +++ b/src/Dashboard/Http/Controllers/AuthenticateDashboard.php @@ -4,11 +4,12 @@ use BeyondCode\LaravelWebSockets\Apps\App; use BeyondCode\LaravelWebSockets\Concerns\PushesToPusher; -use function Clue\React\Block\await; use Illuminate\Broadcasting\Broadcasters\PusherBroadcaster; use Illuminate\Http\Request; use React\EventLoop\LoopInterface; +use function Clue\React\Block\await; + class AuthenticateDashboard { use PushesToPusher; @@ -28,7 +29,7 @@ public function __invoke(Request $request) $broadcaster = $this->getPusherBroadcaster([ 'key' => $app->key, 'secret' => $app->secret, - 'id' =>$app->id, + 'id' => $app->id, ]); /* diff --git a/src/Dashboard/Http/Controllers/ShowApps.php b/src/Dashboard/Http/Controllers/ShowApps.php index 38724d7d40..4a7d8c0db2 100644 --- a/src/Dashboard/Http/Controllers/ShowApps.php +++ b/src/Dashboard/Http/Controllers/ShowApps.php @@ -3,10 +3,11 @@ namespace BeyondCode\LaravelWebSockets\Dashboard\Http\Controllers; use BeyondCode\LaravelWebSockets\Contracts\AppManager; -use function Clue\React\Block\await; use Illuminate\Http\Request; use React\EventLoop\LoopInterface; +use function Clue\React\Block\await; + class ShowApps { /** diff --git a/src/Dashboard/Http/Controllers/ShowDashboard.php b/src/Dashboard/Http/Controllers/ShowDashboard.php index b2921bd6d7..6fd876588e 100644 --- a/src/Dashboard/Http/Controllers/ShowDashboard.php +++ b/src/Dashboard/Http/Controllers/ShowDashboard.php @@ -4,10 +4,11 @@ use BeyondCode\LaravelWebSockets\Contracts\AppManager; use BeyondCode\LaravelWebSockets\DashboardLogger; -use function Clue\React\Block\await; use Illuminate\Http\Request; use React\EventLoop\LoopInterface; +use function Clue\React\Block\await; + class ShowDashboard { /** diff --git a/src/Dashboard/Http/Controllers/StoreApp.php b/src/Dashboard/Http/Controllers/StoreApp.php index 04717f7668..aafb1373ed 100644 --- a/src/Dashboard/Http/Controllers/StoreApp.php +++ b/src/Dashboard/Http/Controllers/StoreApp.php @@ -4,10 +4,11 @@ use BeyondCode\LaravelWebSockets\Contracts\AppManager; use BeyondCode\LaravelWebSockets\Dashboard\Http\Requests\StoreAppRequest; -use function Clue\React\Block\await; use Illuminate\Support\Str; use React\EventLoop\LoopInterface; +use function Clue\React\Block\await; + class StoreApp { /** diff --git a/src/Rules/AppId.php b/src/Rules/AppId.php index db92052735..ff4d60754e 100644 --- a/src/Rules/AppId.php +++ b/src/Rules/AppId.php @@ -3,10 +3,11 @@ namespace BeyondCode\LaravelWebSockets\Rules; use BeyondCode\LaravelWebSockets\Contracts\AppManager; -use function Clue\React\Block\await; use Illuminate\Contracts\Validation\Rule; use React\EventLoop\Factory; +use function Clue\React\Block\await; + class AppId implements Rule { /** diff --git a/tests/Mocks/LazyClient.php b/tests/Mocks/LazyClient.php index 539e7db413..b9671b09b1 100644 --- a/tests/Mocks/LazyClient.php +++ b/tests/Mocks/LazyClient.php @@ -88,7 +88,7 @@ public function on($event, callable $listener) public function assertCalled($name) { foreach ($this->getCalledFunctions() as $function) { - [$calledName, ] = $function; + [$calledName] = $function; if ($calledName === $name) { PHPUnit::assertTrue(true); @@ -112,7 +112,7 @@ public function assertCalled($name) public function assertCalledCount(int $times, string $name) { $total = collect($this->getCalledFunctions())->filter(function ($function) use ($name) { - [$calledName, ] = $function; + [$calledName] = $function; return $calledName === $name; }); @@ -176,7 +176,7 @@ public function assertCalledWithArgsCount(int $times, string $name, array $args) public function assertNotCalled(string $name) { foreach ($this->getCalledFunctions() as $function) { - [$calledName, ] = $function; + [$calledName] = $function; if ($calledName === $name) { PHPUnit::assertFalse(true); diff --git a/tests/TestCase.php b/tests/TestCase.php index 618759411e..314384d59f 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -10,7 +10,6 @@ use BeyondCode\LaravelWebSockets\Server\Loggers\HttpLogger; use BeyondCode\LaravelWebSockets\Server\Loggers\WebSocketsLogger; use BeyondCode\LaravelWebSockets\ServerFactory; -use function Clue\React\Block\await; use Clue\React\Buzz\Browser; use GuzzleHttp\Psr7\Request; use Illuminate\Support\Facades\Redis; @@ -22,6 +21,8 @@ use React\Promise\PromiseInterface; use Symfony\Component\Console\Output\BufferedOutput; +use function Clue\React\Block\await; + abstract class TestCase extends Orchestra { const AWAIT_TIMEOUT = 5.0;