Completed
Push — master ( f4448b...10e7e3 )
by Vuong
01:40
created

TaskRunnerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 6 1
A run() 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\test\unit\async;
9
10
use Yii;
11
12
use vxm\async\Task;
13
14
/**
15
 * Class TaskRunnerTest
16
 *
17
 * @author Vuong Minh <[email protected]>
18
 * @since 1.0.0
19
 */
20
class TaskRunnerTest extends Task
21
{
22
    /**
23
     * @var \yii\web\Request
24
     */
25
    public $request;
26
27
    /**
28
     * @inheritDoc
29
     */
30
    public function init()
31
    {
32
        $this->request = Yii::$app->getRequest();
33
34
        parent::init();
35
    }
36
37
    public function run()
38
    {
39
        return get_class($this->request) === 'yii\console\Request';
40
    }
41
}
42