- // Clear the static cache of system_rebuild_module_data() to pick up the
- // new module, since it merges the installation status of modules into
- // its statically cached list.
- drupal_static_reset('system_rebuild_module_data');
+ // Clear the static cache of the "extension.list.module" service to pick
+ // up the new module, since it merges the installation status of modules
+ // into its statically cached list.
+ \Drupal::service('extension.list.module')->reset();