From bab5e2b69fd418198a083b15d9761cdc12706b7a Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 3 Jan 2024 15:51:19 +0000 Subject: [PATCH] Apply fixes from StyleCI --- database/factories/FactoryHelper.php | 2 +- database/factories/FriendFactory.php | 4 +- database/factories/InviteFactory.php | 2 +- database/factories/PendingFriendFactory.php | 4 +- database/factories/SentFriendFactory.php | 4 +- src/Actions/BaseMessengerAction.php | 4 +- src/Actions/Friends/StoreFriendRequest.php | 1 + src/Actions/Messages/EditMessage.php | 8 ++-- src/Actions/Messages/NewMessageAction.php | 8 ++-- .../Messenger/UpdateMessengerSettings.php | 6 +-- src/Actions/Threads/StoreGroupThread.php | 1 + src/Broadcasting/Channels/CallChannel.php | 2 +- src/Broadcasting/Channels/ProviderChannel.php | 2 +- src/Broadcasting/Channels/ThreadChannel.php | 2 +- src/Brokers/FriendBroker.php | 6 +-- src/Contracts/Ownerable.php | 1 + src/Exceptions/Handler.php | 4 +- .../Collections/AudioMessageCollection.php | 2 +- src/Http/Collections/CallCollection.php | 2 +- .../Collections/DocumentMessageCollection.php | 2 +- .../Collections/GroupThreadCollection.php | 2 +- .../Collections/ImageMessageCollection.php | 2 +- src/Http/Collections/InviteCollection.php | 2 +- src/Http/Collections/MessageCollection.php | 2 +- src/Http/Collections/MessengerCollection.php | 22 ++++----- .../Collections/ParticipantCollection.php | 2 +- .../Collections/PrivateThreadCollection.php | 2 +- src/Http/Collections/SearchCollection.php | 2 +- .../Collections/SystemMessageCollection.php | 2 +- src/Http/Collections/ThreadCollection.php | 2 +- .../Collections/VideoMessageCollection.php | 2 +- src/Messenger.php | 2 +- src/MessengerBots.php | 4 +- src/MessengerServiceProvider.php | 2 +- src/Policies/BotActionPolicy.php | 10 ++-- src/Policies/BotPolicy.php | 10 ++-- src/Policies/CallParticipantPolicy.php | 6 +-- src/Policies/CallPolicy.php | 18 +++---- src/Policies/FriendPolicy.php | 6 +-- src/Policies/InvitePolicy.php | 8 ++-- src/Policies/MessagePolicy.php | 22 ++++----- src/Policies/MessageReactionPolicy.php | 6 +-- src/Policies/ParticipantPolicy.php | 14 +++--- src/Policies/PendingFriendPolicy.php | 8 ++-- src/Policies/SentFriendPolicy.php | 8 ++-- src/Policies/ThreadPolicy.php | 24 +++++----- src/Services/ImageRenderService.php | 6 +-- src/Services/SearchProvidersService.php | 2 +- src/Support/MessageTransformer.php | 2 +- src/Traits/HasOwner.php | 1 + tests/Actions/StoreSystemMessageTest.php | 3 +- tests/Brokers/BroadcastBrokerTest.php | 3 +- tests/Commands/PurgeThreadsCommandTest.php | 6 +-- tests/Http/AddParticipantsTest.php | 5 +- tests/Http/AudioMessageTest.php | 6 ++- tests/Http/BotAvatarTest.php | 6 ++- tests/Http/BotsTest.php | 38 ++++++++------- tests/Http/DocumentMessageTest.php | 6 ++- tests/Http/EditMessageTest.php | 6 ++- tests/Http/FindRecipientThreadTest.php | 5 +- tests/Http/GroupThreadAvatarTest.php | 6 ++- tests/Http/GroupThreadSettingsTest.php | 6 ++- tests/Http/GroupThreadsTest.php | 8 ++-- tests/Http/ImageMessageTest.php | 6 ++- tests/Http/InstallBotPackageTest.php | 3 +- tests/Http/InvitesTest.php | 9 ++-- tests/Http/MessageReactionTest.php | 6 ++- tests/Http/MessengerAvatarTest.php | 6 ++- tests/Http/MessengerSettingsTest.php | 5 +- tests/Http/PrivateMessageTest.php | 18 ++++--- tests/Http/PrivateThreadsTest.php | 10 ++-- tests/Http/StatusHeartbeatTest.php | 3 +- .../Http/UpdateParticipantPermissionsTest.php | 3 +- tests/Http/VideoMessageTest.php | 6 ++- tests/Middleware/RateLimitersTest.php | 14 +++--- tests/Models/BotActionTest.php | 5 +- tests/Models/BotTest.php | 4 +- tests/Models/ThreadTest.php | 2 +- .../BotHandlerResolverServiceTest.php | 27 ++++++----- tests/Services/BotMatchingServiceTest.php | 48 ++++++++++++------- tests/Services/EmojiServiceTest.php | 26 ++++++---- .../Services/PushNotificationServiceTest.php | 5 +- tests/Services/SearchProvidersServiceTest.php | 10 ++-- 83 files changed, 334 insertions(+), 254 deletions(-) diff --git a/database/factories/FactoryHelper.php b/database/factories/FactoryHelper.php index 5522727b..40e6356b 100644 --- a/database/factories/FactoryHelper.php +++ b/database/factories/FactoryHelper.php @@ -9,7 +9,7 @@ trait FactoryHelper /** * Owner relation to add. * - * @param $owner + * @param $owner * @return $this */ public function owner($owner): self diff --git a/database/factories/FriendFactory.php b/database/factories/FriendFactory.php index b75244ba..93ed2d3e 100644 --- a/database/factories/FriendFactory.php +++ b/database/factories/FriendFactory.php @@ -32,8 +32,8 @@ public function definition(): array /** * Owner and party relations to add. * - * @param $owner - * @param $party + * @param $owner + * @param $party * @return $this */ public function providers($owner, $party): self diff --git a/database/factories/InviteFactory.php b/database/factories/InviteFactory.php index 27d5dd85..cd1d748c 100644 --- a/database/factories/InviteFactory.php +++ b/database/factories/InviteFactory.php @@ -40,7 +40,7 @@ public function definition(): array /** * Indicate thread is a group. * - * @param $expires + * @param $expires * @return $this */ public function expires($expires): self diff --git a/database/factories/PendingFriendFactory.php b/database/factories/PendingFriendFactory.php index 988b9f72..1b96d47d 100644 --- a/database/factories/PendingFriendFactory.php +++ b/database/factories/PendingFriendFactory.php @@ -32,8 +32,8 @@ public function definition(): array /** * Sender and recipient relations to add. * - * @param $sender - * @param $recipient + * @param $sender + * @param $recipient * @return $this */ public function providers($sender, $recipient): self diff --git a/database/factories/SentFriendFactory.php b/database/factories/SentFriendFactory.php index ce44ec39..d00bca46 100644 --- a/database/factories/SentFriendFactory.php +++ b/database/factories/SentFriendFactory.php @@ -32,8 +32,8 @@ public function definition(): array /** * Sender and recipient relations to add. * - * @param $sender - * @param $recipient + * @param $sender + * @param $recipient * @return $this */ public function providers($sender, $recipient): self diff --git a/src/Actions/BaseMessengerAction.php b/src/Actions/BaseMessengerAction.php index 46f9af6a..4272333a 100644 --- a/src/Actions/BaseMessengerAction.php +++ b/src/Actions/BaseMessengerAction.php @@ -185,7 +185,7 @@ public function getJsonResource() } /** - * @param $resource + * @param $resource * @return $this */ public function setJsonResource($resource): self @@ -229,7 +229,7 @@ public function getData(bool $withoutRelations = false) } /** - * @param $data + * @param $data * @return $this */ public function setData($data): self diff --git a/src/Actions/Friends/StoreFriendRequest.php b/src/Actions/Friends/StoreFriendRequest.php index 24f25fe3..925b4479 100644 --- a/src/Actions/Friends/StoreFriendRequest.php +++ b/src/Actions/Friends/StoreFriendRequest.php @@ -115,6 +115,7 @@ private function locateAndSetRecipientProvider(string $alias, string $id): void /** * @throws FriendException|ProviderNotFoundException + * * @noinspection PhpParamsInspection */ private function bailIfChecksFail(): void diff --git a/src/Actions/Messages/EditMessage.php b/src/Actions/Messages/EditMessage.php index 2239ea2b..86d1bb0e 100644 --- a/src/Actions/Messages/EditMessage.php +++ b/src/Actions/Messages/EditMessage.php @@ -157,10 +157,10 @@ private function handle(string $body): self private function generateResource(): void { $this->setJsonResource(new MessageResource( - $this->getMessage(), - $this->getThread(), - true - ) + $this->getMessage(), + $this->getThread(), + true + ) ); } diff --git a/src/Actions/Messages/NewMessageAction.php b/src/Actions/Messages/NewMessageAction.php index 11eef6f7..2e2365a9 100644 --- a/src/Actions/Messages/NewMessageAction.php +++ b/src/Actions/Messages/NewMessageAction.php @@ -179,10 +179,10 @@ protected function finalize(): void private function generateResource(): self { $this->setJsonResource(new MessageResource( - $this->getMessage(), - $this->getThread(), - true - ) + $this->getMessage(), + $this->getThread(), + true + ) ); return $this; diff --git a/src/Actions/Messenger/UpdateMessengerSettings.php b/src/Actions/Messenger/UpdateMessengerSettings.php index e0273b7f..3e9f4545 100644 --- a/src/Actions/Messenger/UpdateMessengerSettings.php +++ b/src/Actions/Messenger/UpdateMessengerSettings.php @@ -47,13 +47,13 @@ private function setOnlineCacheStatus(int $onlineStatus): void switch ($onlineStatus) { case 0: $this->messenger->setProviderToOffline(); - break; + break; case 1: $this->messenger->setProviderToOnline(); - break; + break; case 2: $this->messenger->setProviderToAway(); - break; + break; } } } diff --git a/src/Actions/Threads/StoreGroupThread.php b/src/Actions/Threads/StoreGroupThread.php index a9b1ad03..c0d116e4 100644 --- a/src/Actions/Threads/StoreGroupThread.php +++ b/src/Actions/Threads/StoreGroupThread.php @@ -153,6 +153,7 @@ private function creatorParticipant(): array /** * @param array $providers + * * @mixin StoreManyParticipants * * @return array diff --git a/src/Broadcasting/Channels/CallChannel.php b/src/Broadcasting/Channels/CallChannel.php index e931620c..06d0e553 100644 --- a/src/Broadcasting/Channels/CallChannel.php +++ b/src/Broadcasting/Channels/CallChannel.php @@ -31,7 +31,7 @@ public function __construct(Messenger $messenger) /** * Authenticate the provider's access to the channel. * - * @param $user + * @param $user * @param Thread $thread * @param Call $call * @return ProviderResource diff --git a/src/Broadcasting/Channels/ProviderChannel.php b/src/Broadcasting/Channels/ProviderChannel.php index e7fdef27..60478394 100644 --- a/src/Broadcasting/Channels/ProviderChannel.php +++ b/src/Broadcasting/Channels/ProviderChannel.php @@ -24,7 +24,7 @@ public function __construct(Messenger $messenger) /** * Authenticate the provider's access to the channel. * - * @param $user + * @param $user * @param string|null $alias * @param string|null $id * @return bool diff --git a/src/Broadcasting/Channels/ThreadChannel.php b/src/Broadcasting/Channels/ThreadChannel.php index 820fee0a..b9b28fde 100644 --- a/src/Broadcasting/Channels/ThreadChannel.php +++ b/src/Broadcasting/Channels/ThreadChannel.php @@ -30,7 +30,7 @@ public function __construct(Messenger $messenger) /** * Authenticate the provider's access to the channel. * - * @param $user + * @param $user * @param Thread $thread * @return ProviderResource * diff --git a/src/Brokers/FriendBroker.php b/src/Brokers/FriendBroker.php index 5c6989bf..94326d07 100644 --- a/src/Brokers/FriendBroker.php +++ b/src/Brokers/FriendBroker.php @@ -219,7 +219,7 @@ private function getProviderSentFriendsBuilder(): Builder } /** - * @param $model + * @param $model * @return Friend|null */ private function getFriend($model): ?Friend @@ -232,7 +232,7 @@ private function getFriend($model): ?Friend } /** - * @param $model + * @param $model * @return SentFriend|null */ private function getSentFriend($model): ?SentFriend @@ -245,7 +245,7 @@ private function getSentFriend($model): ?SentFriend } /** - * @param $model + * @param $model * @return PendingFriend|null */ private function getPendingFriend($model): ?PendingFriend diff --git a/src/Contracts/Ownerable.php b/src/Contracts/Ownerable.php index 8765d57d..443f27f7 100644 --- a/src/Contracts/Ownerable.php +++ b/src/Contracts/Ownerable.php @@ -9,6 +9,7 @@ * @property string|int $owner_id * @property string $owner_type * @property-read Model|MessengerProvider $owner + * * @mixin Model|\Eloquent */ interface Ownerable diff --git a/src/Exceptions/Handler.php b/src/Exceptions/Handler.php index c1ea85a0..1e75c512 100644 --- a/src/Exceptions/Handler.php +++ b/src/Exceptions/Handler.php @@ -66,8 +66,8 @@ public function renderForConsole($output, Throwable $e): void } /** - * @param $method - * @param $parameters + * @param $method + * @param $parameters * @return mixed */ public function __call($method, $parameters) diff --git a/src/Http/Collections/AudioMessageCollection.php b/src/Http/Collections/AudioMessageCollection.php index 501eeed0..2d6bfd21 100644 --- a/src/Http/Collections/AudioMessageCollection.php +++ b/src/Http/Collections/AudioMessageCollection.php @@ -12,7 +12,7 @@ class AudioMessageCollection extends MessengerCollection /** * AudioMessageCollection constructor. * - * @param $resource + * @param $resource * @param Thread $thread * @param bool $paginate * @param string|null $pageId diff --git a/src/Http/Collections/CallCollection.php b/src/Http/Collections/CallCollection.php index d6bf2c44..94c51d7f 100644 --- a/src/Http/Collections/CallCollection.php +++ b/src/Http/Collections/CallCollection.php @@ -12,7 +12,7 @@ class CallCollection extends MessengerCollection /** * CallCollection constructor. * - * @param $resource + * @param $resource * @param Thread $thread * @param bool $paginate * @param string|null $pageId diff --git a/src/Http/Collections/DocumentMessageCollection.php b/src/Http/Collections/DocumentMessageCollection.php index 45d74236..76435134 100644 --- a/src/Http/Collections/DocumentMessageCollection.php +++ b/src/Http/Collections/DocumentMessageCollection.php @@ -12,7 +12,7 @@ class DocumentMessageCollection extends MessengerCollection /** * DocumentMessageCollection constructor. * - * @param $resource + * @param $resource * @param Thread $thread * @param bool $paginate * @param string|null $pageId diff --git a/src/Http/Collections/GroupThreadCollection.php b/src/Http/Collections/GroupThreadCollection.php index 159c55db..766ae420 100644 --- a/src/Http/Collections/GroupThreadCollection.php +++ b/src/Http/Collections/GroupThreadCollection.php @@ -12,7 +12,7 @@ class GroupThreadCollection extends MessengerCollection /** * GroupThreadCollection constructor. * - * @param $resource + * @param $resource * @param bool $paginate * @param string|null $pageId */ diff --git a/src/Http/Collections/ImageMessageCollection.php b/src/Http/Collections/ImageMessageCollection.php index ad126e09..35520148 100644 --- a/src/Http/Collections/ImageMessageCollection.php +++ b/src/Http/Collections/ImageMessageCollection.php @@ -12,7 +12,7 @@ class ImageMessageCollection extends MessengerCollection /** * ImagesCollection constructor. * - * @param $resource + * @param $resource * @param Thread $thread * @param bool $paginate * @param string|null $pageId diff --git a/src/Http/Collections/InviteCollection.php b/src/Http/Collections/InviteCollection.php index 8b1e7e90..0b49b578 100644 --- a/src/Http/Collections/InviteCollection.php +++ b/src/Http/Collections/InviteCollection.php @@ -13,7 +13,7 @@ class InviteCollection extends MessengerCollection /** * InviteCollection constructor. * - * @param $resource + * @param $resource * @param Thread $thread */ public function __construct($resource, Thread $thread) diff --git a/src/Http/Collections/MessageCollection.php b/src/Http/Collections/MessageCollection.php index c768b30a..42315d01 100644 --- a/src/Http/Collections/MessageCollection.php +++ b/src/Http/Collections/MessageCollection.php @@ -12,7 +12,7 @@ class MessageCollection extends MessengerCollection /** * MessageCollection constructor. * - * @param $resource + * @param $resource * @param Thread $thread * @param bool $paginate * @param string|null $pageId diff --git a/src/Http/Collections/MessengerCollection.php b/src/Http/Collections/MessengerCollection.php index 60360f77..1a29993e 100644 --- a/src/Http/Collections/MessengerCollection.php +++ b/src/Http/Collections/MessengerCollection.php @@ -270,37 +270,37 @@ protected function isFinalPage(): bool switch ($this->collectionType) { case 'threads': $model = app(ThreadRepository::class)->getProviderOldestThread(); - break; + break; case 'groups': $model = app(GroupThreadRepository::class)->getProviderOldestGroupThread(); - break; + break; case 'privates': $model = app(PrivateThreadRepository::class)->getProviderOldestPrivateThread(); - break; + break; case 'participants': $model = $this->thread->participants()->latest()->first(); - break; + break; case 'messages': $model = $this->thread->messages()->oldest()->first(); - break; + break; case 'calls': $model = $this->thread->calls()->videoCall()->oldest()->first(); - break; + break; case 'logs': $model = $this->thread->messages()->system()->oldest()->first(); - break; + break; case 'images': $model = $this->thread->messages()->image()->oldest()->first(); - break; + break; case 'audio': $model = $this->thread->messages()->audio()->oldest()->first(); - break; + break; case 'documents': $model = $this->thread->messages()->document()->oldest()->first(); - break; + break; case 'videos': $model = $this->thread->messages()->video()->oldest()->first(); - break; + break; } return (bool) $this->collection->firstWhere('id', optional($model)->getKey()); diff --git a/src/Http/Collections/ParticipantCollection.php b/src/Http/Collections/ParticipantCollection.php index a388872f..8ff363f5 100644 --- a/src/Http/Collections/ParticipantCollection.php +++ b/src/Http/Collections/ParticipantCollection.php @@ -12,7 +12,7 @@ class ParticipantCollection extends MessengerCollection /** * ParticipantCollection constructor. * - * @param $resource + * @param $resource * @param Thread $thread * @param bool $paginate * @param string|null $pageId diff --git a/src/Http/Collections/PrivateThreadCollection.php b/src/Http/Collections/PrivateThreadCollection.php index 3059cd7a..4f207ba6 100644 --- a/src/Http/Collections/PrivateThreadCollection.php +++ b/src/Http/Collections/PrivateThreadCollection.php @@ -12,7 +12,7 @@ class PrivateThreadCollection extends MessengerCollection /** * GroupThreadCollection constructor. * - * @param $resource + * @param $resource * @param bool $paginate * @param string|null $pageId */ diff --git a/src/Http/Collections/SearchCollection.php b/src/Http/Collections/SearchCollection.php index e1e400c5..1af91ef2 100644 --- a/src/Http/Collections/SearchCollection.php +++ b/src/Http/Collections/SearchCollection.php @@ -27,7 +27,7 @@ class SearchCollection extends MessengerCollection /** * SearchCollection constructor. * - * @param $resource + * @param $resource * @param null $searchQuery * @param array|null $searchQueryItems * @param bool $addOptions diff --git a/src/Http/Collections/SystemMessageCollection.php b/src/Http/Collections/SystemMessageCollection.php index 4f78cb20..56a3e434 100644 --- a/src/Http/Collections/SystemMessageCollection.php +++ b/src/Http/Collections/SystemMessageCollection.php @@ -12,7 +12,7 @@ class SystemMessageCollection extends MessengerCollection /** * SystemMessageCollection constructor. * - * @param $resource + * @param $resource * @param Thread $thread * @param bool $paginate * @param string|null $pageId diff --git a/src/Http/Collections/ThreadCollection.php b/src/Http/Collections/ThreadCollection.php index e318ee73..810518e6 100644 --- a/src/Http/Collections/ThreadCollection.php +++ b/src/Http/Collections/ThreadCollection.php @@ -12,7 +12,7 @@ class ThreadCollection extends MessengerCollection /** * ThreadCollection constructor. * - * @param $resource + * @param $resource * @param bool $paginate * @param string|null $pageId */ diff --git a/src/Http/Collections/VideoMessageCollection.php b/src/Http/Collections/VideoMessageCollection.php index e7cfbcce..78a78df8 100644 --- a/src/Http/Collections/VideoMessageCollection.php +++ b/src/Http/Collections/VideoMessageCollection.php @@ -12,7 +12,7 @@ class VideoMessageCollection extends MessengerCollection /** * VideoMessageCollection constructor. * - * @param $resource + * @param $resource * @param Thread $thread * @param bool $paginate * @param string|null $pageId diff --git a/src/Messenger.php b/src/Messenger.php index a7153865..f46ccbe2 100644 --- a/src/Messenger.php +++ b/src/Messenger.php @@ -309,7 +309,7 @@ public function flush(): void } /** - * @param $provider + * @param $provider * @return Model|string|null */ private function getClassNameString($provider = null): ?string diff --git a/src/MessengerBots.php b/src/MessengerBots.php index 68426ac4..b7c1cf0c 100644 --- a/src/MessengerBots.php +++ b/src/MessengerBots.php @@ -242,7 +242,7 @@ public function findHandler(?string $handlerOrAlias = null): ?string } return $this->handlers->search( - fn (BotActionHandlerDTO $handler) => $handler->alias === $handlerOrAlias + fn (BotActionHandlerDTO $handler) => $handler->alias === $handlerOrAlias ) ?: null; } @@ -406,7 +406,7 @@ public function findPackagedBot(?string $packageOrAlias = null): ?string } return $this->packagedBots->search( - fn (PackagedBotDTO $package) => $package->alias === $packageOrAlias + fn (PackagedBotDTO $package) => $package->alias === $packageOrAlias ) ?: null; } diff --git a/src/MessengerServiceProvider.php b/src/MessengerServiceProvider.php index a041a865..a9b6cf17 100644 --- a/src/MessengerServiceProvider.php +++ b/src/MessengerServiceProvider.php @@ -153,7 +153,7 @@ private function registerSubscribers(): void * Prepend our API middleware, merge additional * middleware, append throttle middleware. * - * @param $middleware + * @param $middleware * @return array */ private function mergeApiMiddleware($middleware): array diff --git a/src/Policies/BotActionPolicy.php b/src/Policies/BotActionPolicy.php index 1c742a3c..9525060b 100644 --- a/src/Policies/BotActionPolicy.php +++ b/src/Policies/BotActionPolicy.php @@ -15,7 +15,7 @@ class BotActionPolicy /** * Determine whether the provider can view bot actions. * - * @param $user + * @param $user * @param Thread $thread * @param Bot $bot * @return Response @@ -34,7 +34,7 @@ public function viewAny($user, Thread $thread, Bot $bot): Response /** * Determine whether the provider can view the bot action. * - * @param $user + * @param $user * @param BotAction $action * @param Thread $thread * @param Bot $bot @@ -58,7 +58,7 @@ public function view($user, /** * Determine whether the provider can create a new bot action. * - * @param $user + * @param $user * @param Thread $thread * @param Bot $bot * @return Response @@ -74,7 +74,7 @@ public function create($user, Thread $thread, Bot $bot): Response /** * Determine whether the provider can edit the bot action. * - * @param $user + * @param $user * @param BotAction $action * @param Thread $thread * @param Bot $bot @@ -95,7 +95,7 @@ public function update($user, /** * Determine whether the provider can delete the bot action. * - * @param $user + * @param $user * @param BotAction $action * @param Thread $thread * @param Bot $bot diff --git a/src/Policies/BotPolicy.php b/src/Policies/BotPolicy.php index 1dee5c36..321a94a6 100644 --- a/src/Policies/BotPolicy.php +++ b/src/Policies/BotPolicy.php @@ -14,7 +14,7 @@ class BotPolicy /** * Determine whether the provider can view thread bots. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -29,7 +29,7 @@ public function viewAny($user, Thread $thread): Response /** * Determine whether the provider can view the bot. * - * @param $user + * @param $user * @param Bot $bot * @param Thread $thread * @return Response @@ -46,7 +46,7 @@ public function view($user, Bot $bot, Thread $thread): Response /** * Determine whether the provider can create a new bot. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -60,7 +60,7 @@ public function create($user, Thread $thread): Response /** * Determine whether the provider can edit the bot. * - * @param $user + * @param $user * @param Bot $bot * @param Thread $thread * @return Response @@ -76,7 +76,7 @@ public function update($user, Bot $bot, Thread $thread): Response /** * Determine whether the provider can delete the bot. * - * @param $user + * @param $user * @param Bot $bot * @param Thread $thread * @return Response diff --git a/src/Policies/CallParticipantPolicy.php b/src/Policies/CallParticipantPolicy.php index e704897d..91cf8664 100644 --- a/src/Policies/CallParticipantPolicy.php +++ b/src/Policies/CallParticipantPolicy.php @@ -15,7 +15,7 @@ class CallParticipantPolicy /** * Determine whether the provider can view call participants. * - * @param $user + * @param $user * @param Thread $thread * @param Call $call * @return Response @@ -31,7 +31,7 @@ public function viewAny($user, Thread $thread, Call $call): Response /** * Determine whether the provider can view the call participant. * - * @param $user + * @param $user * @param CallParticipant $participant * @param Thread $thread * @param Call $call @@ -52,7 +52,7 @@ public function view($user, /** * Determine whether the provider can update the call participant. * - * @param $user + * @param $user * @param CallParticipant $participant * @param Thread $thread * @param Call $call diff --git a/src/Policies/CallPolicy.php b/src/Policies/CallPolicy.php index 2f7b32ee..bad0d650 100644 --- a/src/Policies/CallPolicy.php +++ b/src/Policies/CallPolicy.php @@ -14,7 +14,7 @@ class CallPolicy /** * Determine whether the provider can view the calls. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -28,7 +28,7 @@ public function viewAny($user, Thread $thread): Response /** * Determine whether the provider can view the call. * - * @param $user + * @param $user * @param Thread $thread * @param Call $call * @return Response @@ -44,7 +44,7 @@ public function view($user, Call $call, Thread $thread): Response /** * Determine whether the provider can connect to the call socket channel. * - * @param $user + * @param $user * @param Thread $thread * @param Call $call * @return Response @@ -63,7 +63,7 @@ public function socket($user, Call $call, Thread $thread): Response /** * Determine whether the provider can start a new call. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -79,7 +79,7 @@ public function create($user, Thread $thread): Response /** * Determine whether the provider join the call. * - * @param $user + * @param $user * @param Call $call * @param Thread $thread * @return Response @@ -97,7 +97,7 @@ public function join($user, Call $call, Thread $thread): Response /** * Determine whether the provider can leave the call. * - * @param $user + * @param $user * @param Thread $thread * @param Call $call * @return Response @@ -116,7 +116,7 @@ public function leave($user, Call $call, Thread $thread): Response /** * Determine whether the provider can end the call. * - * @param $user + * @param $user * @param Thread $thread * @param Call $call * @return Response @@ -137,7 +137,7 @@ public function end($user, Call $call, Thread $thread): Response /** * Determine whether the provider can ignore the call. * - * @param $user + * @param $user * @param Thread $thread * @param Call $call * @return Response @@ -155,7 +155,7 @@ public function ignore($user, Call $call, Thread $thread): Response /** * Determine whether the provider can use the call heartbeat. * - * @param $user + * @param $user * @param Thread $thread * @param Call $call * @return Response diff --git a/src/Policies/FriendPolicy.php b/src/Policies/FriendPolicy.php index e48f0700..60ac12d3 100644 --- a/src/Policies/FriendPolicy.php +++ b/src/Policies/FriendPolicy.php @@ -29,7 +29,7 @@ public function __construct(Messenger $service) /** * Determine whether the provider can view friends. * - * @param $user + * @param $user * @return Response */ public function viewAny($user): Response @@ -40,7 +40,7 @@ public function viewAny($user): Response /** * Determine whether the provider can view a friend. * - * @param $user + * @param $user * @param Friend $friend * @return Response */ @@ -55,7 +55,7 @@ public function view($user, Friend $friend): Response /** * Determine whether the provider can delete the friend. * - * @param $user + * @param $user * @param Friend $friend * @return Response */ diff --git a/src/Policies/InvitePolicy.php b/src/Policies/InvitePolicy.php index 8f75c279..39a6b810 100644 --- a/src/Policies/InvitePolicy.php +++ b/src/Policies/InvitePolicy.php @@ -30,7 +30,7 @@ public function __construct(Messenger $messenger) /** * Determine whether the provider can view thread invites. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -44,7 +44,7 @@ public function viewAny($user, Thread $thread): Response /** * Determine whether the provider can create a thread invite. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -63,7 +63,7 @@ public function create($user, Thread $thread): Response /** * Determine whether the provider can delete the invite. * - * @param $user + * @param $user * @param Invite $invite * @param Thread $thread * @return Response @@ -79,7 +79,7 @@ public function delete($user, Invite $invite, Thread $thread): Response /** * Determine whether the provider can join using the invite. * - * @param $user + * @param $user * @param Invite $code * @return Response */ diff --git a/src/Policies/MessagePolicy.php b/src/Policies/MessagePolicy.php index 07df6e09..1b004c06 100644 --- a/src/Policies/MessagePolicy.php +++ b/src/Policies/MessagePolicy.php @@ -30,7 +30,7 @@ public function __construct(Messenger $messenger) /** * Determine whether the provider can view messages. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -44,7 +44,7 @@ public function viewAny($user, Thread $thread): Response /** * Determine whether the provider can view the message. * - * @param $user + * @param $user * @param Message $message * @param Thread $thread * @return Response @@ -60,7 +60,7 @@ public function view($user, Message $message, Thread $thread): Response /** * Determine whether the provider can view the message edits. * - * @param $user + * @param $user * @param Message $message * @param Thread $thread * @return Response @@ -79,7 +79,7 @@ public function viewEdits($user, Message $message, Thread $thread): Response /** * Determine whether the provider can create a message. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -93,7 +93,7 @@ public function create($user, Thread $thread): Response /** * Determine whether the provider can create a document message. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -107,7 +107,7 @@ public function createDocument($user, Thread $thread): Response /** * Determine whether the provider can create an audio message. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -121,7 +121,7 @@ public function createAudio($user, Thread $thread): Response /** * Determine whether the provider can create an image message. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -135,7 +135,7 @@ public function createImage($user, Thread $thread): Response /** * Determine whether the provider can create a video message. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -149,7 +149,7 @@ public function createVideo($user, Thread $thread): Response /** * Determine whether the provider can edit the message. * - * @param $user + * @param $user * @param Message $message * @param Thread $thread * @return Response @@ -167,7 +167,7 @@ public function update($user, Message $message, Thread $thread): Response /** * Determine whether the provider can remove embeds from the message. * - * @param $user + * @param $user * @param Message $message * @param Thread $thread * @return Response @@ -186,7 +186,7 @@ public function removeEmbeds($user, Message $message, Thread $thread): Response /** * Determine whether the provider can delete the message. * - * @param $user + * @param $user * @param Message $message * @param Thread $thread * @return Response diff --git a/src/Policies/MessageReactionPolicy.php b/src/Policies/MessageReactionPolicy.php index 2e78f94b..06a6c696 100644 --- a/src/Policies/MessageReactionPolicy.php +++ b/src/Policies/MessageReactionPolicy.php @@ -31,7 +31,7 @@ public function __construct(Messenger $messenger) /** * Determine whether the provider can view message reactions. * - * @param $user + * @param $user * @param Message $message * @param Thread $thread * @return Response @@ -47,7 +47,7 @@ public function viewAny($user, Message $message, Thread $thread): Response /** * Determine whether the provider can create a message reaction. * - * @param $user + * @param $user * @param Message $message * @param Thread $thread * @return Response @@ -65,7 +65,7 @@ public function create($user, Thread $thread, Message $message): Response /** * Determine whether the provider can delete the message reaction. * - * @param $user + * @param $user * @param MessageReaction $reaction * @param Thread $thread * @param Message $message diff --git a/src/Policies/ParticipantPolicy.php b/src/Policies/ParticipantPolicy.php index 9fa0ff57..85899156 100644 --- a/src/Policies/ParticipantPolicy.php +++ b/src/Policies/ParticipantPolicy.php @@ -14,7 +14,7 @@ class ParticipantPolicy /** * Determine whether the provider can view participants. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -28,7 +28,7 @@ public function viewAny($user, Thread $thread): Response /** * Determine whether the provider can view the participant. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -42,7 +42,7 @@ public function view($user, Thread $thread): Response /** * Determine whether the provider can create a participant. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -56,7 +56,7 @@ public function create($user, Thread $thread): Response /** * Determine whether the provider can update the participant. * - * @param $user + * @param $user * @param Participant $participant * @param Thread $thread * @return Response @@ -76,7 +76,7 @@ public function update($user, Participant $participant, Thread $thread): Respons /** * Determine whether the provider can promote the participant. * - * @param $user + * @param $user * @param Participant $participant * @param Thread $thread * @return Response @@ -96,7 +96,7 @@ public function promote($user, Participant $participant, Thread $thread): Respon /** * Determine whether the provider can demote the participant. * - * @param $user + * @param $user * @param Participant $participant * @param Thread $thread * @return Response @@ -116,7 +116,7 @@ public function demote($user, Participant $participant, Thread $thread): Respons /** * Determine whether the provider can delete the participant. * - * @param $user + * @param $user * @param Participant $participant * @param Thread $thread * @return Response diff --git a/src/Policies/PendingFriendPolicy.php b/src/Policies/PendingFriendPolicy.php index aaeb89ce..48f99b3f 100644 --- a/src/Policies/PendingFriendPolicy.php +++ b/src/Policies/PendingFriendPolicy.php @@ -29,7 +29,7 @@ public function __construct(Messenger $service) /** * Determine whether the provider can view pending friends. * - * @param $user + * @param $user * @return Response */ public function viewAny($user): Response @@ -42,7 +42,7 @@ public function viewAny($user): Response /** * Determine whether the provider can view the pending friend. * - * @param $user + * @param $user * @param PendingFriend $pending * @return Response */ @@ -57,7 +57,7 @@ public function view($user, PendingFriend $pending): Response /** * Determine whether the provider can accept the pending friend. * - * @param $user + * @param $user * @param PendingFriend $pending * @return Response */ @@ -72,7 +72,7 @@ public function update($user, PendingFriend $pending): Response /** * Determine whether the provider can deny the pending friend. * - * @param $user + * @param $user * @param PendingFriend $pending * @return Response */ diff --git a/src/Policies/SentFriendPolicy.php b/src/Policies/SentFriendPolicy.php index 75da9e64..12f87e8b 100644 --- a/src/Policies/SentFriendPolicy.php +++ b/src/Policies/SentFriendPolicy.php @@ -29,7 +29,7 @@ public function __construct(Messenger $service) /** * Determine whether the provider can view sent friend request. * - * @param $user + * @param $user * @return Response */ public function viewAny($user): Response @@ -42,7 +42,7 @@ public function viewAny($user): Response /** * Determine whether the provider can view the sent friend request. * - * @param $user + * @param $user * @param SentFriend $sent * @return Response */ @@ -57,7 +57,7 @@ public function view($user, SentFriend $sent): Response /** * Determine whether the provider can add new friend request. * - * @param $user + * @param $user * @return Response */ public function create($user): Response @@ -70,7 +70,7 @@ public function create($user): Response /** * Determine whether the provider can cancel sent friend request. * - * @param $user + * @param $user * @param SentFriend $sent * @return Response */ diff --git a/src/Policies/ThreadPolicy.php b/src/Policies/ThreadPolicy.php index a1dcfd24..108ccaad 100644 --- a/src/Policies/ThreadPolicy.php +++ b/src/Policies/ThreadPolicy.php @@ -23,7 +23,7 @@ public function viewAny(): Response /** * Determine whether the provider can view the thread. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -37,7 +37,7 @@ public function view($user, Thread $thread): Response /** * Determine whether the provider can join the thread socket channel. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -53,7 +53,7 @@ public function socket($user, Thread $thread): Response /** * Determine whether the provider can accept or deny a pending thread request. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -68,7 +68,7 @@ public function approval($user, Thread $thread): Response /** * Determine whether the provider can use a group thread method. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -83,7 +83,7 @@ public function groupMethod($user, Thread $thread): Response /** * Determine whether the provider can add group participants. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -97,7 +97,7 @@ public function addParticipants($user, Thread $thread): Response /** * Determine whether the provider can send a knock. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -111,7 +111,7 @@ public function sendKnock($user, Thread $thread): Response /** * Determine whether the provider can use a private thread method. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -135,7 +135,7 @@ public function create(): Response /** * Determine whether the provider can manage the group thread settings. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -151,7 +151,7 @@ public function settings($user, Thread $thread): Response /** * Determine whether the provider can update the thread. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -167,7 +167,7 @@ public function update($user, Thread $thread): Response /** * Determine whether the provider can mute or unmute the thread. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -182,7 +182,7 @@ public function mutes($user, Thread $thread): Response /** * Determine whether the provider can leave group thread. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ @@ -206,7 +206,7 @@ public function leave($user, Thread $thread): Response /** * Determine whether the provider can delete the thread. * - * @param $user + * @param $user * @param Thread $thread * @return Response */ diff --git a/src/Services/ImageRenderService.php b/src/Services/ImageRenderService.php index fc2312b2..4b16eeb6 100644 --- a/src/Services/ImageRenderService.php +++ b/src/Services/ImageRenderService.php @@ -262,13 +262,13 @@ private function renderDefaultImage(?string $alias = null): BinaryFileResponse switch ($alias) { case 'ghost': $default = $this->messenger->getDefaultGhostAvatar(); - break; + break; case 'bot': $default = $this->messenger->getDefaultBotAvatar(); - break; + break; case 'thread': $default = $this->messenger->getDefaultThreadAvatar(); - break; + break; default: $default = is_null($alias) ? null : $this->messenger->getProviderDefaultAvatarPath($alias); diff --git a/src/Services/SearchProvidersService.php b/src/Services/SearchProvidersService.php index 42844432..771a2637 100644 --- a/src/Services/SearchProvidersService.php +++ b/src/Services/SearchProvidersService.php @@ -139,7 +139,7 @@ private function sendEmptyPaginator(): LengthAwarePaginator } /** - * @param $query + * @param $query * @return SearchProvidersService */ private function sanitizeQuery($query): self diff --git a/src/Support/MessageTransformer.php b/src/Support/MessageTransformer.php index c3caf8f4..57c56d9e 100644 --- a/src/Support/MessageTransformer.php +++ b/src/Support/MessageTransformer.php @@ -118,7 +118,7 @@ public static function makeThreadArchived(Thread $thread, MessengerProvider $pro return [ $thread, $provider, - ($thread->isGroup() ? 'archived the group' : 'archived the conversation'), + $thread->isGroup() ? 'archived the group' : 'archived the conversation', Message::THREAD_ARCHIVED, ]; } diff --git a/src/Traits/HasOwner.php b/src/Traits/HasOwner.php index 6315c5c0..23198575 100644 --- a/src/Traits/HasOwner.php +++ b/src/Traits/HasOwner.php @@ -12,6 +12,7 @@ * @property string|int $owner_id * @property string $owner_type * @property-read Model|MessengerProvider $owner + * * @mixin Model|\Eloquent */ trait HasOwner diff --git a/tests/Actions/StoreSystemMessageTest.php b/tests/Actions/StoreSystemMessageTest.php index bf56eb79..04271bfc 100644 --- a/tests/Actions/StoreSystemMessageTest.php +++ b/tests/Actions/StoreSystemMessageTest.php @@ -88,9 +88,10 @@ public function it_fires_events() /** * @test + * * @dataProvider messageTypes * - * @param $type + * @param $type */ public function it_stores_message_type_using_description($type) { diff --git a/tests/Brokers/BroadcastBrokerTest.php b/tests/Brokers/BroadcastBrokerTest.php index c41373b5..1d2df920 100644 --- a/tests/Brokers/BroadcastBrokerTest.php +++ b/tests/Brokers/BroadcastBrokerTest.php @@ -419,9 +419,10 @@ public function it_broadcast_after_removing_duplicate_presence_channels() /** * @test + * * @dataProvider modelsWithOwner * - * @param $model + * @param $model */ public function it_broadcast_to_ownerable_models_owner($model) { diff --git a/tests/Commands/PurgeThreadsCommandTest.php b/tests/Commands/PurgeThreadsCommandTest.php index 15ed0f3c..953f7f66 100644 --- a/tests/Commands/PurgeThreadsCommandTest.php +++ b/tests/Commands/PurgeThreadsCommandTest.php @@ -68,9 +68,9 @@ public function it_runs_job_now() public function it_finds_multiple_threads() { Thread::factory()->sequence( - ['deleted_at' => now()->subDays(8)], - ['deleted_at' => now()->subDays(10)], - ) + ['deleted_at' => now()->subDays(8)], + ['deleted_at' => now()->subDays(10)], + ) ->count(2) ->create(); diff --git a/tests/Http/AddParticipantsTest.php b/tests/Http/AddParticipantsTest.php index ccf18a68..ccb78573 100644 --- a/tests/Http/AddParticipantsTest.php +++ b/tests/Http/AddParticipantsTest.php @@ -257,10 +257,11 @@ public function existing_participant_will_be_ignored_when_adding_participants() /** * @test + * * @dataProvider providersValidation * - * @param $providers - * @param $errors + * @param $providers + * @param $errors */ public function add_participants_checks_providers($providers, $errors) { diff --git a/tests/Http/AudioMessageTest.php b/tests/Http/AudioMessageTest.php index f395393a..27f40a6f 100644 --- a/tests/Http/AudioMessageTest.php +++ b/tests/Http/AudioMessageTest.php @@ -147,9 +147,10 @@ public function user_forbidden_to_send_audio_message_when_disabled_from_config() /** * @test + * * @dataProvider audioPassesValidation * - * @param $audioValue + * @param $audioValue */ public function send_audio_message_passes_audio_validation($audioValue) { @@ -168,9 +169,10 @@ public function send_audio_message_passes_audio_validation($audioValue) /** * @test + * * @dataProvider audioFailsValidation * - * @param $audioValue + * @param $audioValue */ public function send_audio_message_fails_audio_validation($audioValue) { diff --git a/tests/Http/BotAvatarTest.php b/tests/Http/BotAvatarTest.php index 9a291f74..c6514696 100644 --- a/tests/Http/BotAvatarTest.php +++ b/tests/Http/BotAvatarTest.php @@ -194,9 +194,10 @@ public function forbidden_to_remove_avatar_when_disabled_in_thread() /** * @test + * * @dataProvider avatarPassesValidation * - * @param $avatarValue + * @param $avatarValue */ public function avatar_upload_passes_validation($avatarValue) { @@ -215,9 +216,10 @@ public function avatar_upload_passes_validation($avatarValue) /** * @test + * * @dataProvider avatarFailedValidation * - * @param $avatarValue + * @param $avatarValue */ public function avatar_upload_fails_validation($avatarValue) { diff --git a/tests/Http/BotsTest.php b/tests/Http/BotsTest.php index 7026a4f6..5f4b1d8a 100644 --- a/tests/Http/BotsTest.php +++ b/tests/Http/BotsTest.php @@ -392,13 +392,14 @@ public function forbidden_to_update_bot_when_disabled_in_thread() /** * @test + * * @dataProvider botFailsValidation * - * @param $name - * @param $enabled - * @param $hide - * @param $cooldown - * @param $errors + * @param $name + * @param $enabled + * @param $hide + * @param $cooldown + * @param $errors */ public function store_bot_fails_validation($name, $enabled, $hide, $cooldown, $errors) { @@ -420,12 +421,13 @@ public function store_bot_fails_validation($name, $enabled, $hide, $cooldown, $e /** * @test + * * @dataProvider botPassesValidation * - * @param $name - * @param $enabled - * @param $hide - * @param $cooldown + * @param $name + * @param $enabled + * @param $hide + * @param $cooldown */ public function store_bot_passes_validation($name, $enabled, $hide, $cooldown) { @@ -445,12 +447,13 @@ public function store_bot_passes_validation($name, $enabled, $hide, $cooldown) /** * @test + * * @dataProvider botFailsValidation * - * @param $name - * @param $enabled - * @param $cooldown - * @param $errors + * @param $name + * @param $enabled + * @param $cooldown + * @param $errors */ public function update_bot_fails_validation($name, $enabled, $hide, $cooldown, $errors) { @@ -474,12 +477,13 @@ public function update_bot_fails_validation($name, $enabled, $hide, $cooldown, $ /** * @test + * * @dataProvider botPassesValidation * - * @param $name - * @param $enabled - * @param $hide - * @param $cooldown + * @param $name + * @param $enabled + * @param $hide + * @param $cooldown */ public function update_bot_passes_validation($name, $enabled, $hide, $cooldown) { diff --git a/tests/Http/DocumentMessageTest.php b/tests/Http/DocumentMessageTest.php index 2df5ee2a..0dc0e0d5 100644 --- a/tests/Http/DocumentMessageTest.php +++ b/tests/Http/DocumentMessageTest.php @@ -147,9 +147,10 @@ public function user_forbidden_to_send_document_message_when_disabled_from_confi /** * @test + * * @dataProvider documentPassesValidation * - * @param $documentValue + * @param $documentValue */ public function send_document_message_passes_document_validation($documentValue) { @@ -168,9 +169,10 @@ public function send_document_message_passes_document_validation($documentValue) /** * @test + * * @dataProvider documentFailsValidation * - * @param $documentValue + * @param $documentValue */ public function send_document_message_fails_document_validation($documentValue) { diff --git a/tests/Http/EditMessageTest.php b/tests/Http/EditMessageTest.php index 9343cc83..2a0b7290 100644 --- a/tests/Http/EditMessageTest.php +++ b/tests/Http/EditMessageTest.php @@ -197,9 +197,10 @@ public function forbidden_to_update_message_when_thread_locked() /** * @test + * * @dataProvider editPassesValidation * - * @param $value + * @param $value */ public function edit_message_passes_validation($value) { @@ -218,9 +219,10 @@ public function edit_message_passes_validation($value) /** * @test + * * @dataProvider editFailsValidation * - * @param $value + * @param $value */ public function edit_message_fails_validation($value) { diff --git a/tests/Http/FindRecipientThreadTest.php b/tests/Http/FindRecipientThreadTest.php index a09365c5..110ab3b7 100644 --- a/tests/Http/FindRecipientThreadTest.php +++ b/tests/Http/FindRecipientThreadTest.php @@ -82,10 +82,11 @@ public function private_thread_locator_returns_company_without_existing_thread_i /** * @test + * * @dataProvider locatorValidation * - * @param $alias - * @param $id + * @param $alias + * @param $id */ public function private_thread_locator_returns_not_found_on_invalid_id_or_alias($alias, $id) { diff --git a/tests/Http/GroupThreadAvatarTest.php b/tests/Http/GroupThreadAvatarTest.php index 2149b15c..d59b78b4 100644 --- a/tests/Http/GroupThreadAvatarTest.php +++ b/tests/Http/GroupThreadAvatarTest.php @@ -143,9 +143,10 @@ public function group_avatar_size_limit_can_be_overwritten() /** * @test + * * @dataProvider avatarPassesValidation * - * @param $avatarValue + * @param $avatarValue */ public function group_avatar_upload_passes_validations($avatarValue) { @@ -162,9 +163,10 @@ public function group_avatar_upload_passes_validations($avatarValue) /** * @test + * * @dataProvider avatarFailedValidation * - * @param $avatarValue + * @param $avatarValue */ public function group_avatar_upload_fails_validations($avatarValue) { diff --git a/tests/Http/GroupThreadSettingsTest.php b/tests/Http/GroupThreadSettingsTest.php index a62021fa..067a1b63 100644 --- a/tests/Http/GroupThreadSettingsTest.php +++ b/tests/Http/GroupThreadSettingsTest.php @@ -176,9 +176,10 @@ public function forbidden_to_update_group_settings_when_thread_locked() /** * @test + * * @dataProvider settingsFailsValidation * - * @param $fieldValue + * @param $fieldValue */ public function group_settings_fails_validating_booleans($fieldValue) { @@ -211,9 +212,10 @@ public function group_settings_fails_validating_booleans($fieldValue) /** * @test + * * @dataProvider subjectFailsValidation * - * @param $subject + * @param $subject */ public function group_settings_fails_validating_subject($subject) { diff --git a/tests/Http/GroupThreadsTest.php b/tests/Http/GroupThreadsTest.php index 42b7f0ee..b89a118a 100644 --- a/tests/Http/GroupThreadsTest.php +++ b/tests/Http/GroupThreadsTest.php @@ -121,9 +121,10 @@ public function store_group_with_multiple_providers() /** * @test + * * @dataProvider subjectFailsValidation * - * @param $subject + * @param $subject */ public function store_new_group_fails_validating_subject($subject) { @@ -139,10 +140,11 @@ public function store_new_group_fails_validating_subject($subject) /** * @test + * * @dataProvider providersFailValidation * - * @param $providers - * @param $errors + * @param $providers + * @param $errors */ public function store_new_group_fails_validating_providers($providers, $errors) { diff --git a/tests/Http/ImageMessageTest.php b/tests/Http/ImageMessageTest.php index f4425fa9..5567ad81 100644 --- a/tests/Http/ImageMessageTest.php +++ b/tests/Http/ImageMessageTest.php @@ -142,9 +142,10 @@ public function user_forbidden_to_send_image_message_when_disabled_from_config() /** * @test + * * @dataProvider imagePassesValidation * - * @param $imageValue + * @param $imageValue */ public function send_image_message_upload_passes_validation($imageValue) { @@ -162,9 +163,10 @@ public function send_image_message_upload_passes_validation($imageValue) /** * @test + * * @dataProvider imageFailedValidation * - * @param $imageValue + * @param $imageValue */ public function send_image_message_upload_fails_validation($imageValue) { diff --git a/tests/Http/InstallBotPackageTest.php b/tests/Http/InstallBotPackageTest.php index f3be4013..046503c2 100644 --- a/tests/Http/InstallBotPackageTest.php +++ b/tests/Http/InstallBotPackageTest.php @@ -98,9 +98,10 @@ public function participant_with_permission_can_install_packaged_bot() /** * @test + * * @dataProvider aliasFailsValidation * - * @param $alias + * @param $alias */ public function install_packaged_bot_fails_alias_validation($alias) { diff --git a/tests/Http/InvitesTest.php b/tests/Http/InvitesTest.php index 5e71f97d..7b05a628 100644 --- a/tests/Http/InvitesTest.php +++ b/tests/Http/InvitesTest.php @@ -249,9 +249,10 @@ public function forbidden_to_create_invites_when_disabled_in_group_settings() /** * @test + * * @dataProvider inviteValidationFailsUses * - * @param $usesValue + * @param $usesValue */ public function create_invite_fails_uses_validation($usesValue) { @@ -270,9 +271,10 @@ public function create_invite_fails_uses_validation($usesValue) /** * @test + * * @dataProvider inviteValidationFailsExpires * - * @param $expiresValue + * @param $expiresValue */ public function create_invite_fails_expires_validation($expiresValue) { @@ -292,9 +294,10 @@ public function create_invite_fails_expires_validation($expiresValue) /** * @test + * * @dataProvider inviteValidationPassesExpires * - * @param $expiresValue + * @param $expiresValue */ public function create_invite_passes_expires_validation($expiresValue) { diff --git a/tests/Http/MessageReactionTest.php b/tests/Http/MessageReactionTest.php index 7251d03d..034003da 100644 --- a/tests/Http/MessageReactionTest.php +++ b/tests/Http/MessageReactionTest.php @@ -248,9 +248,10 @@ public function admin_can_remove_unowned_reaction() /** * @test + * * @dataProvider passesEmojiValidation * - * @param $string + * @param $string */ public function it_passes_validating_has_valid_emoji($string) { @@ -269,9 +270,10 @@ public function it_passes_validating_has_valid_emoji($string) /** * @test + * * @dataProvider failsEmojiValidation * - * @param $string + * @param $string */ public function it_fails_validating_has_valid_emoji($string) { diff --git a/tests/Http/MessengerAvatarTest.php b/tests/Http/MessengerAvatarTest.php index b436753b..5d05d3c2 100644 --- a/tests/Http/MessengerAvatarTest.php +++ b/tests/Http/MessengerAvatarTest.php @@ -87,9 +87,10 @@ public function user_forbidden_to_remove_avatar_when_disabled() /** * @test + * * @dataProvider avatarPassesValidation * - * @param $avatarValue + * @param $avatarValue */ public function avatar_upload_passes_validation($avatarValue) { @@ -103,9 +104,10 @@ public function avatar_upload_passes_validation($avatarValue) /** * @test + * * @dataProvider avatarFailedValidation * - * @param $avatarValue + * @param $avatarValue */ public function avatar_upload_fails_validation($avatarValue) { diff --git a/tests/Http/MessengerSettingsTest.php b/tests/Http/MessengerSettingsTest.php index 91d2a433..843d6724 100644 --- a/tests/Http/MessengerSettingsTest.php +++ b/tests/Http/MessengerSettingsTest.php @@ -46,10 +46,11 @@ public function user_can_update_messenger_settings() /** * @test + * * @dataProvider settingsValidation * - * @param $boolInput - * @param $intInput + * @param $boolInput + * @param $intInput */ public function updating_messenger_settings_checks_booleans_and_integer($boolInput, $intInput) { diff --git a/tests/Http/PrivateMessageTest.php b/tests/Http/PrivateMessageTest.php index 63e9fde0..76af918f 100644 --- a/tests/Http/PrivateMessageTest.php +++ b/tests/Http/PrivateMessageTest.php @@ -261,10 +261,11 @@ public function forbidden_to_archive_message_when_thread_locked() /** * @test + * * @dataProvider messagePassesValidation * - * @param $messageValue - * @param $tempIdValue + * @param $messageValue + * @param $tempIdValue */ public function send_message_passes_validations($messageValue, $tempIdValue) { @@ -282,10 +283,11 @@ public function send_message_passes_validations($messageValue, $tempIdValue) /** * @test + * * @dataProvider messageFailsValidation * - * @param $messageValue - * @param $tempIdValue + * @param $messageValue + * @param $tempIdValue */ public function send_message_fails_validations($messageValue, $tempIdValue) { @@ -308,9 +310,10 @@ public function send_message_fails_validations($messageValue, $tempIdValue) /** * @test + * * @dataProvider messageExtraFailsValidation * - * @param $extraValue + * @param $extraValue */ public function send_message_extra_fails_validation($extraValue) { @@ -333,10 +336,11 @@ public function send_message_extra_fails_validation($extraValue) /** * @test + * * @dataProvider messageExtraPassesValidation * - * @param $extraValue - * @param $extraOutput + * @param $extraValue + * @param $extraOutput */ public function send_message_extra_passes_validation($extraValue, $extraOutput) { diff --git a/tests/Http/PrivateThreadsTest.php b/tests/Http/PrivateThreadsTest.php index 90d3feba..26aea1de 100644 --- a/tests/Http/PrivateThreadsTest.php +++ b/tests/Http/PrivateThreadsTest.php @@ -152,9 +152,10 @@ public function creating_new_private_forbidden_when_one_exist() /** * @test + * * @dataProvider messageFailsValidation * - * @param $messageValue + * @param $messageValue */ public function create_new_private_fails_validating_message($messageValue) { @@ -172,11 +173,12 @@ public function create_new_private_fails_validating_message($messageValue) /** * @test + * * @dataProvider recipientFailsValidation * - * @param $aliasValue - * @param $idValue - * @param $errors + * @param $aliasValue + * @param $idValue + * @param $errors */ public function create_new_private_fails_validating_recipient_values($aliasValue, $idValue, $errors) { diff --git a/tests/Http/StatusHeartbeatTest.php b/tests/Http/StatusHeartbeatTest.php index 9aa265c9..0d98f42f 100644 --- a/tests/Http/StatusHeartbeatTest.php +++ b/tests/Http/StatusHeartbeatTest.php @@ -40,9 +40,10 @@ public function messenger_heartbeat_away() /** * @test + * * @dataProvider awayValidation * - * @param $awayValue + * @param $awayValue */ public function messenger_heartbeat_checks_boolean($awayValue) { diff --git a/tests/Http/UpdateParticipantPermissionsTest.php b/tests/Http/UpdateParticipantPermissionsTest.php index 80948929..32977bcb 100644 --- a/tests/Http/UpdateParticipantPermissionsTest.php +++ b/tests/Http/UpdateParticipantPermissionsTest.php @@ -141,9 +141,10 @@ public function admin_forbidden_to_update_group_participant_permissions_when_thr /** * @test + * * @dataProvider permissionsValidation * - * @param $permissionValue + * @param $permissionValue */ public function update_group_participant_checks_boolean_values($permissionValue) { diff --git a/tests/Http/VideoMessageTest.php b/tests/Http/VideoMessageTest.php index 2e095e69..6136d342 100644 --- a/tests/Http/VideoMessageTest.php +++ b/tests/Http/VideoMessageTest.php @@ -147,9 +147,10 @@ public function user_forbidden_to_send_video_message_when_disabled_from_config() /** * @test + * * @dataProvider videoPassesValidation * - * @param $videoValue + * @param $videoValue */ public function send_video_message_passes_video_validation($videoValue) { @@ -168,9 +169,10 @@ public function send_video_message_passes_video_validation($videoValue) /** * @test + * * @dataProvider videoFailsValidation * - * @param $videoValue + * @param $videoValue */ public function send_video_message_fails_video_validation($videoValue) { diff --git a/tests/Middleware/RateLimitersTest.php b/tests/Middleware/RateLimitersTest.php index e64d6890..a7c86e5e 100644 --- a/tests/Middleware/RateLimitersTest.php +++ b/tests/Middleware/RateLimitersTest.php @@ -91,11 +91,12 @@ public function setting_message_api_limit_to_zero_removes_rate_limiter() /** * @test + * * @dataProvider attachments * - * @param $route - * @param $key - * @param $attachment + * @param $route + * @param $key + * @param $attachment */ public function store_attachment_message_api_limits_request_15_per_minute($route, $key, $attachment) { @@ -115,11 +116,12 @@ public function store_attachment_message_api_limits_request_15_per_minute($route /** * @test + * * @dataProvider attachments * - * @param $route - * @param $key - * @param $attachment + * @param $route + * @param $key + * @param $attachment */ public function setting_attachment_message_api_limit_to_zero_removes_rate_limiter($route, $key, $attachment) { diff --git a/tests/Models/BotActionTest.php b/tests/Models/BotActionTest.php index 4290df90..49a9c789 100644 --- a/tests/Models/BotActionTest.php +++ b/tests/Models/BotActionTest.php @@ -305,8 +305,9 @@ public function it_clears_valid_actions_for_thread_cache() /** * @test * - * @param $triggers - * @param $result + * @param $triggers + * @param $result + * * @dataProvider triggersGetFormatted */ public function it_formats_triggers($triggers, $result) diff --git a/tests/Models/BotTest.php b/tests/Models/BotTest.php index 7dcf75a0..05804e53 100644 --- a/tests/Models/BotTest.php +++ b/tests/Models/BotTest.php @@ -126,8 +126,8 @@ public function it_has_avatar_route() public function it_has_cooldown_cache_key() { $bot = Bot::factory()->for( - Thread::factory()->group()->create() - )->owner($this->tippin)->create(); + Thread::factory()->group()->create() + )->owner($this->tippin)->create(); $this->assertSame("bot:$bot->id:cooldown", $bot->getCooldownCacheKey()); } diff --git a/tests/Models/ThreadTest.php b/tests/Models/ThreadTest.php index 9d3a16ca..b4d18dd5 100644 --- a/tests/Models/ThreadTest.php +++ b/tests/Models/ThreadTest.php @@ -412,7 +412,7 @@ public function cannot_message_if_thread_locked() public function cannot_message_if_disabled_in_thread_settings() { Messenger::setProvider($this->tippin); - $thread = Thread::factory()->group()->create(['messaging' => false]); + $thread = Thread::factory()->group()->create(['messaging' => false]); Participant::factory()->for($thread)->owner($this->tippin)->admin()->create(); $this->assertFalse($thread->canMessage()); diff --git a/tests/Services/BotHandlerResolverServiceTest.php b/tests/Services/BotHandlerResolverServiceTest.php index 355ce0b7..38c9c5ea 100644 --- a/tests/Services/BotHandlerResolverServiceTest.php +++ b/tests/Services/BotHandlerResolverServiceTest.php @@ -319,11 +319,12 @@ public function it_formats_payload_using_handler_custom_rules_only() /** * @test * - * @param $match - * @param $cooldown - * @param $admin - * @param $enabled - * @param $triggers + * @param $match + * @param $cooldown + * @param $admin + * @param $enabled + * @param $triggers + * * @dataProvider baseRulesetFailsValidation */ public function it_fails_validating_base_ruleset($match, $cooldown, $admin, $enabled, $triggers) @@ -351,8 +352,9 @@ public function it_fails_validating_base_ruleset($match, $cooldown, $admin, $ena /** * @test * - * @param $triggers - * @param $errorKeys + * @param $triggers + * @param $errorKeys + * * @dataProvider triggersFailValidation */ public function it_fails_validating_triggers($triggers, $errorKeys) @@ -378,7 +380,8 @@ public function it_fails_validating_triggers($triggers, $errorKeys) /** * @test * - * @param $matches + * @param $matches + * * @dataProvider passesValidatingMatches */ public function it_passes_validating_matches($matches) @@ -399,7 +402,8 @@ public function it_passes_validating_matches($matches) /** * @test * - * @param $cooldown + * @param $cooldown + * * @dataProvider passesValidatingCooldown */ public function it_passes_validating_cooldown($cooldown) @@ -420,8 +424,9 @@ public function it_passes_validating_cooldown($cooldown) /** * @test * - * @param $extra - * @param $errorKeys + * @param $extra + * @param $errorKeys + * * @dataProvider handlerRulesFailValidation */ public function it_fails_validating_handler_rules($extra, $errorKeys) diff --git a/tests/Services/BotMatchingServiceTest.php b/tests/Services/BotMatchingServiceTest.php index bc696c1b..234cdbb2 100644 --- a/tests/Services/BotMatchingServiceTest.php +++ b/tests/Services/BotMatchingServiceTest.php @@ -19,9 +19,10 @@ protected function setUp(): void /** * @test + * * @dataProvider stringMatchesExact * - * @param $string + * @param $string */ public function it_matches_exact($string) { @@ -30,9 +31,10 @@ public function it_matches_exact($string) /** * @test + * * @dataProvider stringMatchesExactCaseless * - * @param $string + * @param $string */ public function it_matches_exact_caseless($string) { @@ -41,9 +43,10 @@ public function it_matches_exact_caseless($string) /** * @test + * * @dataProvider stringNotExact * - * @param $string + * @param $string */ public function it_doesnt_match_exact($string) { @@ -52,9 +55,10 @@ public function it_doesnt_match_exact($string) /** * @test + * * @dataProvider stringNotExact * - * @param $string + * @param $string */ public function it_doesnt_match_exact_caseless($string) { @@ -63,9 +67,10 @@ public function it_doesnt_match_exact_caseless($string) /** * @test + * * @dataProvider stringMatchesStartsWith * - * @param $string + * @param $string */ public function it_matches_starts_with($string) { @@ -74,9 +79,10 @@ public function it_matches_starts_with($string) /** * @test + * * @dataProvider stringMatchesStartsWithCaseless * - * @param $string + * @param $string */ public function it_matches_starts_with_caseless($string) { @@ -85,9 +91,10 @@ public function it_matches_starts_with_caseless($string) /** * @test + * * @dataProvider stringNotStartsWith * - * @param $string + * @param $string */ public function it_doesnt_match_starts_with($string) { @@ -96,9 +103,10 @@ public function it_doesnt_match_starts_with($string) /** * @test + * * @dataProvider stringNotStartsWith * - * @param $string + * @param $string */ public function it_doesnt_match_starts_with_caseless($string) { @@ -107,9 +115,10 @@ public function it_doesnt_match_starts_with_caseless($string) /** * @test + * * @dataProvider stringMatchesContains * - * @param $string + * @param $string */ public function it_matches_contains($string) { @@ -118,9 +127,10 @@ public function it_matches_contains($string) /** * @test + * * @dataProvider stringMatchesContainsCaseless * - * @param $string + * @param $string */ public function it_matches_contains_caseless($string) { @@ -129,9 +139,10 @@ public function it_matches_contains_caseless($string) /** * @test + * * @dataProvider stringNotContains * - * @param $string + * @param $string */ public function it_doesnt_match_contains($string) { @@ -140,9 +151,10 @@ public function it_doesnt_match_contains($string) /** * @test + * * @dataProvider stringNotContains * - * @param $string + * @param $string */ public function it_doesnt_match_contains_caseless($string) { @@ -151,10 +163,11 @@ public function it_doesnt_match_contains_caseless($string) /** * @test + * * @dataProvider stringMatchesContains * @dataProvider stringMatchesContainsAny * - * @param $string + * @param $string */ public function it_matches_contains_any($string) { @@ -163,10 +176,11 @@ public function it_matches_contains_any($string) /** * @test + * * @dataProvider stringMatchesContainsCaseless * @dataProvider stringMatchesContainsAnyCaseless * - * @param $string + * @param $string */ public function it_matches_contains_any_caseless($string) { @@ -175,9 +189,10 @@ public function it_matches_contains_any_caseless($string) /** * @test + * * @dataProvider stringNotContainsAny * - * @param $string + * @param $string */ public function it_doesnt_match_contains_any($string) { @@ -186,9 +201,10 @@ public function it_doesnt_match_contains_any($string) /** * @test + * * @dataProvider stringNotContainsAny * - * @param $string + * @param $string */ public function it_doesnt_match_contains_any_caseless($string) { diff --git a/tests/Services/EmojiServiceTest.php b/tests/Services/EmojiServiceTest.php index f2b07b39..23b369ef 100644 --- a/tests/Services/EmojiServiceTest.php +++ b/tests/Services/EmojiServiceTest.php @@ -18,10 +18,11 @@ protected function setUp(): void /** * @test + * * @dataProvider hasEmojiStrings * - * @param $string - * @param $string2 + * @param $string + * @param $string2 */ public function it_verifies_emoji_exist($string, $string2) { @@ -31,9 +32,10 @@ public function it_verifies_emoji_exist($string, $string2) /** * @test + * * @dataProvider doesntHaveEmojiStrings * - * @param $string + * @param $string */ public function it_verifies_emoji_doesnt_exist($string) { @@ -42,10 +44,11 @@ public function it_verifies_emoji_doesnt_exist($string) /** * @test + * * @dataProvider hasShortcodeResponse * - * @param $string - * @param $expected + * @param $string + * @param $expected */ public function it_returns_valid_emojis_as_shortcode_array($string, $expected) { @@ -54,9 +57,10 @@ public function it_returns_valid_emojis_as_shortcode_array($string, $expected) /** * @test + * * @dataProvider doesntHaveEmojiStrings * - * @param $string + * @param $string */ public function it_returns_empty_shortcode_array_if_no_valid_emojis($string) { @@ -65,10 +69,11 @@ public function it_returns_empty_shortcode_array_if_no_valid_emojis($string) /** * @test + * * @dataProvider hasSingleShortcodeResponse * - * @param $string - * @param $expected + * @param $string + * @param $expected */ public function it_returns_first_valid_emojis_as_shortcode_or_null($string, $expected) { @@ -77,10 +82,11 @@ public function it_returns_first_valid_emojis_as_shortcode_or_null($string, $exp /** * @test + * * @dataProvider stringInputs * - * @param $string - * @param $expected + * @param $string + * @param $expected */ public function converter_swaps_emojis_with_shortcode($string, $expected) { diff --git a/tests/Services/PushNotificationServiceTest.php b/tests/Services/PushNotificationServiceTest.php index 0fa6e4b0..ead018d7 100644 --- a/tests/Services/PushNotificationServiceTest.php +++ b/tests/Services/PushNotificationServiceTest.php @@ -109,7 +109,7 @@ public function it_fires_events_to_many_providers() ->push(CompanyModel::get()) ->values() ->flatten() - ) + ) ->with(self::WITH) ->notify(FakeNotifyEvent::class); @@ -180,9 +180,10 @@ public function it_rejects_duplicate_matching_providers() /** * @test + * * @dataProvider modelsWithOwner * - * @param $model + * @param $model */ public function it_notifies_ownerable_models_owner($model) { diff --git a/tests/Services/SearchProvidersServiceTest.php b/tests/Services/SearchProvidersServiceTest.php index c5b0a239..87f76227 100644 --- a/tests/Services/SearchProvidersServiceTest.php +++ b/tests/Services/SearchProvidersServiceTest.php @@ -112,10 +112,11 @@ public function it_ignores_strings_of_length_less_than_two() /** * @test + * * @dataProvider splitQueries * - * @param $query - * @param $expected + * @param $query + * @param $expected */ public function it_splits_query_by_space_or_comma_into_array($query, $expected) { @@ -126,10 +127,11 @@ public function it_splits_query_by_space_or_comma_into_array($query, $expected) /** * @test + * * @dataProvider splitQueriesDuplicates * - * @param $query - * @param $expected + * @param $query + * @param $expected */ public function it_splits_query_removes_duplicates($query, $expected) {