diff --git a/.travis.yml b/.travis.yml index 72b8f934..8396fbdc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,4 +14,4 @@ before_install: install: composer update --prefer-source --no-interaction --dev -script: vendor/bin/phpunit --testdox +script: composer test diff --git a/composer.json b/composer.json index b15fa7be..a2fa6bb2 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,8 @@ "require-dev": { "phpunit/phpunit": "^8.0|^9.0", "orchestra/testbench": "^7.0", - "mockery/mockery": "^1.0.0" + "mockery/mockery": "^1.0.0", + "phpstan/phpstan": "^1.9" }, "license": "MIT", "authors": [ @@ -42,7 +43,12 @@ ] }, "scripts": { - "test": "phpunit" + "test:unit": "phpunit", + "test:analyse": "vendor/bin/phpstan analyse src --memory-limit=2G --ansi", + "test": [ + "@test:analyse", + "@test:unit" + ] }, "extra": { "laravel": { diff --git a/src/Http/Controllers/ConversationController.php b/src/Http/Controllers/ConversationController.php index 891eec9d..5882a978 100644 --- a/src/Http/Controllers/ConversationController.php +++ b/src/Http/Controllers/ConversationController.php @@ -2,11 +2,11 @@ namespace Musonza\Chat\Http\Controllers; -use Chat; use Exception; use Illuminate\Contracts\Routing\ResponseFactory; use Illuminate\Http\Response; use Musonza\Chat\Exceptions\DeletingConversationWithParticipantsException; +use Musonza\Chat\Facades\ChatFacade as Chat; use Musonza\Chat\Http\Requests\DestroyConversation; use Musonza\Chat\Http\Requests\StoreConversation; use Musonza\Chat\Http\Requests\UpdateConversation; diff --git a/src/Http/Controllers/ConversationMessageController.php b/src/Http/Controllers/ConversationMessageController.php index 1de7dae7..8007cc57 100644 --- a/src/Http/Controllers/ConversationMessageController.php +++ b/src/Http/Controllers/ConversationMessageController.php @@ -2,7 +2,7 @@ namespace Musonza\Chat\Http\Controllers; -use Chat; +use Musonza\Chat\Facades\ChatFacade as Chat; use Musonza\Chat\Http\Requests\ClearConversation; use Musonza\Chat\Http\Requests\DeleteMessage; use Musonza\Chat\Http\Requests\GetParticipantMessages; diff --git a/src/Http/Controllers/ConversationParticipationController.php b/src/Http/Controllers/ConversationParticipationController.php index 393878fd..aa9a8dde 100644 --- a/src/Http/Controllers/ConversationParticipationController.php +++ b/src/Http/Controllers/ConversationParticipationController.php @@ -2,7 +2,7 @@ namespace Musonza\Chat\Http\Controllers; -use Chat; +use Musonza\Chat\Facades\ChatFacade as Chat; use Musonza\Chat\Http\Requests\StoreParticipation; use Musonza\Chat\Http\Requests\UpdateParticipation; use Musonza\Chat\Models\Conversation; diff --git a/src/Http/routes.php b/src/Http/routes.php index 1039691d..65d547f6 100644 --- a/src/Http/routes.php +++ b/src/Http/routes.php @@ -1,5 +1,7 @@ conversation = $conversation; $this->body = $body; diff --git a/src/Models/Conversation.php b/src/Models/Conversation.php index 56ab2191..9ced18d4 100644 --- a/src/Models/Conversation.php +++ b/src/Models/Conversation.php @@ -2,7 +2,6 @@ namespace Musonza\Chat\Models; -use Chat; use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; @@ -17,6 +16,7 @@ use Musonza\Chat\Exceptions\DeletingConversationWithParticipantsException; use Musonza\Chat\Exceptions\DirectMessagingExistsException; use Musonza\Chat\Exceptions\InvalidDirectMessageNumberOfParticipants; +use Musonza\Chat\Facades\ChatFacade as Chat; class Conversation extends BaseModel { diff --git a/src/Notifications/MessageSent.php b/src/Notifications/MessageSent.php index 7fd1ed98..db74534b 100644 --- a/src/Notifications/MessageSent.php +++ b/src/Notifications/MessageSent.php @@ -9,6 +9,8 @@ class MessageSent extends Notification { use Queueable; + private $data; + /** * Create a new notification instance. *