Implements hook_uninstall().
function comment_uninstall() : void { // Remove the comment fields. $storage = \Drupal::entityTypeManager()->getStorage('field_storage_config'); $fields = $storage->loadByProperties([ 'type' => 'comment', ]); $storage->delete($fields); // Remove state setting. \Drupal::state()->delete('comment.node_comment_statistics_scale'); }