Code Duplication    Length = 23-23 lines in 2 locations

src/controllers/SiteController.php 1 location

@@ 18-40 (lines=23) @@
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function behaviors()
19
    {
20
        return [
21
            'access' => [
22
                'class' => AccessControl::className(),
23
                'rules' => [
24
                    [
25
                        'allow' => true,
26
                        'actions' => ['error'],
27
                    ],
28
                    [
29
                        'allow' => true,
30
                        'matchCallback' => function ($rule, $action) {
31
                            return \Yii::$app->user->can(
32
                                $this->module->id.'_'.$this->id.'_'.$action->id,
33
                                ['route' => true]
34
                            );
35
                        },
36
                    ],
37
                ],
38
            ],
39
        ];
40
    }
41
42
    /**
43
     * {@inheritdoc}

src/modules/backend/controllers/DefaultController.php 1 location

@@ 19-41 (lines=23) @@
16
    /**
17
     * {@inheritdoc}
18
     */
19
    public function behaviors()
20
    {
21
        return [
22
            'access' => [
23
                'class' => AccessControl::className(),
24
                'rules' => [
25
                    [
26
                        'allow' => true,
27
                        'actions' => ['error'],
28
                    ],
29
                    [
30
                        'allow' => true,
31
                        'matchCallback' => function ($rule, $action) {
32
                            return \Yii::$app->user->can(
33
                                $this->module->id.'_'.$this->id.'_'.$action->id,
34
                                ['route' => true]
35
                            );
36
                        },
37
                    ],
38
                ],
39
            ],
40
        ];
41
    }
42
43
    /**
44
     * Actions defined in classes, eg. error page.