ProfileController::actionView()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
nc 2
nop 1
dl 0
loc 7
c 0
b 0
f 0
cc 2
rs 10
1
<?php
2
3
namespace app\controllers\admin;
4
5
use app\traits\{AdminBeforeActionTrait, AccessTrait};
6
use Itstructure\RbacModule\controllers\ProfileController as BaseProfileController;
7
8
/**
9
 * Class ProfileController
10
 * ProfileController implements the CRUD actions for identityClass.
11
 *
12
 * @package app\controllers\admin
13
 *
14
 * @author Andrey Girnik <[email protected]>
15
 */
16
class ProfileController extends BaseProfileController
17
{
18
    use AdminBeforeActionTrait, AccessTrait;
0 ignored issues
show
Bug introduced by
The trait app\traits\AdminBeforeActionTrait requires the property $controller which is not provided by app\controllers\admin\ProfileController.
Loading history...
Bug introduced by
The trait app\traits\AccessTrait requires the property $user which is not provided by app\controllers\admin\ProfileController.
Loading history...
19
20
    /**
21
     * @return mixed|string
22
     */
23
    public function actionIndex()
24
    {
25
        if (!$this->checkAccessToIndex()) {
26
            return $this->accessError();
27
        }
28
29
        return parent::actionIndex();
30
    }
31
32
    /**
33
     * @param int|string $id
34
     *
35
     * @return mixed
36
     */
37
    public function actionView($id)
38
    {
39
        if (!$this->checkAccessToView()) {
40
            return $this->accessError();
41
        }
42
43
        return parent::actionView($id);
44
    }
45
46
    /**
47
     * @param int|string $id
48
     *
49
     * @return string|\yii\web\Response
50
     */
51
    public function actionUpdate($id)
52
    {
53
        if (!$this->checkAccessToUpdate()) {
54
            return $this->accessError();
55
        }
56
57
        return parent::actionUpdate($id);
58
    }
59
60
    /**
61
     * @param int|string $id
62
     *
63
     * @return mixed|\yii\web\Response
64
     */
65
    public function actionDelete($id)
66
    {
67
        if (!$this->checkAccessToDelete()) {
68
            return $this->accessError();
69
        }
70
71
        return parent::actionDelete($id);
72
    }
73
}
74