TelegramNotification   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
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
/*
4
 * rmarchiv.tk
5
 * (c) 2016-2017 by Marcel 'ryg' Hering
6
 */
7
8
namespace App\Events;
9
10
use Illuminate\Broadcasting\Channel;
11
use Illuminate\Queue\SerializesModels;
12
use Illuminate\Broadcasting\PrivateChannel;
13
use Illuminate\Broadcasting\InteractsWithSockets;
14
15
class TelegramNotification
16
{
17
    use InteractsWithSockets, SerializesModels;
18
19
    public $content;
20
21
    /**
22
     * Create a new event instance.
23
     *
24
     * @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...
25
     */
26
    public function __construct($content)
27
    {
28
        $this->content = $content;
29
    }
30
31
    /**
32
     * Get the channels the event should broadcast on.
33
     *
34
     * @return Channel|array
35
     */
36
    public function broadcastOn()
37
    {
38
        return new PrivateChannel('channel-name');
39
    }
40
}
41