original_string: public function actionRemoveItems()
      {
          if (false === Yii::$app->request->isAjax) {
              throw new NotFoundHttpException(Yii::t('users', 'Page not found'));
          }
          $type = Yii::$app->request->post('item-type', 0);
          self::checkPermissions($type);
          $items = Yii::$app->request->post('items', []);
          $authManager = Yii::$app->getAuthManager();
          $removed = 0;
          foreach ($items as $item) {
              try {
                  $authManager->remove(new Item(['name' => $item]));
                  $removed++;
              } catch (\Exception $e) {
                  Yii::$app->session->setFlash(
                      'warning',
                      Yii::t('users', "Unknown RBAC item name '{name}'", ['name' => $item])
                  );
              }
          }
          if (0 !== $removed) {
              Yii::$app->session->setFlash(
                  'info',
                  Yii::t('users', "Items removed: {count}", ['count' => $removed])
              );
          }
      }
code: public function actionRemoveItems()
      {
          if (false === Yii::$app->request->isAjax) {
              throw new NotFoundHttpException(Yii::t('users', 'Page not found'));
          }
          $type = Yii::$app->request->post('item-type', 0);
          self::checkPermissions($type);
          $items = Yii::$app->request->post('items', []);
          $authManager = Yii::$app->getAuthManager();
          $removed = 0;
          foreach ($items as $item) {
              try {
                  $authManager->remove(new Item(['name' => $item]));
                  $removed++;
              } catch (\Exception $e) {
                  Yii::$app->session->setFlash(
                      'warning',
                      Yii::t('users', "Unknown RBAC item name '{name}'", ['name' => $item])
                  );
              }
          }
          if (0 !== $removed) {
              Yii::$app->session->setFlash(
                  'info',
                  Yii::t('users', "Items removed: {count}", ['count' => $removed])
              );
          }
      }
code_tokens: public function actionRemoveItems ( ) { if ( false === Yii :: $ app -> request -> isAjax ) { throw new NotFoundHttpException ( Yii :: t ( 'users' , 'Page not found' ) ) ; } $ type = Yii :: $ app -> request -> post ( 'item-type' , 0 ) ; self :: checkPermissions ( $ type ) ; $ items = Yii :: $ app -> request -> post ( 'items' , [ ] ) ; $ authManager = Yii :: $ app -> getAuthManager ( ) ; $ removed = 0 ; foreach ( $ items as $ item ) { try { $ authManager -> remove ( new Item ( [ 'name' => $ item ] ) ) ; $ removed ++ ; } catch ( \ Exception $ e ) { Yii :: $ app -> session -> setFlash ( 'warning' , Yii :: t ( 'users' , "Unknown RBAC item name '{name}'" , [ 'name' => $ item ] ) ) ; } } if ( 0 !== $ removed ) { Yii :: $ app -> session -> setFlash ( 'info' , Yii :: t ( 'users' , "Items removed: {count}" , [ 'count' => $ removed ] ) ) ; } }
docstring: Respond only on Ajax
  
  @throws NotFoundHttpException
docstring_tokens: Respond only on Ajax