--- a/adminimal_theme.theme	2019-05-23 05:40:55.000000000 +0200
+++ b/adminimal_theme.theme	2020-06-18 14:23:54.650736000 +0200
@@ -33,7 +33,7 @@ function adminimal_theme_preprocess_html
 /**
  * Implements hook_form_system_theme_settings_alter().
  */
-function adminimal_theme_form_system_theme_settings_alter(&$form, \Drupal\Core\Form\FormStateInterface &$form_state, $form_id = NULL) {
+function adminimal_theme_form_system_theme_settings_alter(&$form, FormStateInterface &$form_state, $form_id = NULL) {
   // Work-around for a core bug affecting admin themes. See issue #943212.
   if (isset($form_id)) {
     return;
@@ -52,18 +52,18 @@ function adminimal_theme_form_system_the
 
     // Try to migrate from the old css.
     if (file_exists($old_css_path)) {
-      file_unmanaged_copy($old_css_path, $custom_css_path, FILE_EXISTS_ERROR);
+      file_unmanaged_copy($old_css_path, $custom_css_path, EXISTS_ERROR);
     }
     // Else create a new blank css file.
     else {
-      file_unmanaged_save_data("", $custom_css_path, FILE_EXISTS_ERROR);
+      \Drupal::service('file_system')->saveData("", $custom_css_path, EXISTS_ERROR);
     }
 
   }
 
   // Notify user to remove his old css file.
   if (file_exists($old_css_path)) {
-    drupal_set_message(t('Please delete the old @css_location file, as its no longer used.', ['@css_location file' => $old_css_path]), 'warning');
+    \Drupal::messenger()->addWarning(t('Please delete the old @css_location file, as its no longer used.', ['@css_location file' => $old_css_path]));
   }
 
   $form['adminimal_custom'] = [
