Completed
Push — master ( 4fbc1b...ef5514 )
by Andrii
03:11
created

LogoLink   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 13 2
1
<?php
2
3
/*
4
 * Theme Manager for Yii2
5
 *
6
 * @link      https://github.com/hiqdev/yii2-thememanager
7
 * @package   yii2-thememanager
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hiqdev\thememanager\widgets;
13
14
use Yii;
15
use yii\base\Widget;
16
use yii\base\NotSupportedException;
17
18
/**
19
 * LogoLink widget.
20
 */
21
class LogoLink extends Widget
22
{
23
    /**
24
     * @var array html options.
25
     */
26
    public $options = [];
27
28
    /**
29
     * @var string url to image.
30
     */
31
    public $image;
32
33
    /**
34
     * @var string text to display.
35
     */
36
    public $name;
37
38
    /**
39
     * @var array|string text to display.
40
     */
41
    public $url;
42
43
    public function run()
44
    {
45
        if (!empty($this->image)) {
46
            throw new NotSupportedException('logo image is not implemented yet');
47
        }
48
49
        return $this->render('LogoLink', [
50
            'image'   => $this->image,
51
            'name'    => $this->name,
52
            'url'     => $this->url,
53
            'options' => $this->options,
54
        ]);
55
    }
56
}
57