@@ -83,11 +83,11 @@ public function actionIndex()
83
83
/**
84
84
* Displays a single AuthItem model.
85
85
*
86
- * @param int $id
86
+ * @param string $id
87
87
*
88
88
* @return mixed
89
89
*/
90
- public function actionView (int $ id )
90
+ public function actionView (string $ id )
91
91
{
92
92
$ model = $ this ->findModel ($ id );
93
93
@@ -120,11 +120,11 @@ public function actionCreate()
120
120
*
121
121
* If update is successful, the browser will be redirected to the 'view' page.
122
122
*
123
- * @param int $id
123
+ * @param string $id
124
124
*
125
125
* @return mixed
126
126
*/
127
- public function actionUpdate (int $ id )
127
+ public function actionUpdate (string $ id )
128
128
{
129
129
$ model = $ this ->findModel ($ id );
130
130
@@ -142,11 +142,11 @@ public function actionUpdate(int $id)
142
142
*
143
143
* If deletion is successful, the browser will be redirected to the 'index' page.
144
144
*
145
- * @param int $id
145
+ * @param string $id
146
146
*
147
147
* @return mixed
148
148
*/
149
- public function actionDelete (int $ id )
149
+ public function actionDelete (string $ id )
150
150
{
151
151
$ model = $ this ->findModel ($ id );
152
152
Yii::$ app ->getAuthManager ()->remove ($ model ->item );
@@ -158,11 +158,11 @@ public function actionDelete(int $id)
158
158
/**
159
159
* Assign items
160
160
*
161
- * @param int $id
161
+ * @param string $id
162
162
*
163
163
* @return array
164
164
*/
165
- public function actionAssign (int $ id )
165
+ public function actionAssign (string $ id )
166
166
{
167
167
$ items = Yii::$ app ->getRequest ()->post ('items ' , []);
168
168
$ model = $ this ->findModel ($ id );
@@ -174,11 +174,11 @@ public function actionAssign(int $id)
174
174
/**
175
175
* Remove items
176
176
*
177
- * @param int $id
177
+ * @param string $id
178
178
*
179
179
* @return array
180
180
*/
181
- public function actionRemove (int $ id ): array
181
+ public function actionRemove (string $ id ): array
182
182
{
183
183
$ items = Yii::$ app ->getRequest ()->post ('items ' , []);
184
184
$ model = $ this ->findModel ($ id );
@@ -216,13 +216,13 @@ public function getLabels(): array
216
216
*
217
217
* If the model is not found, a 404 HTTP exception will be thrown.
218
218
*
219
- * @param int $id
219
+ * @param string $id
220
220
*
221
221
* @return AuthItemModel the loaded model
222
222
*
223
223
* @throws NotFoundHttpException if the model cannot be found
224
224
*/
225
- protected function findModel (int $ id ): AuthItemModel
225
+ protected function findModel (string $ id ): AuthItemModel
226
226
{
227
227
$ auth = Yii::$ app ->getAuthManager ();
228
228
$ item = $ this ->type === Item::TYPE_ROLE ? $ auth ->getRole ($ id ) : $ auth ->getPermission ($ id );
0 commit comments