ImportFailed   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A broadcastOn() 0 3 1
1
<?php
2
3
namespace App\Events;
4
5
use App\Models\Import;
6
use Illuminate\Broadcasting\Channel;
7
use Illuminate\Broadcasting\InteractsWithSockets;
8
use Illuminate\Broadcasting\PrivateChannel;
9
use Illuminate\Foundation\Events\Dispatchable;
10
use Illuminate\Queue\SerializesModels;
11
12
class ImportFailed
13
{
14
    use Dispatchable, InteractsWithSockets, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Events\ImportFailed: $id, $class, $connection
Loading history...
15
    /**
16
     * @var Import
17
     */
18
    public $import;
19
    /**
20
     * @var \Exception
21
     */
22
    public $exception;
23
24
    /**
25
     * Create a new event instance.
26
     *
27
     * @return void
28
     */
29
    public function __construct(Import $import, \Exception $exception)
30
    {
31
        $this->import    = $import;
32
        $this->exception = $exception;
33
    }
34
35
    /**
36
     * Get the channels the event should broadcast on.
37
     *
38
     * @return \Illuminate\Broadcasting\Channel|array
39
     */
40
    public function broadcastOn()
41
    {
42
        return new PrivateChannel('channel-name');
43
    }
44
}
45