LikeDislikePush::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace App\Events;
4
5
use App\LikeDislike;
6
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
7
use Illuminate\Queue\SerializesModels;
8
9
/**
10
 * Class LikeDislikePush.
11
 */
12
class LikeDislikePush extends Event implements ShouldBroadcast
13
{
14
    use SerializesModels;
15
16
    /**
17
     * @var LikeDislike
18
     */
19
    public $likeDislike;
20
21
    /**
22
     * LikeDislikePush constructor.
23
     *
24
     * @param LikeDislike $likeDislike
25
     */
26 3
    public function __construct(LikeDislike $likeDislike)
27
    {
28 3
        $this->likeDislike = $likeDislike;
29 3
    }
30
31
    /**
32
     * Get the channels the event should be broadcast on.
33
     *
34
     * @return array
35
     */
36 3
    public function broadcastOn()
37
    {
38 3
        return ['likedislike-push'];
39
    }
40
}
41