original_string: public static function move_category(int $id, int $beforeid) {
          $params = self::validate_parameters(self::move_category_parameters(),
              ['id' => $id, 'beforeid' => $beforeid]);
          $category = core_customfield\category_controller::create($id);
          $handler = $category->get_handler();
          self::validate_context($handler->get_configuration_context());
          if (!$handler->can_configure()) {
              throw new moodle_exception('nopermissionconfigure', 'core_customfield');
          }
          $handler->move_category($category, $params['beforeid']);
      }
code: public static function move_category(int $id, int $beforeid) {
          $params = self::validate_parameters(self::move_category_parameters(),
              ['id' => $id, 'beforeid' => $beforeid]);
          $category = core_customfield\category_controller::create($id);
          $handler = $category->get_handler();
          self::validate_context($handler->get_configuration_context());
          if (!$handler->can_configure()) {
              throw new moodle_exception('nopermissionconfigure', 'core_customfield');
          }
          $handler->move_category($category, $params['beforeid']);
      }
code_tokens: public static function move_category ( int $ id , int $ beforeid ) { $ params = self :: validate_parameters ( self :: move_category_parameters ( ) , [ 'id' => $ id , 'beforeid' => $ beforeid ] ) ; $ category = core_customfield \ category_controller :: create ( $ id ) ; $ handler = $ category -> get_handler ( ) ; self :: validate_context ( $ handler -> get_configuration_context ( ) ) ; if ( ! $ handler -> can_configure ( ) ) { throw new moodle_exception ( 'nopermissionconfigure' , 'core_customfield' ) ; } $ handler -> move_category ( $ category , $ params [ 'beforeid' ] ) ; }
docstring: Reorder categories. Move category to the new position
  
  @param int $id category id
  @param int $beforeid
docstring_tokens: Reorder categories . Move category to the new position