diff --git a/base/ItemController.php b/base/ItemController.php index 4e73280..be7a3c9 100644 --- a/base/ItemController.php +++ b/base/ItemController.php @@ -83,11 +83,11 @@ public function actionIndex() /** * Displays a single AuthItem model. * - * @param int $id + * @param string $id * * @return mixed */ - public function actionView(int $id) + public function actionView(string $id) { $model = $this->findModel($id); @@ -120,11 +120,11 @@ public function actionCreate() * * If update is successful, the browser will be redirected to the 'view' page. * - * @param int $id + * @param string $id * * @return mixed */ - public function actionUpdate(int $id) + public function actionUpdate(string $id) { $model = $this->findModel($id); @@ -142,11 +142,11 @@ public function actionUpdate(int $id) * * If deletion is successful, the browser will be redirected to the 'index' page. * - * @param int $id + * @param string $id * * @return mixed */ - public function actionDelete(int $id) + public function actionDelete(string $id) { $model = $this->findModel($id); Yii::$app->getAuthManager()->remove($model->item); @@ -158,11 +158,11 @@ public function actionDelete(int $id) /** * Assign items * - * @param int $id + * @param string $id * * @return array */ - public function actionAssign(int $id) + public function actionAssign(string $id) { $items = Yii::$app->getRequest()->post('items', []); $model = $this->findModel($id); @@ -174,11 +174,11 @@ public function actionAssign(int $id) /** * Remove items * - * @param int $id + * @param string $id * * @return array */ - public function actionRemove(int $id): array + public function actionRemove(string $id): array { $items = Yii::$app->getRequest()->post('items', []); $model = $this->findModel($id); @@ -216,13 +216,13 @@ public function getLabels(): array * * If the model is not found, a 404 HTTP exception will be thrown. * - * @param int $id + * @param string $id * * @return AuthItemModel the loaded model * * @throws NotFoundHttpException if the model cannot be found */ - protected function findModel(int $id): AuthItemModel + protected function findModel(string $id): AuthItemModel { $auth = Yii::$app->getAuthManager(); $item = $this->type === Item::TYPE_ROLE ? $auth->getRole($id) : $auth->getPermission($id); diff --git a/controllers/RuleController.php b/controllers/RuleController.php index 7e5b58b..e939101 100644 --- a/controllers/RuleController.php +++ b/controllers/RuleController.php @@ -63,11 +63,11 @@ public function actionIndex() /** * Displays a single Rule item. * - * @param int $id + * @param string $id * * @return mixed */ - public function actionView(int $id) + public function actionView(string $id) { $model = $this->findModel($id); @@ -99,11 +99,11 @@ public function actionCreate() * * If update is successful, the browser will be redirected to the 'view' page. * - * @param int $id + * @param string $id * * @return mixed */ - public function actionUpdate(int $id) + public function actionUpdate(string $id) { $model = $this->findModel($id); @@ -121,11 +121,11 @@ public function actionUpdate(int $id) * * If deletion is successful, the browser will be redirected to the 'index' page. * - * @param int $id + * @param string $id * * @return mixed */ - public function actionDelete(int $id) + public function actionDelete(string $id) { $model = $this->findModel($id); Yii::$app->authManager->remove($model->item); @@ -139,13 +139,13 @@ public function actionDelete(int $id) * * If the model is not found, a 404 HTTP exception will be thrown. * - * @param int $id + * @param string $id * * @return BizRuleModel the loaded model * * @throws \yii\web\NotFoundHttpException */ - protected function findModel(int $id) + protected function findModel(string $id) { $item = Yii::$app->authManager->getRule($id);