From e105e29f9dd14c54beb9e5ce7af062db628b3a89 Mon Sep 17 00:00:00 2001 From: freek Date: Sat, 1 Dec 2018 13:58:25 +0100 Subject: [PATCH] renaming clients to apps --- src/Apps/App.php | 8 ++++---- src/Exceptions/{InvalidClient.php => InvalidApp.php} | 2 +- tests/ClientProviders/ClientTest.php | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) rename src/Exceptions/{InvalidClient.php => InvalidApp.php} (93%) diff --git a/src/Apps/App.php b/src/Apps/App.php index 75162ce..7cbcaeb 100644 --- a/src/Apps/App.php +++ b/src/Apps/App.php @@ -2,7 +2,7 @@ namespace BeyondCode\LaravelWebSockets\Apps; -use BeyondCode\LaravelWebSockets\Exceptions\InvalidClient; +use BeyondCode\LaravelWebSockets\Exceptions\InvalidApp; class App { @@ -31,15 +31,15 @@ class App public function __construct($appId, string $appKey, string $appSecret, ?string $name) { if (!is_numeric($appId)) { - throw InvalidClient::appIdIsNotNumeric($appId); + throw InvalidApp::appIdIsNotNumeric($appId); } if ($appKey === '') { - throw InvalidClient::valueIsRequired('appKey', $appId); + throw InvalidApp::valueIsRequired('appKey', $appId); } if ($appSecret === '') { - throw InvalidClient::valueIsRequired('appSecret', $appId); + throw InvalidApp::valueIsRequired('appSecret', $appId); } $this->appId = $appId; diff --git a/src/Exceptions/InvalidClient.php b/src/Exceptions/InvalidApp.php similarity index 93% rename from src/Exceptions/InvalidClient.php rename to src/Exceptions/InvalidApp.php index d76c8ef..ed65716 100644 --- a/src/Exceptions/InvalidClient.php +++ b/src/Exceptions/InvalidApp.php @@ -4,7 +4,7 @@ namespace BeyondCode\LaravelWebSockets\Exceptions; use Exception; -class InvalidClient extends Exception +class InvalidApp extends Exception { public static function notFound(int $appId) { diff --git a/tests/ClientProviders/ClientTest.php b/tests/ClientProviders/ClientTest.php index f00ffc9..44a0220 100644 --- a/tests/ClientProviders/ClientTest.php +++ b/tests/ClientProviders/ClientTest.php @@ -3,7 +3,7 @@ namespace BeyondCode\LaravelWebSockets\Tests\ClientProviders; use BeyondCode\LaravelWebSockets\Apps\App; -use BeyondCode\LaravelWebSockets\Exceptions\InvalidClient; +use BeyondCode\LaravelWebSockets\Exceptions\InvalidApp; use BeyondCode\LaravelWebSockets\Tests\TestCase; class ClientTest extends TestCase @@ -19,7 +19,7 @@ class ClientTest extends TestCase /** @test */ public function it_will_not_accept_an_empty_appKey() { - $this->expectException(InvalidClient::class); + $this->expectException(InvalidApp::class); new App(1, '', 'appSecret', 'new'); } @@ -27,7 +27,7 @@ class ClientTest extends TestCase /** @test */ public function it_will_not_accept_an_empty_appSecret() { - $this->expectException(InvalidClient::class); + $this->expectException(InvalidApp::class); new App(1, 'appKey', '', 'new'); } @@ -35,7 +35,7 @@ class ClientTest extends TestCase /** @test */ public function it_will_not_accept_an_non_numeric_appId() { - $this->expectException(InvalidClient::class); + $this->expectException(InvalidApp::class); new App('appId', 'appKey', '', 'new'); }