GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ActionColumn::initDefaultButtons()   A
last analyzed

Complexity

Conditions 4
Paths 8

Size

Total Lines 41

Duplication

Lines 24
Ratio 58.54 %

Importance

Changes 0
Metric Value
dl 24
loc 41
rs 9.264
c 0
b 0
f 0
cc 4
nc 8
nop 0
1
<?php
2
3
namespace app\components;
4
5
use kartik\icons\Icon;
6
use Yii;
7
use yii\helpers\Html;
8
9
class ActionColumn extends \yii\grid\ActionColumn
10
{
11
    /**
12
    * Initializes the default button rendering callbacks
13
    */
14
    protected function initDefaultButtons()
15
    {
16 View Code Duplication
        if (!isset($this->buttons['view'])) {
17
            $this->buttons['view'] = function ($url, $model) {
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
18
                return Html::a(
19
                    Icon::show('eye', ['class' => 'fa-lg'], Icon::FA),
20
                    $url,
21
                    [
22
                        'title' => \Yii::t('yii', 'View'),
23
                        'data-pjax' => '0',
24
                    ]
25
                );
26
            };
27
        }
28 View Code Duplication
        if (!isset($this->buttons['update'])) {
29
            $this->buttons['update'] = function ($url, $model) {
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
30
                return Html::a(
31
                    Icon::show('edit', ['class' => 'fa-lg'], Icon::FA),
32
                    $url,
33
                    [
34
                        'title' => \Yii::t('yii', 'Update'),
35
                        'data-pjax' => '0',
36
                    ]
37
                );
38
            };
39
        }
40
        if (!isset($this->buttons['delete'])) {
41
            $this->buttons['delete'] = function ($url, $model) {
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
42
                return Html::a(
43
                    Icon::show('trash-o', ['class' => 'fa-lg'], Icon::FA),
44
                    $url,
45
                    [
46
                        'title' => \Yii::t('yii', 'Delete'),
47
                        'data-confirm' => \Yii::t('yii', 'Are you sure to delete this item?'),
48
                        'data-method' => 'post',
49
                        'data-pjax' => '0',
50
                    ]
51
                );
52
            };
53
        }
54
    }
55
}
56