Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
Apply fixes from StyleCI (#1190)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpociot authored Feb 7, 2024
1 parent 257a129 commit 2e4b2f3
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/Apps/ConfigAppManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use BeyondCode\LaravelWebSockets\Contracts\AppManager;
use React\Promise\PromiseInterface;

use function React\Promise\resolve as resolvePromise;

class ConfigAppManager implements AppManager
Expand Down
3 changes: 2 additions & 1 deletion src/ChannelManagers/LocalChannelManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/**
Expand Down
3 changes: 2 additions & 1 deletion src/ChannelManagers/RedisChannelManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/**
Expand Down
3 changes: 2 additions & 1 deletion src/Console/Commands/StartServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/AppManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function findBySecret($appSecret): PromiseInterface;
/**
* Create a new app.
*
* @param $appData
* @param $appData
* @return PromiseInterface
*/
public function createApp($appData): PromiseInterface;
Expand Down
5 changes: 3 additions & 2 deletions src/Dashboard/Http/Controllers/AuthenticateDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,7 +29,7 @@ public function __invoke(Request $request)
$broadcaster = $this->getPusherBroadcaster([
'key' => $app->key,
'secret' => $app->secret,
'id' =>$app->id,
'id' => $app->id,
]);

/*
Expand Down
3 changes: 2 additions & 1 deletion src/Dashboard/Http/Controllers/ShowApps.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/**
Expand Down
3 changes: 2 additions & 1 deletion src/Dashboard/Http/Controllers/ShowDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/**
Expand Down
3 changes: 2 additions & 1 deletion src/Dashboard/Http/Controllers/StoreApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/**
Expand Down
3 changes: 2 additions & 1 deletion src/Rules/AppId.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/**
Expand Down
6 changes: 3 additions & 3 deletions tests/Mocks/LazyClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
});
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 2e4b2f3

Please sign in to comment.