<?php

/**
 * @file
 * Install, update and uninstall functions for the social_lets_connect module.
 */

/**
 * Uninstall social_lets_connect_usage module.
 */
function social_core_update_10001(): void {
  $modules = [
    'social_lets_connect_usage',
  ];
  \Drupal::service('module_installer')->uninstall($modules);

  // Delete configs.
  $config = \Drupal::configFactory()->getEditable('social_lets_connect_usage.settings');
  $config->delete();
}

/**
 * Uninstall social_lets_connect_usage module.
 */
function social_lets_connect_update_12001() : void {
  // This update hook was previously called social_core_update_10001 which meant
  // it didn't run.
  $modules = [
    'social_lets_connect_usage',
  ];
  \Drupal::service('module_installer')->uninstall($modules);

  // Delete configs.
  $config = \Drupal::configFactory()->getEditable('social_lets_connect_usage.settings');
  $config->delete();
}
