Passed
Push — master ( dd7671...d14ff5 )
by Biao
04:00
created

Event   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 27
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getListeners() 0 3 1
A fire() 0 3 1
1
<?php
2
3
namespace Hhxsv5\LaravelS\Swoole\Task;
4
5
use Illuminate\Queue\SerializesModels;
6
7
abstract class Event extends BaseTask
8
{
9
    use SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by Hhxsv5\LaravelS\Swoole\Task\Event: $class, $id
Loading history...
10
11
    /**
12
     * The listeners for this event.
13
     * @return array
14
     */
15
    protected $listeners = [];
16
17
    /**
18
     * Get the listener list for this event.
19
     * @return array
20
     */
21
    public function getListeners()
22
    {
23
        return $this->listeners;
24
    }
25
26
    /**
27
     * Trigger an event
28
     * @param Event $event
29
     * @return bool
30
     */
31
    public static function fire(self $event)
32
    {
33
        return $event->task($event);
34
    }
35
}