AbstractMenu   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
run() 0 1 ?
A widget() 0 4 1
A create() 0 6 1
1
<?php
2
/**
3
 * Pluggable themes for Yii2
4
 *
5
 * @link      https://github.com/hiqdev/yii2-thememanager
6
 * @package   yii2-thememanager
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\thememanager\menus;
12
13
use Yii;
14
15
/**
16
 * Abstract Menu.
17
 *
18
 * @author Andrii Vasyliev <[email protected]>
19
 */
20
abstract class AbstractMenu implements MenuInterface
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public static function widget($menuConfig = [], $widgetConfig = [])
26
    {
27
        return static::create($menuConfig)->run($widgetConfig);
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public static function create($config = [])
34
    {
35
        $config['class'] = get_called_class();
36
37
        return Yii::createObject($config);
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    abstract public function run($config = []);
44
}
45