diff --git a/core/includes/form.inc b/core/includes/form.inc
index 360155e..260ffbe 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -99,59 +99,11 @@ function form_builder($form_id, &$element, FormStateInterface $form_state) {
 /**
  * Removes internal Form API elements and buttons from submitted form values.
  *
- * This function can be used when a module wants to store all submitted form
- * values, for example, by serializing them into a single database column. In
- * such cases, all internal Form API values and all form button elements should
- * not be contained, and this function allows to remove them before the module
- * proceeds to storage. Next to button elements, the following internal values
- * are removed:
- * - form_id
- * - form_token
- * - form_build_id
- * - op
- *
- * @param $form_state
- *   The current state of the form, including submitted form values.
+ * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.0.
+ *   Use $form_state->cleanValues().
  */
 function form_state_values_clean(FormStateInterface $form_state) {
-  // Remove internal Form API values.
-  $form_state
-    ->unsetValue('form_id')
-    ->unsetValue('form_token')
-    ->unsetValue('form_build_id')
-    ->unsetValue('op');
-
-  // Remove button values.
-  // form_builder() collects all button elements in a form. We remove the button
-  // value separately for each button element.
-  foreach ($form_state->getButtons() as $button) {
-    // Remove this button's value from the submitted form values by finding
-    // the value corresponding to this button.
-    // We iterate over the #parents of this button and move a reference to
-    // each parent in $form_state->getValues(). For example, if #parents is:
-    //   array('foo', 'bar', 'baz')
-    // then the corresponding $form_state->getValues() part will look like this:
-    // array(
-    //   'foo' => array(
-    //     'bar' => array(
-    //       'baz' => 'button_value',
-    //     ),
-    //   ),
-    // )
-    // We start by (re)moving 'baz' to $last_parent, so we are able unset it
-    // at the end of the iteration. Initially, $values will contain a
-    // reference to $form_state->getValues(), but in the iteration we move the
-    // reference to $form_state->getValue('foo'), and finally to
-    // $form_state->getValue(array('foo', 'bar')), which is the level where we
-    // can unset 'baz' (that is stored in $last_parent).
-    $parents = $button['#parents'];
-    $last_parent = array_pop($parents);
-    $key_exists = NULL;
-    $values = &NestedArray::getValue($form_state->getValues(), $parents, $key_exists);
-    if ($key_exists && is_array($values)) {
-      unset($values[$last_parent]);
-    }
-  }
+  $form_state->cleanValues();
 }
 
 /**
diff --git a/core/lib/Drupal/Core/Entity/EntityForm.php b/core/lib/Drupal/Core/Entity/EntityForm.php
index 5e18679..6c1792e 100644
--- a/core/lib/Drupal/Core/Entity/EntityForm.php
+++ b/core/lib/Drupal/Core/Entity/EntityForm.php
@@ -258,7 +258,7 @@ public function validate(array $form, FormStateInterface $form_state) {
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
     // Remove button and internal Form API values from submitted values.
-    form_state_values_clean($form_state);
+    $form_state->cleanValues();
     $this->entity = $this->buildEntity($form, $form_state);
   }
 
diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php
index 9fb4112..0564398 100644
--- a/core/lib/Drupal/Core/Form/FormBuilder.php
+++ b/core/lib/Drupal/Core/Form/FormBuilder.php
@@ -972,8 +972,8 @@ protected function handleInputElement($form_id, &$element, FormStateInterface &$
 
     // Determine which element (if any) triggered the submission of the form and
     // keep track of all the clickable buttons in the form for
-    // form_state_values_clean(). Enforce the same input processing restrictions
-    // as above.
+    // \Drupal\Core\Form\FormState::cleanValues(). Enforce the same input
+    // processing restrictions as above.
     if ($process_input) {
       // Detect if the element triggered the submission via Ajax.
       if ($this->elementTriggeredScriptedSubmission($element, $form_state)) {
@@ -986,9 +986,9 @@ protected function handleInputElement($form_id, &$element, FormStateInterface &$
       // information.
       if (!empty($element['#is_button'])) {
         // All buttons in the form need to be tracked for
-        // form_state_values_clean() and for the self::doBuildForm() code that
-        // handles a form submission containing no button information in
-        // \Drupal::request()->request.
+        // \Drupal\Core\Form\FormState::cleanValues() and for the
+        // self::doBuildForm() code that handles a form submission containing no
+        // button information in \Drupal::request()->request.
         $buttons = $form_state->getButtons();
         $buttons[] = $element;
         $form_state->setButtons($buttons);
diff --git a/core/lib/Drupal/Core/Form/FormState.php b/core/lib/Drupal/Core/Form/FormState.php
index b91eb2f..edef14e 100644
--- a/core/lib/Drupal/Core/Form/FormState.php
+++ b/core/lib/Drupal/Core/Form/FormState.php
@@ -1129,6 +1129,50 @@ public function getFormObject() {
   }
 
   /**
+   * {@inheritdoc}
+   */
+  public function cleanValues() {
+    // Remove internal Form API values.
+    $this
+      ->unsetValue('form_id')
+      ->unsetValue('form_token')
+      ->unsetValue('form_build_id')
+      ->unsetValue('op');
+
+    // Remove button values.
+    // form_builder() collects all button elements in a form. We remove the button
+    // value separately for each button element.
+    foreach ($this->getButtons() as $button) {
+      // Remove this button's value from the submitted form values by finding
+      // the value corresponding to this button.
+      // We iterate over the #parents of this button and move a reference to
+      // each parent in self::getValues(). For example, if #parents is:
+      //   array('foo', 'bar', 'baz')
+      // then the corresponding self::getValues() part will look like this:
+      // array(
+      //   'foo' => array(
+      //     'bar' => array(
+      //       'baz' => 'button_value',
+      //     ),
+      //   ),
+      // )
+      // We start by (re)moving 'baz' to $last_parent, so we are able unset it
+      // at the end of the iteration. Initially, $values will contain a
+      // reference to self::getValues(), but in the iteration we move the
+      // reference to self::getValue('foo'), and finally to
+      // self::getValue(array('foo', 'bar')), which is the level where we
+      // can unset 'baz' (that is stored in $last_parent).
+      $parents = $button['#parents'];
+      $last_parent = array_pop($parents);
+      $key_exists = NULL;
+      $values = &NestedArray::getValue($this->getValues(), $parents, $key_exists);
+      if ($key_exists && is_array($values)) {
+        unset($values[$last_parent]);
+      }
+    }
+  }
+
+  /**
    * Wraps drupal_set_message().
    *
    * @return array|null
diff --git a/core/lib/Drupal/Core/Form/FormStateInterface.php b/core/lib/Drupal/Core/Form/FormStateInterface.php
index e227ee6..8a544df 100644
--- a/core/lib/Drupal/Core/Form/FormStateInterface.php
+++ b/core/lib/Drupal/Core/Form/FormStateInterface.php
@@ -987,4 +987,22 @@ public function setValidationComplete($validation_complete = TRUE);
    */
   public function isValidationComplete();
 
+  /**
+   * Removes internal Form API elements and buttons from submitted form values.
+   *
+   * This function can be used when a module wants to store all submitted form
+   * values, for example, by serializing them into a single database column. In
+   * such cases, all internal Form API values and all form button elements
+   * should not be contained, and this function allows to remove them before the
+   * module proceeds to storage. Next to button elements, the following internal
+   * values are removed:
+   * - form_id
+   * - form_token
+   * - form_build_id
+   * - op
+   *
+   * @return $this
+   */
+  public function cleanValues();
+
 }
diff --git a/core/modules/image/src/Form/ImageEffectFormBase.php b/core/modules/image/src/Form/ImageEffectFormBase.php
index 535f2a9..52d5b2c 100644
--- a/core/modules/image/src/Form/ImageEffectFormBase.php
+++ b/core/modules/image/src/Form/ImageEffectFormBase.php
@@ -116,7 +116,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
    * {@inheritdoc}
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
-    form_state_values_clean($form_state);
+    $form_state->cleanValues();
 
     // The image effect configuration is stored in the 'data' key in the form,
     // pass that through for submission.
diff --git a/core/modules/path/src/Form/PathFormBase.php b/core/modules/path/src/Form/PathFormBase.php
index 62df767..3dd1399 100644
--- a/core/modules/path/src/Form/PathFormBase.php
+++ b/core/modules/path/src/Form/PathFormBase.php
@@ -156,7 +156,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
     // Remove unnecessary values.
-    form_state_values_clean($form_state);
+    $form_state->cleanValues();
 
     $pid = $form_state->getValue('pid', 0);
     $source = &$form_state->getValue('source');
diff --git a/core/modules/system/src/Form/ThemeSettingsForm.php b/core/modules/system/src/Form/ThemeSettingsForm.php
index 85a58a5..b65628a 100644
--- a/core/modules/system/src/Form/ThemeSettingsForm.php
+++ b/core/modules/system/src/Form/ThemeSettingsForm.php
@@ -383,7 +383,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     $config = $this->config($form_state->getValue('config_key'));
 
     // Exclude unnecessary elements before saving.
-    form_state_values_clean($form_state);
+    $form_state->cleanValues();
     $form_state->unsetValue('var');
     $form_state->unsetValue('config_key');
 
diff --git a/core/modules/system/src/Tests/Form/StateValuesCleanAdvancedTest.php b/core/modules/system/src/Tests/Form/StateValuesCleanAdvancedTest.php
index 09df7f6..1c9ed4c 100644
--- a/core/modules/system/src/Tests/Form/StateValuesCleanAdvancedTest.php
+++ b/core/modules/system/src/Tests/Form/StateValuesCleanAdvancedTest.php
@@ -10,8 +10,9 @@
 use Drupal\simpletest\WebTestBase;
 
 /**
- * Tests proper removal of submitted form values using form_state_values_clean()
- * when having forms with elements containing buttons like "managed_file".
+ * Tests proper removal of submitted form values using
+ * \Drupal\Core\Form\FormState::cleanValues() when having forms with elements
+ * containing buttons like "managed_file".
  *
  * @group Form
  */
@@ -30,7 +31,7 @@ class StateValuesCleanAdvancedTest extends WebTestBase {
   protected $image;
 
   /**
-   * Tests form_state_values_clean().
+   * Tests \Drupal\Core\Form\FormState::cleanValues().
    */
   function testFormStateValuesCleanAdvanced() {
 
diff --git a/core/modules/system/src/Tests/Form/StateValuesCleanTest.php b/core/modules/system/src/Tests/Form/StateValuesCleanTest.php
index 804ffa1..382abfc 100644
--- a/core/modules/system/src/Tests/Form/StateValuesCleanTest.php
+++ b/core/modules/system/src/Tests/Form/StateValuesCleanTest.php
@@ -12,7 +12,7 @@
 
 /**
  * Tests proper removal of submitted form values using
- * form_state_values_clean().
+ * \Drupal\Core\Form\FormState::cleanValues().
  *
  * @group Form
  */
@@ -26,7 +26,7 @@ class StateValuesCleanTest extends WebTestBase {
   public static $modules = array('form_test');
 
   /**
-   * Tests form_state_values_clean().
+   * Tests \Drupal\Core\Form\FormState::cleanValues().
    */
   function testFormStateValuesClean() {
     $values = Json::decode($this->drupalPostForm('form_test/form-state-values-clean', array(), t('Submit')));
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestFormStateValuesCleanAdvancedForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestFormStateValuesCleanAdvancedForm.php
index 79d44d7..7ea718f 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestFormStateValuesCleanAdvancedForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestFormStateValuesCleanAdvancedForm.php
@@ -11,7 +11,7 @@
 use Drupal\Core\Form\FormStateInterface;
 
 /**
- * Form builder for form_state_values_clean() test.
+ * Form builder for \Drupal\Core\Form\FormState::cleanValues() test.
  */
 class FormTestFormStateValuesCleanAdvancedForm extends FormBase {
 
@@ -19,7 +19,7 @@ class FormTestFormStateValuesCleanAdvancedForm extends FormBase {
    * {@inheritdoc}
    */
   public function getFormId() {
-    return 'form_test_form_state_values_clean_advanced_form';
+    return 'form_test_form_state_clean_values_advanced_form';
   }
 
   /**
@@ -44,7 +44,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    * {@inheritdoc}
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
-    form_state_values_clean($form_state);
+    $form_state->cleanValues();
     print t('You WIN!');
     exit;
   }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestFormStateValuesCleanForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestFormStateValuesCleanForm.php
index f23177a..154bf38 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestFormStateValuesCleanForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestFormStateValuesCleanForm.php
@@ -12,7 +12,7 @@
 use Drupal\Core\Form\FormStateInterface;
 
 /**
- * Form builder for form_state_values_clean() test.
+ * Form builder for \Drupal\Core\Form\FormState::cleanValues() test.
  */
 class FormTestFormStateValuesCleanForm extends FormBase {
 
@@ -20,7 +20,7 @@ class FormTestFormStateValuesCleanForm extends FormBase {
    * {@inheritdoc}
    */
   public function getFormId() {
-    return 'form_test_form_state_values_clean_form';
+    return 'form_test_form_state_clean_values_form';
   }
 
   /**
@@ -43,7 +43,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    * {@inheritdoc}
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
-    form_state_values_clean($form_state);
+    $form_state->cleanValues();
     // This won't have a proper JSON header, but Drupal doesn't check for that
     // anyway so this is fine until it's replaced with a JsonResponse.
     print Json::encode($form_state->getValues());
diff --git a/core/modules/user/src/RegisterForm.php b/core/modules/user/src/RegisterForm.php
index 5d2d5ec..35fc9e8 100644
--- a/core/modules/user/src/RegisterForm.php
+++ b/core/modules/user/src/RegisterForm.php
@@ -91,7 +91,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     }
 
     // Remove unneeded values.
-    form_state_values_clean($form_state);
+    $form_state->cleanValues();
 
     $form_state->setValue('pass', $pass);
     $form_state->setValue('init', $form_state->getValue('mail'));
