PaymentEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A broadcastOn() 0 4 1
1
<?php
2
3
namespace SanderVanHooft\PayableRedirect\Events;
4
5
use SanderVanHooft\PayableRedirect\Payment;
6
use Illuminate\Broadcasting\Channel;
7
use Illuminate\Broadcasting\InteractsWithSockets;
8
use Illuminate\Broadcasting\PresenceChannel;
9
use Illuminate\Broadcasting\PrivateChannel;
10
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
11
use Illuminate\Foundation\Events\Dispatchable;
12
use Illuminate\Queue\SerializesModels;
13
14
class PaymentEvent
15
{
16
    use Dispatchable, InteractsWithSockets, SerializesModels;
17
18
    public $payment;
19
20
    /**
21
     * Create a new event instance.
22
     *
23
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
24
     */
25
    public function __construct(Payment $payment)
26
    {
27
        $this->payment = $payment;
28
    }
29
30
    /**
31
     * Get the channels the event should broadcast on.
32
     *
33
     * @return Channel|array
34
     */
35
    public function broadcastOn()
36
    {
37
        return new PrivateChannel('channel-name');
38
    }
39
}
40