CandidateDeleted::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
namespace App\Events;
4
5
use App\Models\Candidate;
6
use Illuminate\Broadcasting\InteractsWithSockets;
7
use Illuminate\Broadcasting\PrivateChannel;
8
use Illuminate\Foundation\Events\Dispatchable;
9
use Illuminate\Queue\SerializesModels;
10
11
class CandidateDeleted
12
{
13
    use Dispatchable;
14
    use InteractsWithSockets;
15
    use SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Events\CandidateDeleted: $id, $relations, $class, $connection, $keyBy
Loading history...
16
17
    /**
18
     * @var Candidate
19
     */
20
    public $candidate;
21
22
    public $emailAddress;
23
24
    /**
25
     * Create a new event instance.
26
     *
27
     * @param Candidate $candidate
28
     * @param $emailAddress
29
     */
30
    public function __construct(Candidate $candidate, $emailAddress)
31
    {
32
        $this->candidate = $candidate;
33
        $this->emailAddress = $emailAddress;
34
    }
35
36
    /**
37
     * Get the channels the event should broadcast on.
38
     *
39
     * @return \Illuminate\Broadcasting\Channel|array
40
     */
41
    public function broadcastOn()
42
    {
43
        return new PrivateChannel('channel-name');
44
    }
45
}
46