Passed
Push — master ( fae9c8...c0c67a )
by Adam
08:58
created

MicroblogVoted   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 26
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 1 1
A broadcastWith() 0 3 1
A broadcastAs() 0 3 1
A broadcastOn() 0 3 1
1
<?php
2
3
namespace Coyote\Events;
4
5
use Illuminate\Broadcasting\Channel;
6
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
7
8
class MicroblogVoted implements ShouldBroadcast
9
{
10
    public function __construct(public $payload) { }
11
12
    /**
13
     * @return Channel|Channel[]
14
     */
15
    public function broadcastOn()
16
    {
17
        return new Channel('microblog');
18
    }
19
20
    /**
21
     * @return array
22
     */
23
    public function broadcastWith()
24
    {
25
        return $this->payload;
26
    }
27
28
    /**
29
     * @return string
30
     */
31
    public function broadcastAs()
32
    {
33
        return class_basename(static::class);
34
    }
35
}
36