original_string: public static function delete_category(category_controller $category) : bool {
          $event = category_deleted::create_from_object($category);
  
          // Delete all fields.
          foreach ($category->get_fields() as $field) {
              self::delete_field_configuration($field);
          }
  
          $result = $category->delete();
          $event->trigger();
          return $result;
      }
code: public static function delete_category(category_controller $category) : bool {
          $event = category_deleted::create_from_object($category);
  
          // Delete all fields.
          foreach ($category->get_fields() as $field) {
              self::delete_field_configuration($field);
          }
  
          $result = $category->delete();
          $event->trigger();
          return $result;
      }
code_tokens: public static function delete_category ( category_controller $ category ) : bool { $ event = category_deleted :: create_from_object ( $ category ) ; // Delete all fields. foreach ( $ category -> get_fields ( ) as $ field ) { self :: delete_field_configuration ( $ field ) ; } $ result = $ category -> delete ( ) ; $ event -> trigger ( ) ; return $ result ; }
docstring: Delete a custom field category
  
  @param category_controller $category
  @return bool
docstring_tokens: Delete a custom field category