| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 37 | public function down() |
||
| 38 | { |
||
| 39 | $auth = Yii::$app->authManager; |
||
| 40 | |||
| 41 | if ($auth instanceof \yii\rbac\DbManager) { |
||
| 42 | $auth->remove($auth->getPermission('backend_default')); |
||
| 43 | $auth->remove($auth->getPermission('app_site')); |
||
| 44 | $auth->remove($auth->getRole('Editor')); |
||
| 45 | $auth->remove($auth->getRole('Public')); |
||
| 46 | } else { |
||
| 47 | throw new \yii\base\Exception('Application authManager must be an instance of \yii\rbac\DbManager'); |
||
| 48 | } |
||
| 49 | } |
||
| 50 | } |
||
| 51 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.