Completed
Push — master ( 5b2a1a...c2fb62 )
by Andrii
02:13
created

AbstractMenu::create()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
ccs 0
cts 0
cp 0
rs 9.4285
cc 3
eloc 4
nc 2
nop 1
crap 12
1
<?php
2
3
namespace hiqdev\thememanager\menus;
4
5
use Yii;
6
7
/**
8
 * Abstract Menu.
9
 *
10
 * @author Andrii Vasyliev <[email protected]>
11
 */
12
abstract class AbstractMenu implements MenuInterface
13
{
14
    /**
15
     * @inheritdoc
16
     */
17
    public static function create($config = [])
18
    {
19
        if (is_array($config) && empty($config['class'])) {
20
            $config['class'] = get_called_class();
21
        }
22
23
        return Yii::createObject($config);
24
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29
    abstract public function render($options = []);
30
}
31