Skip to content

Commit 6f119d8

Browse files
authored
Merge pull request #345 from musonza/fix/issue-320-335
Fix getParticipation and add getParticipantDetails to Messageable trait
2 parents adf2474 + d15370c commit 6f119d8

37 files changed

+280
-159
lines changed

src/Chat.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(
3232
ConversationService $conversationService,
3333
MessageNotification $messageNotification
3434
) {
35-
$this->messageService = $messageService;
35+
$this->messageService = $messageService;
3636
$this->conversationService = $conversationService;
3737
$this->messageNotification = $messageNotification;
3838
}
@@ -64,7 +64,8 @@ public function makeDirect()
6464
/**
6565
* Sets message.
6666
*
67-
* @param string $message
67+
* @param string $message
68+
*
6869
* @return MessageService
6970
*/
7071
public function message($message)
@@ -132,6 +133,6 @@ public static function senderFieldsWhitelist()
132133
{
133134
$fields = config('musonza_chat.sender_fields_whitelist', []);
134135

135-
return (is_array($fields) && ! empty($fields)) ? $fields : null;
136+
return (is_array($fields) && !empty($fields)) ? $fields : null;
136137
}
137138
}

src/ChatServiceProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function boot()
2424
$this->publishConfig();
2525

2626
if (config('musonza_chat.should_load_routes')) {
27-
require __DIR__ . '/Http/routes.php';
27+
require __DIR__.'/Http/routes.php';
2828
}
2929
}
3030

@@ -35,7 +35,7 @@ public function boot()
3535
*/
3636
public function register()
3737
{
38-
$this->mergeConfigFrom(__DIR__ . '/../config/musonza_chat.php', 'musonza_chat');
38+
$this->mergeConfigFrom(__DIR__.'/../config/musonza_chat.php', 'musonza_chat');
3939
$this->registerChat();
4040
}
4141

@@ -59,8 +59,8 @@ private function registerChat()
5959
public function publishMigrations()
6060
{
6161
$timestamp = date('Y_m_d_His', time());
62-
$stub = __DIR__ . '/../database/migrations/create_chat_tables.php';
63-
$target = $this->app->databasePath() . '/migrations/' . $timestamp . '_create_chat_tables.php';
62+
$stub = __DIR__.'/../database/migrations/create_chat_tables.php';
63+
$target = $this->app->databasePath().'/migrations/'.$timestamp.'_create_chat_tables.php';
6464

6565
$this->publishes([$stub => $target], 'chat.migrations');
6666
}
@@ -73,7 +73,7 @@ public function publishMigrations()
7373
public function publishConfig()
7474
{
7575
$this->publishes([
76-
__DIR__ . '/../config' => config_path(),
76+
__DIR__.'/../config' => config_path(),
7777
], 'chat.config');
7878
}
7979
}

src/Commanding/CommandBus.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ class CommandBus
1414
public function __construct(Application $app, CommandTranslator $commandTranslator)
1515
{
1616
$this->commandTranslator = $commandTranslator;
17-
$this->app = $app;
17+
$this->app = $app;
1818
}
1919

2020
/**
21-
* @return mixed
22-
*
2321
* @throws Exception
22+
*
23+
* @return mixed
2424
*/
2525
public function execute($command)
2626
{

src/Commanding/CommandTranslator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public function toCommandHandler($command)
1010
{
1111
$handler = str_replace('Command', 'CommandHandler', get_class($command));
1212

13-
if (! class_exists($handler)) {
13+
if (!class_exists($handler)) {
1414
$message = "Command handler [$handler] does not exist.";
1515

1616
throw new Exception($message);

src/ConfigurationManager.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public static function paginationDefaultParameters()
1717
$pagination = config('musonza_chat.pagination', []);
1818

1919
return [
20-
'page' => $pagination['page'] ?? 1,
21-
'perPage' => $pagination['perPage'] ?? 25,
22-
'sorting' => $pagination['sorting'] ?? 'asc',
23-
'columns' => $pagination['columns'] ?? ['*'],
20+
'page' => $pagination['page'] ?? 1,
21+
'perPage' => $pagination['perPage'] ?? 25,
22+
'sorting' => $pagination['sorting'] ?? 'asc',
23+
'columns' => $pagination['columns'] ?? ['*'],
2424
'pageName' => $pagination['pageName'] ?? 'page',
2525
];
2626
}

src/Eventing/Event.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
namespace Musonza\Chat\Eventing;
44

5-
class Event {}
5+
class Event
6+
{
7+
}

src/Eventing/MessageWasSent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(Message $message)
3030
*/
3131
public function broadcastOn()
3232
{
33-
return new PrivateChannel('mc-chat-conversation.' . $this->message->conversation_id);
33+
return new PrivateChannel('mc-chat-conversation.'.$this->message->conversation_id);
3434
}
3535

3636
public function broadcastWith()

src/Exceptions/DeletingConversationWithParticipantsException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44

55
use Exception;
66

7-
class DeletingConversationWithParticipantsException extends Exception {}
7+
class DeletingConversationWithParticipantsException extends Exception
8+
{
9+
}

src/Exceptions/DirectMessagingExistsException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44

55
use Exception;
66

7-
class DirectMessagingExistsException extends Exception {}
7+
class DirectMessagingExistsException extends Exception
8+
{
9+
}

src/Exceptions/InvalidDirectMessageNumberOfParticipants.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44

55
use Exception;
66

7-
class InvalidDirectMessageNumberOfParticipants extends Exception {}
7+
class InvalidDirectMessageNumberOfParticipants extends Exception
8+
{
9+
}

0 commit comments

Comments
 (0)