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

PreOrderController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 27
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A modelClassName() 0 4 1
A actions() 0 13 1
A getStates() 0 4 1
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