Completed
Push — master ( 04ceba...2dddc8 )
by Andrii
03:10
created

Command::getHandler()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
ccs 0
cts 7
cp 0
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
crap 6
1
<?php
2
/**
3
 * HiAPI Yii2 base project for building API
4
 *
5
 * @link      https://github.com/hiqdev/hiapi
6
 * @package   hiapi
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiapi\commands;
12
13
use Yii;
14
15
class Command extends \yii\base\Model
16
{
17
    protected static $handler;
18
19
    public static function getHandler()
20
    {
21
        if (!is_object(static::$handler)) {
22
            static::$handler = Yii::createObject(static::$handler);
23
        }
24
25
        return static::$handler;
26
    }
27
}
28