BroadcastServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 11 1
1
<?php
2
3
namespace Colligator\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use Illuminate\Support\Facades\Broadcast;
7
8
class BroadcastServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap any application services.
12
     *
13
     * @return void
14
     */
15
    public function boot()
16
    {
17
        Broadcast::routes();
18
19
        /*
20
         * Authenticate the user's personal channel...
21
         */
22
        Broadcast::channel('Colligator.User.{userId}', function ($user, $userId) {
23
            return (int) $user->id === (int) $userId;
24
        });
25
    }
26
}