TicketOpenEvent::broadcastOn()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
4
namespace RexlManu\LaravelTickets\Events;
5
6
7
use Illuminate\Broadcasting\Channel;
8
use Illuminate\Broadcasting\InteractsWithSockets;
9
use Illuminate\Broadcasting\PresenceChannel;
10
use Illuminate\Broadcasting\PrivateChannel;
11
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
12
use Illuminate\Foundation\Events\Dispatchable;
13
use Illuminate\Queue\SerializesModels;
14
use RexlManu\LaravelTickets\Models\Ticket;
15
16
/**
17
 * Class TicketOpenEvent
18
 *
19
 * Fired when a ticket is created
20
 *
21
 * @package RexlManu\LaravelTickets\Events
22
 */
23 View Code Duplication
class TicketOpenEvent
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
24
{
25
    use Dispatchable, InteractsWithSockets, SerializesModels;
26
27
    public $ticket;
28
29
    /**
30
     * Create a new event instance.
31
     */
32
    public function __construct(Ticket $ticket)
33
    {
34
        $this->ticket = $ticket;
35
    }
36
37
    /**
38
     * Get the channels the event should broadcast on.
39
     *
40
     * @return \Illuminate\Broadcasting\Channel|array
41
     */
42
    public function broadcastOn()
43
    {
44
        return new PrivateChannel('ticket-open');
45
    }
46
}
47