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

Event::fire()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
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
}