Completed
Push — master ( 72b2e1...1d671f )
by Dmitry
13:59
created

PreOrderController::actions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 13
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
namespace hipanel\modules\server\controllers;
4
5
use hipanel\actions\IndexAction;
6
use hipanel\base\CrudController;
7
use hipanel\modules\server\models\Change;
8
use Yii;
9
10
class PreOrderController extends CrudController
11
{
12
    public static function modelClassName()
13
    {
14
        return Change::class;
15
    }
16
17
    public function actions()
18
    {
19
        return [
20
            'index' => [
21
                'class' => IndexAction::class,
22
                'data' => function ($action) {
23
                    return [
24
                        'states' => $action->controller->getStates(),
25
                    ];
26
                },
27
            ],
28
        ];
29
    }
30
31
    public function getStates()
32
    {
33
        return $this->getRefs('state,change', [], 'hipanel/server');
0 ignored issues
show
Unused Code introduced by
The call to PreOrderController::getRefs() has too many arguments starting with array().

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
34
    }
35
36
}
37