Skip to content

Commit b01f3c6

Browse files
authored
Merge pull request #2 from PHPJunior/analysis-8bE9x2
Apply fixes from StyleCI
2 parents b7fab3d + 6aaa099 commit b01f3c6

28 files changed

+276
-247
lines changed

config/laravel-video-chat.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@
33
* Created by PhpStorm.
44
* User: nyinyilwin
55
* Date: 10/16/17
6-
* Time: 1:51 PM
6+
* Time: 1:51 PM.
77
*/
88

99
return [
10-
'relation' => [
11-
'conversations' => PhpJunior\LaravelVideoChat\Models\Conversation\Conversation::class,
12-
'group_conversations' => PhpJunior\LaravelVideoChat\Models\Group\Conversation\GroupConversation::class
10+
'relation' => [
11+
'conversations' => PhpJunior\LaravelVideoChat\Models\Conversation\Conversation::class,
12+
'group_conversations' => PhpJunior\LaravelVideoChat\Models\Group\Conversation\GroupConversation::class,
1313
],
1414
'user' => [
15-
'model' => App\User::class,
16-
'table' => 'users' // Existing user table name
15+
'model' => App\User::class,
16+
'table' => 'users', // Existing user table name
1717
],
1818
'table' => [
19-
'conversations_table' => 'conversations',
20-
'messages_table' => 'messages',
21-
'group_conversations_table' => 'group_conversations',
22-
'group_users_table' => 'group_users',
23-
'files_table' => 'files'
19+
'conversations_table' => 'conversations',
20+
'messages_table' => 'messages',
21+
'group_conversations_table' => 'group_conversations',
22+
'group_users_table' => 'group_users',
23+
'files_table' => 'files',
2424
],
25-
'channel' => [
26-
'new_conversation_created' => 'new-conversation-created',
27-
'chat_room' => 'chat-room',
28-
'group_chat_room' => 'group-chat-room'
25+
'channel' => [
26+
'new_conversation_created' => 'new-conversation-created',
27+
'chat_room' => 'chat-room',
28+
'group_chat_room' => 'group-chat-room',
2929
],
3030
'upload' => [
31-
'storage' => 'public'
32-
]
33-
];
31+
'storage' => 'public',
32+
],
33+
];

database/migrations/2017_10_16_084042_create_conversations_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
use Illuminate\Support\Facades\Schema;
4-
use Illuminate\Database\Schema\Blueprint;
53
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
66

77
class CreateConversationsTable extends Migration
88
{

database/migrations/2017_10_16_091956_create_messages_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
use Illuminate\Support\Facades\Schema;
4-
use Illuminate\Database\Schema\Blueprint;
53
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
66

77
class CreateMessagesTable extends Migration
88
{

database/migrations/2017_10_21_165446_create_group_conversations_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
use Illuminate\Support\Facades\Schema;
4-
use Illuminate\Database\Schema\Blueprint;
53
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
66

77
class CreateGroupConversationsTable extends Migration
88
{

database/migrations/2017_10_21_172616_create_group_users_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
use Illuminate\Support\Facades\Schema;
4-
use Illuminate\Database\Schema\Blueprint;
53
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
66

77
class CreateGroupUsersTable extends Migration
88
{

database/migrations/2017_10_25_165610_add_is_accepted_column_to_conversation_table.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
use Illuminate\Support\Facades\Schema;
4-
use Illuminate\Database\Schema\Blueprint;
53
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
66

77
class AddIsAcceptedColumnToConversationTable extends Migration
88
{
@@ -25,6 +25,5 @@ public function up()
2525
*/
2626
public function down()
2727
{
28-
2928
}
3029
}

database/migrations/2017_11_07_224816_create_files_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
use Illuminate\Support\Facades\Schema;
4-
use Illuminate\Database\Schema\Blueprint;
53
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
66

77
class CreateFilesTable extends Migration
88
{

helper/helpers.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,34 @@
33
* Created by PhpStorm.
44
* User: nyinyilwin
55
* Date: 10/19/17
6-
* Time: 4:35 AM
6+
* Time: 4:35 AM.
77
*/
8-
9-
if (! function_exists('check')) {
10-
8+
if (!function_exists('check')) {
119
function check()
1210
{
1311
$guards = array_keys(config('auth.guards'));
1412

1513
foreach ($guards as $guard) {
16-
if(auth()->guard($guard)->check()) return auth()->guard($guard);
14+
if (auth()->guard($guard)->check()) {
15+
return auth()->guard($guard);
16+
}
1717
}
1818
}
19-
2019
}
2120

22-
if (! function_exists('human_file_size')) {
23-
21+
if (!function_exists('human_file_size')) {
2422
function human_file_size($bytes, $decimals = 2)
2523
{
2624
$size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB'];
2725
$factor = floor((strlen($bytes) - 1) / 3);
28-
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$size[$factor];
26+
27+
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)).@$size[$factor];
2928
}
3029
}
3130

32-
if (! function_exists('get_file_details')) {
33-
31+
if (!function_exists('get_file_details')) {
3432
function get_file_details($path)
3533
{
3634
return app('upload.manager')->fileDetails($path);
3735
}
38-
}
36+
}

src/Events/NewConversationCreated.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
namespace PhpJunior\LaravelVideoChat\Events;
44

55
use Illuminate\Broadcasting\Channel;
6-
use Illuminate\Queue\SerializesModels;
7-
use Illuminate\Broadcasting\PrivateChannel;
8-
use Illuminate\Broadcasting\PresenceChannel;
9-
use Illuminate\Foundation\Events\Dispatchable;
106
use Illuminate\Broadcasting\InteractsWithSockets;
7+
use Illuminate\Broadcasting\PrivateChannel;
118
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
9+
use Illuminate\Foundation\Events\Dispatchable;
10+
use Illuminate\Queue\SerializesModels;
1211

1312
class NewConversationCreated implements ShouldBroadcast
1413
{

src/Events/NewConversationMessage.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
namespace PhpJunior\LaravelVideoChat\Events;
44

55
use Carbon\Carbon;
6-
use Illuminate\Broadcasting\Channel;
7-
use Illuminate\Queue\SerializesModels;
8-
use Illuminate\Broadcasting\PrivateChannel;
9-
use Illuminate\Broadcasting\PresenceChannel;
10-
use Illuminate\Foundation\Events\Dispatchable;
116
use Illuminate\Broadcasting\InteractsWithSockets;
7+
use Illuminate\Broadcasting\PresenceChannel;
128
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
9+
use Illuminate\Foundation\Events\Dispatchable;
10+
use Illuminate\Queue\SerializesModels;
1311

1412
class NewConversationMessage implements ShouldBroadcast
1513
{
@@ -34,7 +32,7 @@ class NewConversationMessage implements ShouldBroadcast
3432
* @param $channel
3533
* @param array $files
3634
*/
37-
public function __construct($text , $channel , $files = [])
35+
public function __construct($text, $channel, $files = [])
3836
{
3937
$this->text = $text;
4038
$this->channel = $channel;
@@ -54,10 +52,10 @@ public function broadcastOn()
5452
public function broadcastWith()
5553
{
5654
return [
57-
'text' => $this->text,
58-
'sender' => check()->user(),
59-
'files' => $this->files,
60-
'created_at' => Carbon::now()->format('Y-m-d H:i:s')
55+
'text' => $this->text,
56+
'sender' => check()->user(),
57+
'files' => $this->files,
58+
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
6159
];
6260
}
6361
}

0 commit comments

Comments
 (0)