Completed
Push — master ( 1915ce...cbef56 )
by Biao
10:02
created

Task::delay()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
namespace Hhxsv5\LaravelS\Swoole\Task;
4
5
use Illuminate\Queue\SerializesModels;
6
7
abstract class Task
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\Task: $class, $id
Loading history...
10
    use TaskTrait;
0 ignored issues
show
introduced by
The trait Hhxsv5\LaravelS\Swoole\Task\TaskTrait requires some properties which are not provided by Hhxsv5\LaravelS\Swoole\Task\Task: $taskworker, $setting, $worker_id
Loading history...
11
12
    /**
13
     * The logic of handling task
14
     * @return void
15
     */
16
    abstract public function handle();
17
18
    /**
19
     * Deliver a task
20
     * @param Task $task The task object
21
     * @return bool
22
     */
23
    public static function deliver(Task $task)
24
    {
25
        return $task->task($task);
26
    }
27
}