From 69acbb704aad97c1bac7e6715b6b21b5b355580e Mon Sep 17 00:00:00 2001 From: freek Date: Sat, 1 Dec 2018 13:58:00 +0100 Subject: [PATCH] renaming clients to apps --- src/Apps/ConfigAppProvider.php | 22 +++++++++++----------- tests/TestCase.php | 1 - 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Apps/ConfigAppProvider.php b/src/Apps/ConfigAppProvider.php index 58992a8..2a88829 100644 --- a/src/Apps/ConfigAppProvider.php +++ b/src/Apps/ConfigAppProvider.php @@ -7,17 +7,17 @@ use Illuminate\Support\Collection; class ConfigAppProvider implements AppProvider { /** @var Collection */ - protected $clients; + protected $apps; public function __construct() { - $this->clients = collect(config('websockets.clients')); + $this->apps = collect(config('websockets.clients')); } /** @return array[\BeyondCode\LaravelWebSockets\ClientProviders\Client] */ public function all(): array { - return $this->clients + return $this->apps ->map(function ($client) { return $this->instanciate($client); }) @@ -27,7 +27,7 @@ class ConfigAppProvider implements AppProvider public function findById(int $appId): ?App { $clientAttributes = $this - ->clients + ->apps ->firstWhere('id', $appId); return $this->instanciate($clientAttributes); @@ -36,23 +36,23 @@ class ConfigAppProvider implements AppProvider public function findByKey(string $appKey): ?App { $clientAttributes = $this - ->clients + ->apps ->firstWhere('key', $appKey); return $this->instanciate($clientAttributes); } - protected function instanciate(?array $clientAttributes): ?App + protected function instanciate(?array $appAttributes): ?App { - if (! $clientAttributes) { + if (! $appAttributes) { return null; } return new App( - $clientAttributes['id'], - $clientAttributes['key'], - $clientAttributes['secret'], - $clientAttributes['name'] ?? null + $appAttributes['id'], + $appAttributes['key'], + $appAttributes['secret'], + $appAttributes['name'] ?? null ); } } \ No newline at end of file diff --git a/tests/TestCase.php b/tests/TestCase.php index 2ea8360..5c681ff 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -12,7 +12,6 @@ use Ratchet\ConnectionInterface; abstract class TestCase extends \Orchestra\Testbench\TestCase { - /** @var \BeyondCode\LaravelWebSockets\WebSockets\WebSocketHandler */ protected $pusherServer;