Like   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefaultOptions() 0 4 1
A getDefaultButtonOptions() 0 5 1
1
<?php
2
3
namespace hauntd\vote\widgets;
4
5
use Yii;
6
use yii\bootstrap\Html;
7
8
/**
9
 * @author Alexander Kononenko <[email protected]>
10
 * @package hauntd\vote\widgets
11
 */
12
class Like extends VoteToggle
13
{
14
    /**
15
     * @var string
16
     */
17
    public $jsCodeKey = 'vote-like';
18
19
    /**
20
     * @return array
21
     */
22
    public function getDefaultOptions()
23
    {
24
        return array_merge(parent::getDefaultOptions(), [
25
            'class' => 'vote-toggle vote-toggle-like',
26
        ]);
27
    }
28
29
    /**
30
     * @return array
31
     */
32
    public function getDefaultButtonOptions()
33
    {
34
        return array_merge(parent::getDefaultButtonOptions(), [
35
            'icon' => Html::icon('glyphicon glyphicon-heart'),
36
            'label' => Yii::t('vote', 'Like'),
37
        ]);
38
    }
39
}
40