Code Duplication    Length = 13-28 lines in 4 locations

components/ItemController.php 1 location

@@ 29-41 (lines=13) @@
26
    /**
27
     * @inheritdoc
28
     */
29
    public function behaviors()
30
    {
31
        return [
32
            'verbs' => [
33
                'class' => VerbFilter::className(),
34
                'actions' => [
35
                    'delete' => ['post'],
36
                    'assign' => ['post'],
37
                    'remove' => ['post'],
38
                ],
39
            ],
40
        ];
41
    }
42
43
    /**
44
     * Lists all AuthItem models.

controllers/AssignmentController.php 1 location

@@ 42-54 (lines=13) @@
39
    /**
40
     * @inheritdoc
41
     */
42
    public function behaviors()
43
    {
44
        return [
45
            'verbs' => [
46
                'class' => VerbFilter::className(),
47
                'actions' => [
48
                    'assign' => ['post'],
49
                    'assign' => ['post'],
50
                    'revoke' => ['post'],
51
                ],
52
            ],
53
        ];
54
    }
55
56
    /**
57
     * Lists all Assignment models.

controllers/RouteController.php 1 location

@@ 18-31 (lines=14) @@
15
 */
16
class RouteController extends Controller
17
{
18
    public function behaviors()
19
    {
20
        return [
21
            'verbs' => [
22
                'class' => VerbFilter::className(),
23
                'actions' => [
24
                    'create' => ['post'],
25
                    'assign' => ['post'],
26
                    'remove' => ['post'],
27
                    'refresh' => ['post'],
28
                ],
29
            ],
30
        ];
31
    }
32
    /**
33
     * Lists all Route models.
34
     * @return mixed

controllers/UserController.php 1 location

@@ 31-58 (lines=28) @@
28
    /**
29
     * @inheritdoc
30
     */
31
    public function behaviors()
32
    {
33
        return [
34
            'verbs' => [
35
                'class' => VerbFilter::className(),
36
                'actions' => [
37
                    'delete' => ['post'],
38
                    'logout' => ['post'],
39
                    'activate' => ['post'],
40
                ],
41
            ],
42
        ];
43
    }
44
45
    /**
46
     * @inheritdoc
47
     */
48
    public function beforeAction($action)
49
    {
50
        if (parent::beforeAction($action)) {
51
            if (Yii::$app->has('mailer') && ($mailer = Yii::$app->getMailer()) instanceof BaseMailer) {
52
                /* @var $mailer BaseMailer */
53
                $this->_oldMailPath = $mailer->getViewPath();
54
                $mailer->setViewPath('@mdm/admin/mail');
55
            }
56
            return true;
57
        }
58
        return false;
59
    }
60
61
    /**