Task   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 22
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
run() 0 1 ?
A __invoke() 0 4 1
1
<?php
2
/**
3
 * @link https://github.com/vuongxuongminh/yii2-async
4
 * @copyright Copyright (c) 2019 Vuong Xuong Minh
5
 * @license [New BSD License](http://www.opensource.org/licenses/bsd-license.php)
6
 */
7
8
namespace vxm\async;
9
10
use yii\base\BaseObject;
11
12
/**
13
 * Async task executable.
14
 *
15
 * @author Vuong Minh <[email protected]>
16
 * @since 1.0.0
17
 */
18
abstract class Task extends BaseObject
19
{
20
21
    /**
22
     * Task executable.
23
     *
24
     * @return mixed
25
     */
26
    abstract public function run();
27
28
    /**
29
     * Magic call in child runtime process.
30
     *
31
     * @return mixed result of this task.
32
     * @see [[run()]]
33
     */
34
    public function __invoke()
35
    {
36
        return $this->run();
37
    }
38
39
}
40