1 | <?php |
||
25 | class DefaultController extends Controller |
||
26 | { |
||
27 | /** |
||
28 | * Defines the controller behaviors |
||
29 | * @return array |
||
30 | */ |
||
31 | public function behaviors() |
||
32 | { |
||
33 | return [ |
||
34 | 'verbs' => [ |
||
35 | 'class' => VerbFilter::className(), |
||
36 | 'actions' => [ |
||
37 | 'delete' => ['post'], |
||
38 | ], |
||
39 | ], |
||
40 | 'access' => [ |
||
41 | 'class' => AccessControl::className(), |
||
42 | 'rules' => [ |
||
43 | [ |
||
44 | 'allow' => true, |
||
45 | 'roles' => $this->module->accessRoles, |
||
46 | ], |
||
47 | ], |
||
48 | ], |
||
49 | ]; |
||
50 | } |
||
51 | |||
52 | public function actions() |
||
62 | |||
63 | /** |
||
64 | * Lists all Settings. |
||
65 | * @return mixed |
||
66 | */ |
||
67 | public function actionIndex() |
||
80 | |||
81 | /** |
||
82 | * Displays the details of a single Setting. |
||
83 | * @param integer $id |
||
84 | * @return mixed |
||
85 | */ |
||
86 | public function actionView($id) |
||
95 | |||
96 | /** |
||
97 | * Creates a new Setting. |
||
98 | * If creation is successful, the browser will be redirected to the 'view' page. |
||
99 | * @return mixed |
||
100 | */ |
||
101 | public function actionCreate() |
||
116 | |||
117 | /** |
||
118 | * Updates an existing Setting. |
||
119 | * If update is successful, the browser will be redirected to the 'view' page. |
||
120 | * @param integer $id |
||
121 | * @return mixed |
||
122 | */ |
||
123 | public function actionUpdate($id) |
||
138 | |||
139 | /** |
||
140 | * Deletes an existing Setting. |
||
141 | * If deletion is successful, the browser will be redirected to the 'index' page. |
||
142 | * @param integer $id |
||
143 | * @return mixed |
||
144 | */ |
||
145 | public function actionDelete($id) |
||
152 | |||
153 | /** |
||
154 | * Finds a Setting model based on its primary key value. |
||
155 | * If the model is not found, a 404 HTTP exception will be thrown. |
||
156 | * @param integer $id |
||
157 | * @return Setting the loaded model |
||
158 | * @throws NotFoundHttpException if the model cannot be found |
||
159 | */ |
||
160 | protected function findModel($id) |
||
168 | } |
||
169 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.