diff --git a/core/includes/form.inc b/core/includes/form.inc
index acb81e8..69023eb 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -11,6 +11,7 @@
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Component\Utility\Xss;
 use Drupal\Core\Database\Database;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Form\OptGroup;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Template\Attribute;
@@ -42,6 +43,7 @@
  * namespace Drupal\mymodule\Form;
  *
  * use Drupal\Core\Form\FormBase;
+ * use Drupal\Core\Form\FormStateInterface;
  *
  * class ExampleForm extends FormBase {
  *   public function getFormId() {
@@ -49,7 +51,7 @@
  *     return 'example_form';
  *   }
  *
- *   public function buildForm(array $form, array &$form_state) {
+ *   public function buildForm(array $form, FormStateInterface $form_state) {
  *     // Create a $form API array.
  *     $form['phone_number'] = array(
  *       '#type' => 'tel',
@@ -58,11 +60,11 @@
  *     return $form;
  *   }
  *
- *   public function validateForm(array &$form, array &$form_state) {
+ *   public function validateForm(array &$form, FormStateInterface $form_state) {
  *     // Validate submitted form data.
  *   }
  *
- *   public function submitForm(array &$form, array &$form_state) {
+ *   public function submitForm(array &$form, FormStateInterface $form_state) {
  *     // Handle submitted form data.
  *   }
  * }
@@ -87,7 +89,7 @@
  * $extra = '612-123-4567';
  * $form = \Drupal::formBuilder()->getForm('Drupal\mymodule\Form\ExampleForm', $extra);
  * ...
- * public function buildForm(array $form, array &$form_state, $extra = NULL)
+ * public function buildForm(array $form, FormStateInterface $form_state, $extra = NULL)
  *   $form['phone_number'] = array(
  *     '#type' => 'tel',
  *     '#title' => $this->t('Your phone number'),
@@ -138,7 +140,7 @@
  *
  * @see \Drupal\Core\Form\FormBuilderInterface::buildForm().
  */
-function drupal_build_form($form_id, &$form_state) {
+function drupal_build_form($form_id, FormStateInterface $form_state) {
   return \Drupal::formBuilder()->buildForm($form_id, $form_state);
 }
 
@@ -150,7 +152,7 @@ function drupal_build_form($form_id, &$form_state) {
  *
  * @see \Drupal\Core\Form\FormBuilderInterface::getCache().
  */
-function form_get_cache($form_build_id, &$form_state) {
+function form_get_cache($form_build_id, FormStateInterface $form_state) {
   return \Drupal::formBuilder()->getCache($form_build_id, $form_state);
 }
 
@@ -197,7 +199,7 @@ function form_set_cache($form_build_id, $form, $form_state) {
  *
  * @see module_load_include()
  */
-function form_load_include(&$form_state, $type, $module, $name = NULL) {
+function form_load_include(FormStateInterface $form_state, $type, $module, $name = NULL) {
   if (!isset($name)) {
     $name = $module;
   }
@@ -223,7 +225,7 @@ function form_load_include(&$form_state, $type, $module, $name = NULL) {
  *
  * @see \Drupal\Core\Form\FormBuilderInterface::submitForm().
  */
-function drupal_form_submit($form_arg, &$form_state) {
+function drupal_form_submit($form_arg, FormStateInterface $form_state) {
   \Drupal::formBuilder()->submitForm($form_arg, $form_state);
 }
 
@@ -235,7 +237,7 @@ function drupal_form_submit($form_arg, &$form_state) {
  *
  * @see \Drupal\Core\Form\FormBuilderInterface::retrieveForm().
  */
-function drupal_retrieve_form($form_id, &$form_state) {
+function drupal_retrieve_form($form_id, FormStateInterface $form_state) {
   return \Drupal::formBuilder()->retrieveForm($form_id, $form_state);
 
 }
@@ -247,7 +249,7 @@ function drupal_retrieve_form($form_id, &$form_state) {
  *
  * @see \Drupal\Core\Form\FormBuilderInterface::processForm().
  */
-function drupal_process_form($form_id, &$form, &$form_state) {
+function drupal_process_form($form_id, &$form, FormStateInterface $form_state) {
   \Drupal::formBuilder()->processForm($form_id, $form, $form_state);
 }
 
@@ -273,7 +275,7 @@ function drupal_redirect_form($form_state) {
  * @see \Drupal\Core\Form\FormSubmitterInterface::executeSubmitHandlers()
  * @see \Drupal\Core\Form\FormValidatorInterface::executeValidateHandlers()
  */
-function form_execute_handlers($type, &$form, &$form_state) {
+function form_execute_handlers($type, &$form, FormStateInterface $form_state) {
   if ($type == 'submit') {
     \Drupal::service('form_submitter')->executeSubmitHandlers($form, $form_state);
   }
@@ -290,7 +292,7 @@ function form_execute_handlers($type, &$form, &$form_state) {
  *
  * @see \Drupal\Core\Form\FormErrorInterface::setErrorByName().
  */
-function form_set_error($name, array &$form_state, $message = '') {
+function form_set_error($name, FormStateInterface $form_state, $message = '') {
   \Drupal::formBuilder()->setErrorByName($name, $form_state, $message);
 }
 
@@ -302,7 +304,7 @@ function form_set_error($name, array &$form_state, $message = '') {
  *
  * @see \Drupal\Core\Form\FormErrorInterface::getErrors()
  */
-function form_get_errors(array &$form_state) {
+function form_get_errors(FormStateInterface $form_state) {
   return \Drupal::formBuilder()->getErrors($form_state);
 }
 
@@ -314,7 +316,7 @@ function form_get_errors(array &$form_state) {
  *
  * @see \Drupal\Core\Form\FormErrorInterface::getError().
  */
-function form_get_error($element, array &$form_state) {
+function form_get_error($element, FormStateInterface $form_state) {
   return \Drupal::formBuilder()->getError($element, $form_state);
 }
 
@@ -326,7 +328,7 @@ function form_get_error($element, array &$form_state) {
  *
  * @see \Drupal\Core\Form\FormErrorInterface::setError().
  */
-function form_error(&$element, array &$form_state, $message = '') {
+function form_error(&$element, FormStateInterface $form_state, $message = '') {
   \Drupal::formBuilder()->setError($element, $form_state, $message);
 }
 
@@ -338,7 +340,7 @@ function form_error(&$element, array &$form_state, $message = '') {
  *
  * @see \Drupal\Core\Form\FormBuilderInterface::doBuildForm().
  */
-function form_builder($form_id, &$element, &$form_state) {
+function form_builder($form_id, &$element, FormStateInterface $form_state) {
   return \Drupal::formBuilder()->doBuildForm($form_id, $element, $form_state);
 }
 
@@ -360,7 +362,7 @@ function form_builder($form_id, &$element, &$form_state) {
  *   A keyed array containing the current state of the form, including
  *   submitted form values; altered by reference.
  */
-function form_state_values_clean(&$form_state) {
+function form_state_values_clean(FormStateInterface $form_state) {
   // Remove internal Form API values.
   unset($form_state['values']['form_id'], $form_state['values']['form_token'], $form_state['values']['form_build_id'], $form_state['values']['op']);
 
@@ -743,7 +745,7 @@ function form_type_token_value($element, $input = FALSE) {
  *
  * @see \Drupal\Core\Form\FormBuilderInterface::setValue().
  */
-function form_set_value($element, $value, &$form_state) {
+function form_set_value($element, $value, FormStateInterface $form_state) {
   \Drupal::formBuilder()->setValue($element, $value, $form_state);
 }
 
@@ -1384,7 +1386,7 @@ function form_process_checkboxes($element) {
  * @return
  *   The processed element.
  */
-function form_process_actions($element, &$form_state) {
+function form_process_actions($element, FormStateInterface $form_state) {
   $element['#attributes']['class'][] = 'form-actions';
   return $element;
 }
@@ -1449,7 +1451,7 @@ function form_pre_render_actions_dropbutton(array $element) {
  *
  * @see form_validate_pattern()
  */
-function form_process_pattern($element, &$form_state) {
+function form_process_pattern($element, FormStateInterface $form_state) {
   if (isset($element['#pattern']) && !isset($element['#attributes']['pattern'])) {
     $element['#attributes']['pattern'] = $element['#pattern'];
     $element['#element_validate'][] = 'form_validate_pattern';
@@ -1469,7 +1471,7 @@ function form_process_pattern($element, &$form_state) {
  *
  * @see form_process_pattern()
  */
-function form_validate_pattern($element, &$form_state) {
+function form_validate_pattern($element, FormStateInterface $form_state) {
   if ($element['#value'] !== '') {
     // The pattern must match the entire string and should have the same
     // behavior as the RegExp object in ECMA 262.
@@ -1497,7 +1499,7 @@ function form_validate_pattern($element, &$form_state) {
  * @return
  *   The processed element.
  */
-function form_process_container($element, &$form_state) {
+function form_process_container($element, FormStateInterface $form_state) {
   // Generate the ID of the element if it's not explicitly given.
   if (!isset($element['#id'])) {
     $element['#id'] = drupal_html_id(implode('-', $element['#parents']) . '-wrapper');
@@ -1692,7 +1694,7 @@ function form_process_tableselect($element) {
  * @param array $element
  *   An associative array containing the properties and children of the
  *   table element.
- * @param array $form_state
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The current state of the form.
  *
  * @return array
@@ -1701,7 +1703,7 @@ function form_process_tableselect($element) {
  * @see form_process_tableselect()
  * @see theme_tableselect()
  */
-function form_process_table($element, &$form_state) {
+function form_process_table($element, FormStateInterface $form_state) {
   if ($element['#tableselect']) {
     if ($element['#multiple']) {
       $value = is_array($element['#value']) ? $element['#value'] : array();
@@ -1818,10 +1820,10 @@ function form_process_table($element, &$form_state) {
  * @param array $element
  *   An associative array containing the properties and children of the
  *   table element.
- * @param array $form_state
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The current state of the form.
  */
-function form_validate_table($element, &$form_state) {
+function form_validate_table($element, FormStateInterface $form_state) {
   // Skip this validation if the button to submit the form does not require
   // selected table row data.
   if (empty($form_state['triggering_element']['#tableselect'])) {
@@ -1869,7 +1871,7 @@ function form_validate_table($element, &$form_state) {
  *   - #disabled: (optional) Should be set to TRUE in case an existing machine
  *     name must not be changed after initial creation.
  */
-function form_process_machine_name($element, &$form_state) {
+function form_process_machine_name($element, FormStateInterface $form_state) {
   // We need to pass the langcode to the client.
   $language = \Drupal::languageManager()->getCurrentLanguage();
 
@@ -1953,7 +1955,7 @@ function form_process_machine_name($element, &$form_state) {
  *
  * Note that #maxlength is validated by _form_validate() already.
  */
-function form_validate_machine_name(&$element, &$form_state) {
+function form_validate_machine_name(&$element, FormStateInterface $form_state) {
   // Verify that the machine name not only consists of replacement tokens.
   if (preg_match('@^' . $element['#machine_name']['replace'] . '+$@', $element['#value'])) {
     form_error($element, $form_state, t('The machine-readable name must contain unique characters.'));
@@ -1999,7 +2001,7 @@ function form_validate_machine_name(&$element, &$form_state) {
  * @return
  *   The processed element.
  */
-function form_process_group(&$element, &$form_state) {
+function form_process_group(&$element, FormStateInterface $form_state) {
   $parents = implode('][', $element['#parents']);
 
   // Each details element forms a new group. The #type 'vertical_tabs' basically
@@ -2123,7 +2125,7 @@ function form_pre_render_group($element) {
  * @return
  *   The processed element.
  */
-function form_process_vertical_tabs($element, &$form_state) {
+function form_process_vertical_tabs($element, FormStateInterface $form_state) {
   // Inject a new details as child, so that form_process_details() processes
   // this details element like any other details.
   $element['group'] = array(
@@ -2212,13 +2214,13 @@ function template_preprocess_vertical_tabs(&$variables) {
  *     autocomplete JavaScript library.
  *   - #autocomplete_route_parameters: The parameters to be used in conjunction
  *     with the route name.
- * @param array $form_state
- *   An associative array containing the current state of the form.
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
+ *   The current state of the form.
  *
  * @return array
  *   The form element.
  */
-function form_process_autocomplete($element, &$form_state) {
+function form_process_autocomplete($element, FormStateInterface $form_state) {
   $access = FALSE;
   if (!empty($element['#autocomplete_route_name'])) {
     $parameters = isset($element['#autocomplete_route_parameters']) ? $element['#autocomplete_route_parameters'] : array();
@@ -2378,7 +2380,7 @@ function form_pre_render_email($element) {
  *
  * Note that #maxlength and #required is validated by _form_validate() already.
  */
-function form_validate_email(&$element, &$form_state) {
+function form_validate_email(&$element, FormStateInterface $form_state) {
   $value = trim($element['#value']);
   form_set_value($element, $value, $form_state);
 
@@ -2449,7 +2451,7 @@ function form_pre_render_range($element) {
  *
  * Note that #required is validated by _form_validate() already.
  */
-function form_validate_number(&$element, &$form_state) {
+function form_validate_number(&$element, FormStateInterface $form_state) {
   $value = $element['#value'];
   if ($value === '') {
     return;
@@ -2557,7 +2559,7 @@ function form_pre_render_search($element) {
  *
  * Note that #maxlength and #required is validated by _form_validate() already.
  */
-function form_validate_url(&$element, &$form_state) {
+function form_validate_url(&$element, FormStateInterface $form_state) {
   $value = trim($element['#value']);
   form_set_value($element, $value, $form_state);
 
@@ -2569,7 +2571,7 @@ function form_validate_url(&$element, &$form_state) {
 /**
  * Form element validation handler for #type 'color'.
  */
-function form_validate_color(&$element, &$form_state) {
+function form_validate_color(&$element, FormStateInterface $form_state) {
   $value = trim($element['#value']);
 
   // Default to black if no value is given.
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 4774a54..97bdbac 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -6,6 +6,7 @@
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\DatabaseExceptionWrapper;
 use Drupal\Core\Database\Install\TaskException;
+use Drupal\Core\Form\FormState;
 use Drupal\Core\Installer\Exception\AlreadyInstalledException;
 use Drupal\Core\Installer\Exception\InstallerException;
 use Drupal\Core\Installer\Exception\NoProfilesException;
@@ -156,7 +157,7 @@ function install_drupal($settings = array()) {
  * submission is for, and the values are used as the $form_state['values']
  * array that is passed on to the form submission via drupal_form_submit()).
  *
- * @see drupal_form_submit()
+ * @see \Drupal\Core\Form\FormBuilderInterface::submitForm()
  */
 function install_state_defaults() {
   $defaults = array(
@@ -803,12 +804,12 @@ function install_tasks_to_display($install_state) {
 function install_get_form($form_id, array &$install_state) {
   // Ensure the form will not redirect, since install_run_tasks() uses a custom
   // redirection logic.
-  $form_state = array(
+  $form_state = new FormState(array(
     'build_info' => array(
       'args' => array(&$install_state),
     ),
     'no_redirect' => TRUE,
-  );
+  ));
   $form_builder = \Drupal::formBuilder();
   if ($install_state['interactive']) {
     $form = $form_builder->buildForm($form_id, $form_state);
diff --git a/core/lib/Drupal/Core/Action/ConfigurableActionBase.php b/core/lib/Drupal/Core/Action/ConfigurableActionBase.php
index c32695b..e036880 100644
--- a/core/lib/Drupal/Core/Action/ConfigurableActionBase.php
+++ b/core/lib/Drupal/Core/Action/ConfigurableActionBase.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Plugin\ConfigurablePluginInterface;
 use Drupal\Core\Action\ActionBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\PluginFormInterface;
 
 /**
@@ -49,7 +50,7 @@ public function setConfiguration(array $configuration) {
   /**
    * {@inheritdoc}
    */
-  public function validateConfigurationForm(array &$form, array &$form_state) {
+  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Condition/ConditionPluginBase.php b/core/lib/Drupal/Core/Condition/ConditionPluginBase.php
index a36c770..c982cf3 100644
--- a/core/lib/Drupal/Core/Condition/ConditionPluginBase.php
+++ b/core/lib/Drupal/Core/Condition/ConditionPluginBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Condition;
 
 use Drupal\Core\Executable\ExecutablePluginBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides a basis for fulfilling contexts for condition plugins.
@@ -46,7 +47,7 @@ public function isNegated() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form['negate'] = array(
       '#type' => 'checkbox',
       '#title' => $this->t('Negate the condition.'),
@@ -58,13 +59,13 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateConfigurationForm(array &$form, array &$form_state) {
+  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['negate'] = $form_state['values']['negate'];
   }
 
diff --git a/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php b/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php
index 3729f2d..ef02177 100644
--- a/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php
+++ b/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Form\FormInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Defines a class to build a draggable listing of configuration entities.
@@ -102,7 +103,7 @@ public function render() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form[$this->entitiesKey] = array(
       '#type' => 'table',
       '#header' => $this->buildHeader(),
@@ -138,14 +139,14 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     // No validation.
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     foreach ($form_state['values'][$this->entitiesKey] as $id => $value) {
       if (isset($this->entities[$id]) && $this->entities[$id]->get($this->weightKey) != $value['weight']) {
         // Save entity only when its weight was changed.
diff --git a/core/lib/Drupal/Core/Controller/FormController.php b/core/lib/Drupal/Core/Controller/FormController.php
index a8c44e5..95e3eb5 100644
--- a/core/lib/Drupal/Core/Controller/FormController.php
+++ b/core/lib/Drupal/Core/Controller/FormController.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\DependencyInjection\DependencySerializationTrait;
 use Drupal\Core\Form\FormBuilderInterface;
+use Drupal\Core\Form\FormState;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -66,7 +67,7 @@ public function getContentResult(Request $request) {
 
     // Add the form and form_state to trick the getArguments method of the
     // controller resolver.
-    $form_state = array();
+    $form_state = new FormState();
     $request->attributes->set('form', array());
     $request->attributes->set('form_state', $form_state);
     $args = $this->controllerResolver->getArguments($request, array($form_object, 'buildForm'));
diff --git a/core/lib/Drupal/Core/Display/VariantBase.php b/core/lib/Drupal/Core/Display/VariantBase.php
index ef7346d..b39d9b3 100644
--- a/core/lib/Drupal/Core/Display/VariantBase.php
+++ b/core/lib/Drupal/Core/Display/VariantBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Display;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\PluginBase;
 use Drupal\Core\Plugin\PluginDependencyTrait;
 use Drupal\Core\Session\AccountInterface;
@@ -100,7 +101,7 @@ public function calculateDependencies() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form['label'] = array(
       '#type' => 'textfield',
       '#title' => $this->t('Label'),
@@ -114,13 +115,13 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateConfigurationForm(array &$form, array &$form_state) {
+  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['label'] = $form_state['values']['label'];
   }
 
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php b/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
index 686cdae..fc5bd8e 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Form\ConfirmFormHelper;
 use Drupal\Core\Form\ConfirmFormInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides a generic base class for an entity-based confirmation form.
@@ -53,7 +54,7 @@ public function getFormName() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form = parent::buildForm($form, $form_state);
 
     $form['#title'] = $this->getQuestion();
@@ -72,7 +73,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     // Do not attach fields to the confirm form.
     return $form;
   }
@@ -80,7 +81,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->getConfirmText();
     unset($actions['delete']);
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityForm.php b/core/lib/Drupal/Core/Entity/ContentEntityForm.php
index 8722a9c..d2fc480 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityForm.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Entity;
 
 use Drupal\Core\Entity\Display\EntityFormDisplayInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\entity\Entity\EntityFormDisplay;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -47,7 +48,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form = parent::form($form, $form_state);
     $this->getFormDisplay($form_state)->buildForm($this->entity, $form, $form_state);
     return $form;
@@ -56,7 +57,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     $this->updateFormLangcode($form_state);
     $entity = $this->buildEntity($form, $form_state);
     $this->getFormDisplay($form_state)->validateFormValues($entity, $form, $form_state);
@@ -70,7 +71,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * Initialize the form state and the entity before the first form build.
    */
-  protected function init(array &$form_state) {
+  protected function init(FormStateInterface $form_state) {
     // Ensure we act on the translation object corresponding to the current form
     // language.
     $langcode = $this->getFormLangcode($form_state);
@@ -85,7 +86,7 @@ protected function init(array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function getFormLangcode(array &$form_state) {
+  public function getFormLangcode(FormStateInterface $form_state) {
     if (empty($form_state['langcode'])) {
       // Imply a 'view' operation to ensure users edit entities in the same
       // language they are displayed. This allows to keep contextual editing
@@ -98,14 +99,14 @@ public function getFormLangcode(array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function isDefaultFormLangcode(array $form_state) {
+  public function isDefaultFormLangcode(FormStateInterface $form_state) {
     return $this->getFormLangcode($form_state) == $this->entity->getUntranslated()->language()->id;
   }
 
   /**
    * {@inheritdoc}
    */
-  protected function copyFormValuesToEntity(EntityInterface $entity, array $form, array &$form_state) {
+  protected function copyFormValuesToEntity(EntityInterface $entity, array $form, FormStateInterface $form_state) {
     // First, extract values from widgets.
     $extracted = $this->getFormDisplay($form_state)->extractFormValues($entity, $form, $form_state);
 
@@ -122,14 +123,14 @@ protected function copyFormValuesToEntity(EntityInterface $entity, array $form,
   /**
    * {@inheritdoc}
    */
-  public function getFormDisplay(array $form_state) {
+  public function getFormDisplay(FormStateInterface $form_state) {
     return isset($form_state['form_display']) ? $form_state['form_display'] : NULL;
   }
 
   /**
    * {@inheritdoc}
    */
-  public function setFormDisplay(EntityFormDisplayInterface $form_display, array &$form_state) {
+  public function setFormDisplay(EntityFormDisplayInterface $form_display, FormStateInterface $form_state) {
     $form_state['form_display'] = $form_display;
     return $this;
   }
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityFormInterface.php b/core/lib/Drupal/Core/Entity/ContentEntityFormInterface.php
index c006306..4d5cf4d 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityFormInterface.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityFormInterface.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Entity;
 
 use Drupal\Core\Entity\Display\EntityFormDisplayInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Defines a common interface for content entity form classes.
@@ -17,13 +18,13 @@
   /**
    * Returns the form display.
    *
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return \Drupal\Core\Entity\Display\EntityFormDisplayInterface.
    *   The current form display.
    */
-  public function getFormDisplay(array $form_state);
+  public function getFormDisplay(FormStateInterface $form_state);
 
   /**
    * Sets the form display.
@@ -33,9 +34,9 @@ public function getFormDisplay(array $form_state);
    *
    * @param \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display
    *   The form display that the current form operates with.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    */
-  public function setFormDisplay(EntityFormDisplayInterface $form_display, array &$form_state);
+  public function setFormDisplay(EntityFormDisplayInterface $form_display, FormStateInterface $form_state);
 
 }
diff --git a/core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php b/core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php
index 7d8e3b5..4ecc887 100644
--- a/core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php
+++ b/core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Entity\Display;
 
 use Drupal\Core\Entity\ContentEntityInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides a common interface for entity form displays.
@@ -93,10 +94,10 @@
    *   $form_state['values']. If not specified, $form['#parents'] is set to an
    *   empty array, which results in field values located at the top-level of
    *   $form_state['values'].
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state.
    */
-  public function buildForm(ContentEntityInterface $entity, array &$form, array &$form_state);
+  public function buildForm(ContentEntityInterface $entity, array &$form, FormStateInterface $form_state);
 
   /**
    * Validates submitted widget values and sets the corresponding form errors.
@@ -122,10 +123,10 @@ public function buildForm(ContentEntityInterface $entity, array &$form, array &$
    * @param array $form
    *   The form structure where field elements are attached to. This might be a
    *   full form structure, or a sub-element of a larger form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state.
    */
-  public function validateFormValues(ContentEntityInterface $entity, array &$form, array &$form_state);
+  public function validateFormValues(ContentEntityInterface $entity, array &$form, FormStateInterface $form_state);
 
   /**
    * Extracts field values from the submitted widget values into the entity.
@@ -138,7 +139,7 @@ public function validateFormValues(ContentEntityInterface $entity, array &$form,
    * @param array $form
    *   The form structure where field elements are attached to. This might be a
    *   full form structure, or a sub-element of a larger form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state.
    *
    * @return array
@@ -147,6 +148,6 @@ public function validateFormValues(ContentEntityInterface $entity, array &$form,
    *   any, do not correspond to widgets and should be extracted manually by
    *   the caller if needed.
    */
-  public function extractFormValues(ContentEntityInterface $entity, array &$form, array &$form_state);
+  public function extractFormValues(ContentEntityInterface $entity, array &$form, FormStateInterface $form_state);
 
 }
diff --git a/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php b/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
index a86d646..d01d4af 100644
--- a/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Form\ConfirmFormHelper;
 use Drupal\Core\Form\ConfirmFormInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -56,7 +57,7 @@ public function getFormName() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form = parent::buildForm($form, $form_state);
 
     $form['#title'] = $this->getQuestion();
@@ -75,7 +76,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->getConfirmText();
     unset($actions['delete']);
diff --git a/core/lib/Drupal/Core/Entity/EntityForm.php b/core/lib/Drupal/Core/Entity/EntityForm.php
index dcb9aae..89362ae 100644
--- a/core/lib/Drupal/Core/Entity/EntityForm.php
+++ b/core/lib/Drupal/Core/Entity/EntityForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 
 /**
@@ -87,7 +88,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // During the initial form build, add this controller to the form state and
     // allow for initial preparation before form building and processing.
     if (!isset($form_state['controller'])) {
@@ -109,13 +110,13 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
   /**
    * Initialize the form state and the entity before the first form build.
    */
-  protected function init(array &$form_state) {
+  protected function init(FormStateInterface $form_state) {
     // Add the controller to the form state so it can be easily accessed by
     // module-provided form handlers there.
     $form_state['controller'] = $this;
@@ -133,7 +134,7 @@ protected function init(array &$form_state) {
    *
    * @see \Drupal\Core\Entity\EntityForm::build()
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $entity = $this->entity;
 
     // Add a process callback.
@@ -156,7 +157,7 @@ public function form(array $form, array &$form_state) {
    *
    * @see \Drupal\Core\Entity\EntityForm::form()
    */
-  public function processForm($element, $form_state, $form) {
+  public function processForm($element, FormStateInterface $form_state, $form) {
     // If the form is cached, process callbacks may not have a valid reference
     // to the entity object, hence we must restore it.
     $this->entity = $form_state['controller']->getEntity();
@@ -167,7 +168,7 @@ public function processForm($element, $form_state, $form) {
   /**
    * Returns the action form element for the current entity form.
    */
-  protected function actionsElement(array $form, array &$form_state) {
+  protected function actionsElement(array $form, FormStateInterface $form_state) {
     $element = $this->actions($form, $form_state);
 
     if (isset($element['delete'])) {
@@ -204,7 +205,7 @@ protected function actionsElement(array $form, array &$form_state) {
    * @todo Consider introducing a 'preview' action here, since it is used by
    *   many entity types.
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     // @todo Rename the action key from submit to save.
     $actions['submit'] = array(
       '#type' => 'submit',
@@ -242,7 +243,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     $this->updateFormLangcode($form_state);
     // @todo Remove this.
     // Execute legacy global validation handlers.
@@ -261,10 +262,10 @@ public function validate(array $form, array &$form_state) {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A reference to a keyed array containing the current state of the form.
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     // Remove button and internal Form API values from submitted values.
     form_state_values_clean($form_state);
     $this->entity = $this->buildEntity($form, $form_state);
@@ -276,24 +277,24 @@ public function submit(array $form, array &$form_state) {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A reference to a keyed array containing the current state of the form.
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     // @todo Perform common save operations.
   }
 
   /**
    * {@inheritdoc}
    */
-  public function getFormLangcode(array &$form_state) {
+  public function getFormLangcode(FormStateInterface $form_state) {
     return $this->entity->language()->id;
   }
 
   /**
    * {@inheritdoc}
    */
-  public function isDefaultFormLangcode(array $form_state) {
+  public function isDefaultFormLangcode(FormStateInterface $form_state) {
     // The entity is not translatable, this is always the default language.
     return TRUE;
   }
@@ -301,10 +302,10 @@ public function isDefaultFormLangcode(array $form_state) {
   /**
    * Updates the form language to reflect any change to the entity language.
    *
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A reference to a keyed array containing the current state of the form.
    */
-  protected function updateFormLangcode(array &$form_state) {
+  protected function updateFormLangcode(FormStateInterface $form_state) {
     // Update the form language as it might have changed.
     if (isset($form_state['values']['langcode']) && $this->isDefaultFormLangcode($form_state)) {
       $form_state['langcode'] = $form_state['values']['langcode'];
@@ -314,7 +315,7 @@ protected function updateFormLangcode(array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function buildEntity(array $form, array &$form_state) {
+  public function buildEntity(array $form, FormStateInterface $form_state) {
     $entity = clone $this->entity;
     // If you submit a form, the form state comes from caching, which forces
     // the controller to be the one before caching. Ensure to have the
@@ -327,7 +328,7 @@ public function buildEntity(array $form, array &$form_state) {
     // properties.
     if (isset($form['#entity_builders'])) {
       foreach ($form['#entity_builders'] as $function) {
-        call_user_func_array($function, array($entity->getEntityTypeId(), $entity, &$form, &$form_state));
+        call_user_func_array($function, array($entity->getEntityTypeId(), $entity, &$form, $form_state));
       }
     }
 
@@ -344,10 +345,10 @@ public function buildEntity(array $form, array &$form_state) {
    *   The entity the current form should operate upon.
    * @param array $form
    *   A nested array of form elements comprising the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    */
-  protected function copyFormValuesToEntity(EntityInterface $entity, array $form, array &$form_state) {
+  protected function copyFormValuesToEntity(EntityInterface $entity, array $form, FormStateInterface $form_state) {
     // @todo: This relies on a method that only exists for config and content
     //   entities, in a different way. Consider moving this logic to a config
     //   entity specific implementation.
@@ -381,17 +382,17 @@ protected function prepareEntity() {}
    *
    * @param string $hook
    *   The hook variant name.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    */
-  protected function prepareInvokeAll($hook, array &$form_state) {
+  protected function prepareInvokeAll($hook, FormStateInterface $form_state) {
     $implementations = $this->moduleHandler->getImplementations($hook);
     foreach ($implementations as $module) {
       $function = $module . '_' . $hook;
       if (function_exists($function)) {
         // Ensure we pass an updated translation object and form display at
         // each invocation, since they depend on form state which is alterable.
-        $args = array($this->entity, $this->operation, &$form_state);
+        $args = array($this->entity, $this->operation, $form_state);
         call_user_func_array($function, $args);
       }
     }
diff --git a/core/lib/Drupal/Core/Entity/EntityFormBuilder.php b/core/lib/Drupal/Core/Entity/EntityFormBuilder.php
index c875754..045a3f9 100644
--- a/core/lib/Drupal/Core/Entity/EntityFormBuilder.php
+++ b/core/lib/Drupal/Core/Entity/EntityFormBuilder.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Entity;
 
 use Drupal\Core\Form\FormBuilderInterface;
+use Drupal\Core\Form\FormState;
 
 /**
  * Builds entity forms.
@@ -44,10 +45,11 @@ public function __construct(EntityManagerInterface $entity_manager, FormBuilderI
   /**
    * {@inheritdoc}
    */
-  public function getForm(EntityInterface $entity, $operation = 'default', array $form_state = array()) {
+  public function getForm(EntityInterface $entity, $operation = 'default', $form_state_additions = array()) {
     $form_object = $this->entityManager->getFormObject($entity->getEntityTypeId(), $operation);
     $form_object->setEntity($entity);
 
+    $form_state = new FormState($form_state_additions);
     $form_state['build_info']['callback_object'] = $form_object;
     $form_state['build_info']['base_form_id'] = $form_object->getBaseFormID();
     $form_state['build_info'] += array('args' => array());
diff --git a/core/lib/Drupal/Core/Entity/EntityFormBuilderInterface.php b/core/lib/Drupal/Core/Entity/EntityFormBuilderInterface.php
index 888abdb..d980758 100644
--- a/core/lib/Drupal/Core/Entity/EntityFormBuilderInterface.php
+++ b/core/lib/Drupal/Core/Entity/EntityFormBuilderInterface.php
@@ -24,9 +24,9 @@
    *   _entity_form: node.book_outline
    *   @endcode
    *   where "book_outline" is the value of $operation.
-   * @param array $form_state
-   *   (optional) An associative array containing the current state of the form.
-   *   Use this to pass additional information to the form, such as the
+   * @param array $form_state_additions
+   *   (optional) An associative array used to build the current state of the
+   *   form. Use this to pass additional information to the form, such as the
    *   langcode. Defaults to an empty array.
    *
    * @code
@@ -37,6 +37,6 @@
    * @return array
    *   The processed form for the given entity and operation.
    */
-  public function getForm(EntityInterface $entity, $operation = 'default', array $form_state = array());
+  public function getForm(EntityInterface $entity, $operation = 'default', $form_state_additions = array());
 
 }
diff --git a/core/lib/Drupal/Core/Entity/EntityFormInterface.php b/core/lib/Drupal/Core/Entity/EntityFormInterface.php
index f1aeaa8..548235f 100644
--- a/core/lib/Drupal/Core/Entity/EntityFormInterface.php
+++ b/core/lib/Drupal/Core/Entity/EntityFormInterface.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\BaseFormIdInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\StringTranslation\TranslationInterface;
 
 /**
@@ -19,24 +20,24 @@
   /**
    * Returns the code identifying the active form language.
    *
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return string
    *   The form language code.
    */
-  public function getFormLangcode(array &$form_state);
+  public function getFormLangcode(FormStateInterface $form_state);
 
   /**
    * Checks whether the current form language matches the entity one.
    *
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A keyed array containing the current state of the form.
    *
    * @return boolean
    *   Returns TRUE if the entity form language matches the entity one.
    */
-  public function isDefaultFormLangcode(array $form_state);
+  public function isDefaultFormLangcode(FormStateInterface $form_state);
 
   /**
    * Sets the operation for this form.
@@ -61,8 +62,8 @@ public function getOperation();
    *
    * The form entity which has been used for populating form element defaults.
    *
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return \Drupal\Core\Entity\EntityInterface
    *   The current form entity.
@@ -96,23 +97,23 @@ public function setEntity(EntityInterface $entity);
    *
    * @param array $form
    *   A nested array form elements comprising the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return \Drupal\Core\Entity\EntityInterface
    *   An updated copy of the form's entity object.
    */
-  public function buildEntity(array $form, array &$form_state);
+  public function buildEntity(array $form, FormStateInterface $form_state);
 
   /**
    * Validates the submitted form values of the entity form.
    *
    * @param array $form
    *   A nested array form elements comprising the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    */
-  public function validate(array $form, array &$form_state);
+  public function validate(array $form, FormStateInterface $form_state);
 
   /**
    * Updates the form's entity by processing this submission's values.
@@ -123,10 +124,10 @@ public function validate(array $form, array &$form_state);
    *
    * @param array $form
    *   A nested array form elements comprising the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    */
-  public function submit(array $form, array &$form_state);
+  public function submit(array $form, FormStateInterface $form_state);
 
   /**
    * Sets the string translation service for this form.
diff --git a/core/lib/Drupal/Core/Field/FieldItemBase.php b/core/lib/Drupal/Core/Field/FieldItemBase.php
index 296c468..ec58a7a 100644
--- a/core/lib/Drupal/Core/Field/FieldItemBase.php
+++ b/core/lib/Drupal/Core/Field/FieldItemBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Field;
 
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\TypedData\DataDefinitionInterface;
 use Drupal\Core\TypedData\Plugin\DataType\Map;
 use Drupal\Core\TypedData\TypedDataInterface;
@@ -244,14 +245,14 @@ public function deleteRevision() { }
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array &$form, array &$form_state, $has_data) {
+  public function settingsForm(array &$form, FormStateInterface $form_state, $has_data) {
     return array();
   }
 
   /**
    * {@inheritdoc}
    */
-  public function instanceSettingsForm(array $form, array &$form_state) {
+  public function instanceSettingsForm(array $form, FormStateInterface $form_state) {
     return array();
   }
 
diff --git a/core/lib/Drupal/Core/Field/FieldItemInterface.php b/core/lib/Drupal/Core/Field/FieldItemInterface.php
index ee27996..76fb44e 100644
--- a/core/lib/Drupal/Core/Field/FieldItemInterface.php
+++ b/core/lib/Drupal/Core/Field/FieldItemInterface.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\TypedData\ComplexDataInterface;
 
 /**
@@ -245,7 +246,7 @@ public static function defaultInstanceSettings();
    *
    * @param array $form
    *   The form where the settings form is being included in.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state of the (entire) configuration form.
    * @param bool $has_data
    *   TRUE if the field already has data, FALSE if not.
@@ -253,7 +254,7 @@ public static function defaultInstanceSettings();
    * @return
    *   The form definition for the field settings.
    */
-  public function settingsForm(array &$form, array &$form_state, $has_data);
+  public function settingsForm(array &$form, FormStateInterface $form_state, $has_data);
 
   /**
    * Returns a form for the instance-level settings.
@@ -263,12 +264,12 @@ public function settingsForm(array &$form, array &$form_state, $has_data);
    *
    * @param array $form
    *   The form where the settings form is being included in.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state of the (entire) configuration form.
    *
    * @return array
    *   The form definition for the field instance settings.
    */
-  public function instanceSettingsForm(array $form, array &$form_state);
+  public function instanceSettingsForm(array $form, FormStateInterface $form_state);
 
 }
diff --git a/core/lib/Drupal/Core/Field/FieldItemList.php b/core/lib/Drupal/Core/Field/FieldItemList.php
index 0c6559c..726572f 100644
--- a/core/lib/Drupal/Core/Field/FieldItemList.php
+++ b/core/lib/Drupal/Core/Field/FieldItemList.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\Core\Session\AccountInterface;
@@ -301,7 +302,7 @@ public function getConstraints() {
   /**
    * {@inheritdoc}
    */
-  public function defaultValuesForm(array &$form, array &$form_state) {
+  public function defaultValuesForm(array &$form, FormStateInterface $form_state) {
     if (empty($this->getFieldDefinition()->default_value_function)) {
       // Place the input in a separate place in the submitted values tree.
       $widget = $this->defaultValueWidget($form_state);
@@ -316,7 +317,7 @@ public function defaultValuesForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function defaultValuesFormValidate(array $element, array &$form, array &$form_state) {
+  public function defaultValuesFormValidate(array $element, array &$form, FormStateInterface $form_state) {
     // Extract the submitted value, and validate it.
     $widget = $this->defaultValueWidget($form_state);
     $widget->extractFormValues($this, $element, $form_state);
@@ -331,7 +332,7 @@ public function defaultValuesFormValidate(array $element, array &$form, array &$
   /**
    * {@inheritdoc}
    */
-  public function defaultValuesFormSubmit(array $element, array &$form, array &$form_state) {
+  public function defaultValuesFormSubmit(array $element, array &$form, FormStateInterface $form_state) {
     // Extract the submitted value, and return it as an array.
     $widget = $this->defaultValueWidget($form_state);
     $widget->extractFormValues($this, $element, $form_state);
@@ -348,13 +349,13 @@ public static function processDefaultValue($default_value, ContentEntityInterfac
   /**
    * Returns the widget object used in default value form.
    *
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state of the (entire) configuration form.
    *
    * @return \Drupal\Core\Field\WidgetInterface
    *   A Widget object.
    */
-  protected function defaultValueWidget(array &$form_state) {
+  protected function defaultValueWidget(FormStateInterface $form_state) {
     if (!isset($form_state['default_value_widget'])) {
       $entity = $this->getEntity();
 
diff --git a/core/lib/Drupal/Core/Field/FieldItemListInterface.php b/core/lib/Drupal/Core/Field/FieldItemListInterface.php
index 0a1583b..ddfe26b 100644
--- a/core/lib/Drupal/Core/Field/FieldItemListInterface.php
+++ b/core/lib/Drupal/Core/Field/FieldItemListInterface.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Field;
 
 use Drupal\Core\Entity\ContentEntityInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Access\AccessibleInterface;
 use Drupal\Core\TypedData\ListInterface;
@@ -188,13 +189,13 @@ public function view($display_options = array());
    *
    * @param array $form
    *   The form where the settings form is being included in.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state of the (entire) configuration form.
    *
    * @return array
    *   The form definition for the field instance default value.
    */
-  public function defaultValuesForm(array &$form, array &$form_state);
+  public function defaultValuesForm(array &$form, FormStateInterface $form_state);
 
   /**
    * Validates the submitted default value.
@@ -206,10 +207,10 @@ public function defaultValuesForm(array &$form, array &$form_state);
    *   The default value form element.
    * @param array $form
    *   The form where the settings form is being included in.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state of the (entire) configuration form.
    */
-  public function defaultValuesFormValidate(array $element, array &$form, array &$form_state);
+  public function defaultValuesFormValidate(array $element, array &$form, FormStateInterface $form_state);
 
   /**
    * Processes the submitted default value.
@@ -221,13 +222,13 @@ public function defaultValuesFormValidate(array $element, array &$form, array &$
    *   The default value form element.
    * @param array $form
    *   The form where the settings form is being included in.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state of the (entire) configuration form.
    *
    * @return array
    *   The field instance default value.
    */
-  public function defaultValuesFormSubmit(array $element, array &$form, array &$form_state);
+  public function defaultValuesFormSubmit(array $element, array &$form, FormStateInterface $form_state);
 
   /**
    * Processes the default value before being applied.
diff --git a/core/lib/Drupal/Core/Field/FormatterBase.php b/core/lib/Drupal/Core/Field/FormatterBase.php
index ed309a9..a3ad53e 100644
--- a/core/lib/Drupal/Core/Field/FormatterBase.php
+++ b/core/lib/Drupal/Core/Field/FormatterBase.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\Core\Field;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Base class for 'Field formatter' plugin implementations.
  *
@@ -106,7 +108,7 @@ public function view(FieldItemListInterface $items) {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     return array();
   }
 
diff --git a/core/lib/Drupal/Core/Field/FormatterInterface.php b/core/lib/Drupal/Core/Field/FormatterInterface.php
index 9db9857..8596e6b 100644
--- a/core/lib/Drupal/Core/Field/FormatterInterface.php
+++ b/core/lib/Drupal/Core/Field/FormatterInterface.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\Core\Field;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Interface definition for field formatter plugins.
  *
@@ -23,13 +25,13 @@
    *
    * @param array $form
    *   The form where the settings form is being included in.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return array
    *   The form elements for the formatter settings.
    */
-  public function settingsForm(array $form, array &$form_state);
+  public function settingsForm(array $form, FormStateInterface $form_state);
 
   /**
    * Returns a short summary for the current formatter settings.
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/DecimalFormatter.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/DecimalFormatter.php
index 4a0436b..0e43ac1 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/DecimalFormatter.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/DecimalFormatter.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\Core\Field\Plugin\Field\FieldFormatter;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Plugin implementation of the 'number_decimal' formatter.
  *
@@ -40,7 +42,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $elements = parent::settingsForm($form, $form_state);
 
     $elements['decimal_separator'] = array(
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php
index cc360b9..dc0fe82 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FormatterBase;
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Parent plugin for decimal and integer formatters.
@@ -18,7 +19,7 @@
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $options = array(
       ''  => t('- None -'),
       '.' => t('Decimal point'),
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php
index 10d03b3..3f371fb 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Field\Plugin\Field\FieldType;
 
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\TypedData\DataDefinition;
 
 /**
@@ -63,7 +64,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array &$form, array &$form_state, $has_data) {
+  public function settingsForm(array &$form, FormStateInterface $form_state, $has_data) {
     $element = array();
     $settings = $this->getSettings();
 
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/NumericItemBase.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/NumericItemBase.php
index 41a7032..28846bb 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/NumericItemBase.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/NumericItemBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Field\Plugin\Field\FieldType;
 
 use Drupal\Core\Field\FieldItemBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Base class for numeric configurable field types.
@@ -29,7 +30,7 @@ public static function defaultInstanceSettings() {
   /**
    * {@inheritdoc}
    */
-  public function instanceSettingsForm(array $form, array &$form_state) {
+  public function instanceSettingsForm(array $form, FormStateInterface $form_state) {
     $element = array();
     $settings = $this->getSettings();
 
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EmailDefaultWidget.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EmailDefaultWidget.php
index 15bc2cc..ce60ebc 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EmailDefaultWidget.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EmailDefaultWidget.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'email_default' widget.
@@ -35,7 +36,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['placeholder'] = array(
       '#type' => 'textfield',
       '#title' => t('Placeholder'),
@@ -65,7 +66,7 @@ public function settingsSummary() {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $element['value'] = $element + array(
       '#type' => 'email',
       '#default_value' => isset($items[$delta]->value) ? $items[$delta]->value : NULL,
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/NumberWidget.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/NumberWidget.php
index fa31ce7..0f5020c 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/NumberWidget.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/NumberWidget.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\Validator\ConstraintViolationInterface;
 
 /**
@@ -38,7 +39,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['placeholder'] = array(
       '#type' => 'textfield',
       '#title' => t('Placeholder'),
@@ -68,7 +69,7 @@ public function settingsSummary() {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $value = isset($items[$delta]->value) ? $items[$delta]->value : NULL;
     $field_settings = $this->getFieldSettings();
 
@@ -113,7 +114,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
   /**
    * {@inheritdoc}
    */
-  public function errorElement(array $element, ConstraintViolationInterface $error, array $form, array &$form_state) {
+  public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state) {
     return $element['value'];
   }
 
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php
index fae98b1..8658dd0 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'string_textarea' widget.
@@ -36,7 +37,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['rows'] = array(
       '#type' => 'number',
       '#title' => t('Rows'),
@@ -71,7 +72,7 @@ public function settingsSummary() {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $element['value'] = $element + array(
       '#type' => 'textarea',
       '#default_value' => $items[$delta]->value,
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringWidget.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringWidget.php
index ed1d928..853e661 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringWidget.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringWidget.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'string' widget.
@@ -36,7 +37,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['size'] = array(
       '#type' => 'number',
       '#title' => t('Size of textfield'),
@@ -71,7 +72,7 @@ public function settingsSummary() {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $element['value'] = $element + array(
       '#type' => 'textfield',
       '#default_value' => isset($items[$delta]->value) ? $items[$delta]->value : NULL,
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/UriWidget.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/UriWidget.php
index 39606c6..8be947c 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/UriWidget.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/UriWidget.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'uri' widget.
@@ -36,7 +37,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['size'] = array(
       '#type' => 'number',
       '#title' => $this->t('Size of URI field'),
@@ -71,7 +72,7 @@ public function settingsSummary() {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $element['value'] = $element + array(
       '#type' => 'url',
       '#default_value' => isset($items[$delta]->value) ? $items[$delta]->value : NULL,
diff --git a/core/lib/Drupal/Core/Field/WidgetBase.php b/core/lib/Drupal/Core/Field/WidgetBase.php
index 1fe4939..3212d04 100644
--- a/core/lib/Drupal/Core/Field/WidgetBase.php
+++ b/core/lib/Drupal/Core/Field/WidgetBase.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Component\Utility\SortArray;
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\Validator\ConstraintViolationInterface;
 use Symfony\Component\Validator\ConstraintViolationListInterface;
 
@@ -58,7 +59,7 @@ public function __construct($plugin_id, $plugin_definition, FieldDefinitionInter
   /**
    * {@inheritdoc}
    */
-  public function form(FieldItemListInterface $items, array &$form, array &$form_state, $get_delta = NULL) {
+  public function form(FieldItemListInterface $items, array &$form, FormStateInterface $form_state, $get_delta = NULL) {
     $field_name = $this->fieldDefinition->getName();
     $parents = $form['#parents'];
 
@@ -140,7 +141,7 @@ public function form(FieldItemListInterface $items, array &$form, array &$form_s
    * - AHAH-'add more' button
    * - table display and drag-n-drop value reordering
    */
-  protected function formMultipleElements(FieldItemListInterface $items, array &$form, array &$form_state) {
+  protected function formMultipleElements(FieldItemListInterface $items, array &$form, FormStateInterface $form_state) {
     $field_name = $this->fieldDefinition->getName();
     $cardinality = $this->fieldDefinition->getFieldStorageDefinition()->getCardinality();
     $parents = $form['#parents'];
@@ -238,7 +239,7 @@ protected function formMultipleElements(FieldItemListInterface $items, array &$f
    * This stores the final location of the field within the form structure so
    * that flagErrors() can assign validation errors to the right form element.
    */
-  public static function afterBuild(array $element, array &$form_state) {
+  public static function afterBuild(array $element, FormStateInterface $form_state) {
     $parents = $element['#field_parents'];
     $field_name = $element['#field_name'];
 
@@ -252,7 +253,7 @@ public static function afterBuild(array $element, array &$form_state) {
   /**
    * Submission handler for the "Add another item" button.
    */
-  public static function addMoreSubmit(array $form, array &$form_state) {
+  public static function addMoreSubmit(array $form, FormStateInterface $form_state) {
     $button = $form_state['triggering_element'];
 
     // Go one level up in the form, to the widgets container.
@@ -274,7 +275,7 @@ public static function addMoreSubmit(array $form, array &$form_state) {
    * This returns the new page content to replace the page content made obsolete
    * by the form submission.
    */
-  public static function addMoreAjax(array $form, array $form_state) {
+  public static function addMoreAjax(array $form, $form_state) {
     $button = $form_state['triggering_element'];
 
     // Go one level up in the form, to the widgets container.
@@ -296,7 +297,7 @@ public static function addMoreAjax(array $form, array $form_state) {
   /**
    * Generates the form element for a single copy of the widget.
    */
-  protected function formSingleElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  protected function formSingleElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $entity = $items->getEntity();
 
     $element += array(
@@ -327,7 +328,7 @@ protected function formSingleElement(FieldItemListInterface $items, $delta, arra
   /**
    * {@inheritdoc}
    */
-  public function extractFormValues(FieldItemListInterface $items, array $form, array &$form_state) {
+  public function extractFormValues(FieldItemListInterface $items, array $form, FormStateInterface $form_state) {
     $field_name = $this->fieldDefinition->getName();
 
     // Extract the values from $form_state['values'].
@@ -372,7 +373,7 @@ public function extractFormValues(FieldItemListInterface $items, array $form, ar
   /**
    * {@inheritdoc}
    */
-  public function flagErrors(FieldItemListInterface $items, ConstraintViolationListInterface $violations, array $form, array &$form_state) {
+  public function flagErrors(FieldItemListInterface $items, ConstraintViolationListInterface $violations, array $form, FormStateInterface $form_state) {
     $field_name = $this->fieldDefinition->getName();
 
     $field_state = static::getWidgetState($form['#parents'], $field_name, $form_state);
@@ -441,15 +442,15 @@ public function flagErrors(FieldItemListInterface $items, ConstraintViolationLis
   /**
    * {@inheritdoc}
    */
-  public static function getWidgetState(array $parents, $field_name, array &$form_state) {
-    return NestedArray::getValue($form_state, static::getWidgetStateParents($parents, $field_name));
+  public static function getWidgetState(array $parents, $field_name, FormStateInterface $form_state) {
+    return NestedArray::getValue($form_state['storage'], static::getWidgetStateParents($parents, $field_name));
   }
 
   /**
    * {@inheritdoc}
    */
-  public static function setWidgetState(array $parents, $field_name, array &$form_state, array $field_state) {
-    NestedArray::setValue($form_state, static::getWidgetStateParents($parents, $field_name), $field_state);
+  public static function setWidgetState(array $parents, $field_name, FormStateInterface $form_state, array $field_state) {
+    NestedArray::setValue($form_state['storage'], static::getWidgetStateParents($parents, $field_name), $field_state);
   }
 
   /**
@@ -473,7 +474,7 @@ protected static function getWidgetStateParents(array $parents, $field_name) {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     return array();
   }
 
@@ -487,14 +488,14 @@ public function settingsSummary() {
   /**
    * {@inheritdoc}
    */
-  public function errorElement(array $element, ConstraintViolationInterface $error, array $form, array &$form_state) {
+  public function errorElement(array $element, ConstraintViolationInterface $error, array $form, FormStateInterface $form_state) {
     return $element;
   }
 
   /**
    * {@inheritdoc}
    */
-  public function massageFormValues(array $values, array $form, array &$form_state) {
+  public function massageFormValues(array $values, array $form, FormStateInterface $form_state) {
     return $values;
   }
 
diff --git a/core/lib/Drupal/Core/Field/WidgetBaseInterface.php b/core/lib/Drupal/Core/Field/WidgetBaseInterface.php
index f763e28..cfc846d 100644
--- a/core/lib/Drupal/Core/Field/WidgetBaseInterface.php
+++ b/core/lib/Drupal/Core/Field/WidgetBaseInterface.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\Validator\ConstraintViolationListInterface;
 
 /**
@@ -32,7 +33,7 @@
    * @param array $form
    *   An array representing the form that the editing element will be attached
    *   to.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   An array containing the current state of the form.
    * @param int $get_delta
    *   Used to get only a specific delta value of a multiple value field.
@@ -40,7 +41,7 @@
    * @return array
    *   The form element array created for this field.
    */
-  public function form(FieldItemListInterface $items, array &$form, array &$form_state, $get_delta = NULL);
+  public function form(FieldItemListInterface $items, array &$form, FormStateInterface $form_state, $get_delta = NULL);
 
   /**
    * Extracts field values from submitted form values.
@@ -51,10 +52,10 @@ public function form(FieldItemListInterface $items, array &$form, array &$form_s
    * @param array $form
    *   The form structure where field elements are attached to. This might be a
    *   full form structure, or a sub-element of a larger form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state.
    */
-  public function extractFormValues(FieldItemListInterface $items, array $form, array &$form_state);
+  public function extractFormValues(FieldItemListInterface $items, array $form, FormStateInterface $form_state);
 
   /**
    * Reports field-level validation errors against actual form elements.
@@ -66,10 +67,10 @@ public function extractFormValues(FieldItemListInterface $items, array $form, ar
    * @param array $form
    *   The form structure where field elements are attached to. This might be a
    *   full form structure, or a sub-element of a larger form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state.
    */
-  public function flagErrors(FieldItemListInterface $items, ConstraintViolationListInterface $violations, array $form, array &$form_state);
+  public function flagErrors(FieldItemListInterface $items, ConstraintViolationListInterface $violations, array $form, FormStateInterface $form_state);
 
   /**
    * Retrieves processing information about the widget from $form_state.
@@ -80,7 +81,7 @@ public function flagErrors(FieldItemListInterface $items, ConstraintViolationLis
    *   The array of #parents where the field lives in the form.
    * @param string $field_name
    *   The field name.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state.
    *
    * @return array
@@ -89,7 +90,7 @@ public function flagErrors(FieldItemListInterface $items, ConstraintViolationLis
    *   - array_parents: The location of the field's widgets within the $form
    *     structure. This entry is populated at '#after_build' time.
    */
-  public static function getWidgetState(array $parents, $field_name, array &$form_state);
+  public static function getWidgetState(array $parents, $field_name, FormStateInterface $form_state);
 
   /**
    * Stores processing information about the widget in $form_state.
@@ -100,12 +101,12 @@ public static function getWidgetState(array $parents, $field_name, array &$form_
    *   The array of #parents where the widget lives in the form.
    * @param string $field_name
    *   The field name.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state.
    * @param array $field_state
    *   The array of data to store. See getWidgetState() for the structure and
    *   content of the array.
    */
-  public static function setWidgetState(array $parents, $field_name, array &$form_state, array $field_state);
+  public static function setWidgetState(array $parents, $field_name, FormStateInterface $form_state, array $field_state);
 
 }
diff --git a/core/lib/Drupal/Core/Field/WidgetInterface.php b/core/lib/Drupal/Core/Field/WidgetInterface.php
index c4e7022..307d8c1 100644
--- a/core/lib/Drupal/Core/Field/WidgetInterface.php
+++ b/core/lib/Drupal/Core/Field/WidgetInterface.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\Validator\ConstraintViolationInterface;
 
 /**
@@ -30,13 +31,13 @@
    *
    * @param array $form
    *   The form where the settings form is being included in.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return array
    *   The form definition for the widget settings.
    */
-  public function settingsForm(array $form, array &$form_state);
+  public function settingsForm(array $form, FormStateInterface $form_state);
 
   /**
    * Returns a short summary for the current widget settings.
@@ -94,11 +95,11 @@ public function settingsSummary();
    *     required.
    *   - #delta: The order of this item in the array of subelements; see $delta
    *     above.
-   * @param string $form
+   * @param array $form
    *   The form structure where widgets are being attached to. This might be a
    *   full form structure, or a sub-element of a larger form.
-   * @param string $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return array
    *   The form elements for a single widget for this field.
@@ -106,7 +107,7 @@ public function settingsSummary();
    * @see hook_field_widget_form_alter()
    * @see hook_field_widget_WIDGET_TYPE_form_alter()
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state);
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state);
 
   /**
    * Assigns a field-level validation error to the right widget sub-element.
@@ -122,14 +123,14 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
    * @param array $form
    *   The form structure where field elements are attached to. This might be a
    *   full form structure, or a sub-element of a larger form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return array|bool
    *   The element on which the error should be flagged, or FALSE to completely
    *   ignore the violation (use with care!).
    */
-  public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, array &$form_state);
+  public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state);
 
   /**
    * Massages the form values into the format expected for field values.
@@ -144,12 +145,12 @@ public function errorElement(array $element, ConstraintViolationInterface $viola
    * @param array $form
    *   The form structure where field elements are attached to. This might be a
    *   full form structure, or a sub-element of a larger form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state.
    *
    * @return array
    *   An array of field values, keyed by delta.
    */
-  public function massageFormValues(array $values, array $form, array &$form_state);
+  public function massageFormValues(array $values, array $form, FormStateInterface $form_state);
 
 }
diff --git a/core/lib/Drupal/Core/FileTransfer/Form/FileTransferAuthorizeForm.php b/core/lib/Drupal/Core/FileTransfer/Form/FileTransferAuthorizeForm.php
index 765d955..818f345 100644
--- a/core/lib/Drupal/Core/FileTransfer/Form/FileTransferAuthorizeForm.php
+++ b/core/lib/Drupal/Core/FileTransfer/Form/FileTransferAuthorizeForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\FileTransfer\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 
 /**
@@ -25,7 +26,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // If possible, we want to post this form securely via HTTPS.
     $form['#https'] = TRUE;
 
@@ -138,7 +139,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     // Only validate the form if we have collected all of the user input and are
     // ready to proceed with updating or installing.
     if ($form_state['triggering_element']['#name'] != 'process_updates') {
@@ -168,7 +169,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     switch ($form_state['triggering_element']['#name']) {
       case 'process_updates':
 
diff --git a/core/lib/Drupal/Core/Form/ConfigFormBase.php b/core/lib/Drupal/Core/Form/ConfigFormBase.php
index 8ed7403..f58bc11 100644
--- a/core/lib/Drupal/Core/Form/ConfigFormBase.php
+++ b/core/lib/Drupal/Core/Form/ConfigFormBase.php
@@ -36,9 +36,9 @@ public static function create(ContainerInterface $container) {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::buildForm().
+   * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['actions']['#type'] = 'actions';
     $form['actions']['submit'] = array(
       '#type' => 'submit',
@@ -53,9 +53,9 @@ public function buildForm(array $form, array &$form_state) {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::submitForm().
+   * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message($this->t('The configuration options have been saved.'));
   }
 
diff --git a/core/lib/Drupal/Core/Form/ConfirmFormBase.php b/core/lib/Drupal/Core/Form/ConfirmFormBase.php
index d44ab47..2896690 100644
--- a/core/lib/Drupal/Core/Form/ConfirmFormBase.php
+++ b/core/lib/Drupal/Core/Form/ConfirmFormBase.php
@@ -43,7 +43,7 @@ public function getFormName() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['#title'] = $this->getQuestion();
 
     $form['#attributes']['class'][] = 'confirmation';
diff --git a/core/lib/Drupal/Core/Form/FormBase.php b/core/lib/Drupal/Core/Form/FormBase.php
index 8848d3f..85470e7 100644
--- a/core/lib/Drupal/Core/Form/FormBase.php
+++ b/core/lib/Drupal/Core/Form/FormBase.php
@@ -61,7 +61,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     // Validation is optional.
   }
 
@@ -189,8 +189,8 @@ protected function errorHandler() {
    *
    * @param string $name
    *   The name of the form element.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    * @param string $message
    *   (optional) The error message to present to the user.
    *
@@ -198,7 +198,7 @@ protected function errorHandler() {
    *
    * @return $this
    */
-  protected function setFormError($name, array &$form_state, $message = '') {
+  protected function setFormError($name, FormStateInterface $form_state, $message = '') {
     $this->errorHandler()->setErrorByName($name, $form_state, $message);
     return $this;
   }
diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php
index 53ddcb3..db53f5d 100644
--- a/core/lib/Drupal/Core/Form/FormBuilder.php
+++ b/core/lib/Drupal/Core/Form/FormBuilder.php
@@ -17,6 +17,7 @@
 use Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Site\Settings;
+use Drupal\Core\Utility\Error;
 use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 use Symfony\Component\HttpFoundation\RequestStack;
 use Symfony\Component\HttpFoundation\Response;
@@ -133,7 +134,7 @@ public function __construct(FormValidatorInterface $form_validator, FormSubmitte
   /**
    * {@inheritdoc}
    */
-  public function getFormId($form_arg, &$form_state) {
+  public function getFormId($form_arg, FormStateInterface $form_state) {
     // If the $form_arg is the name of a class, instantiate it. Don't allow
     // arbitrary strings to be passed to the class resolver.
     if (is_string($form_arg) && class_exists($form_arg)) {
@@ -156,7 +157,7 @@ public function getFormId($form_arg, &$form_state) {
    * {@inheritdoc}
    */
   public function getForm($form_arg) {
-    $form_state = array();
+    $form_state = new FormState();
 
     $args = func_get_args();
     // Remove $form_arg from the arguments.
@@ -169,9 +170,9 @@ public function getForm($form_arg) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm($form_id, array &$form_state) {
+  public function buildForm($form_id, FormStateInterface $form_state) {
     // Ensure some defaults; if already set they will not be overridden.
-    $form_state += $this->getFormStateDefaults();
+    $form_state->addFormStateDefaults();
 
     // Ensure the form ID is prepared.
     $form_id = $this->getFormId($form_id, $form_state);
@@ -207,19 +208,20 @@ public function buildForm($form_id, array &$form_state) {
       // keys need to be removed after retrieving and preparing the form, except
       // any that were already set prior to retrieving the form.
       if ($check_cache) {
-        $form_state_before_retrieval = $form_state;
+        $form_state_before_retrieval = clone $form_state;
       }
 
       $form = $this->retrieveForm($form_id, $form_state);
       $this->prepareForm($form_id, $form, $form_state);
 
       // self::setCache() removes uncacheable $form_state keys defined in
-      // self::getUncacheableKeys() in order for multi-step forms to work
-      // properly. This means that form processing logic for single-step forms
-      // using $form_state['cache'] may depend on data stored in those keys
-      // during self::retrieveForm()/self::prepareForm(), but form
-      // processing should not depend on whether the form is cached or not, so
-      // $form_state is adjusted to match what it would be after a
+      // \Drupal\Core\Form\FormState::getUncacheableKeys() in order for
+      // multi-step forms to work properly. This means that form processing
+      // logic for single-step forms using $form_state['cache'] may depend on
+      // data stored in those keys during
+      // self::retrieveForm()/self::prepareForm(), but form processing should
+      // not depend on whether the form is cached or not, so $form_state is
+      // adjusted to match what it would be after a
       // self::setCache()/self::getCache() sequence. These exceptions are
       // allowed to survive here:
       // - always_process: Does not make sense in conjunction with form caching
@@ -228,9 +230,9 @@ public function buildForm($form_id, array &$form_state) {
       // - temporary: Any assigned data is expected to survives within the same
       //   page request.
       if ($check_cache) {
-        $uncacheable_keys = array_flip(array_diff($this->getUncacheableKeys(), array('always_process', 'temporary')));
-        $form_state = array_diff_key($form_state, $uncacheable_keys);
-        $form_state += $form_state_before_retrieval;
+        $cache_form_state = $form_state->getCacheableArray(array('always_process', 'temporary'));
+        $form_state = $form_state_before_retrieval;
+        $form_state->setFormState($cache_form_state);
       }
     }
 
@@ -267,36 +269,7 @@ public function buildForm($form_id, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function getFormStateDefaults() {
-    return array(
-      'rebuild' => FALSE,
-      'rebuild_info' => array(),
-      'redirect' => NULL,
-      // @todo 'args' is usually set, so no other default 'build_info' keys are
-      //   appended via += $this->getFormStateDefaults().
-      'build_info' => array(
-        'args' => array(),
-        'files' => array(),
-      ),
-      'temporary' => array(),
-      'validation_complete' => FALSE,
-      'submitted' => FALSE,
-      'executed' => FALSE,
-      'programmed' => FALSE,
-      'programmed_bypass_access_check' => TRUE,
-      'cache'=> FALSE,
-      'method' => 'post',
-      'groups' => array(),
-      'buttons' => array(),
-      'errors' => array(),
-      'limit_validation_errors' => NULL,
-    );
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function rebuildForm($form_id, &$form_state, $old_form = NULL) {
+  public function rebuildForm($form_id, FormStateInterface $form_state, $old_form = NULL) {
     $form = $this->retrieveForm($form_id, $form_state);
 
     // If only parts of the form will be returned to the browser (e.g., Ajax or
@@ -341,13 +314,13 @@ public function rebuildForm($form_id, &$form_state, $old_form = NULL) {
   /**
    * {@inheritdoc}
    */
-  public function getCache($form_build_id, &$form_state) {
+  public function getCache($form_build_id, FormStateInterface $form_state) {
     if ($form = $this->keyValueExpirableFactory->get('form')->get($form_build_id)) {
       $user = $this->currentUser();
       if ((isset($form['#cache_token']) && $this->csrfToken->validate($form['#cache_token'])) || (!isset($form['#cache_token']) && $user->isAnonymous())) {
         if ($stored_form_state = $this->keyValueExpirableFactory->get('form_state')->get($form_build_id)) {
           // Re-populate $form_state for subsequent rebuilds.
-          $form_state = $stored_form_state + $form_state;
+          $form_state->setFormState($stored_form_state);
 
           // If the original form is contained in include files, load the files.
           // @see form_load_include()
@@ -383,47 +356,15 @@ public function setCache($form_build_id, $form, $form_state) {
     }
 
     // Cache form state.
-    if ($data = array_diff_key($form_state, array_flip($this->getUncacheableKeys()))) {
+    if ($data = $form_state->getCacheableArray()) {
       $this->keyValueExpirableFactory->get('form_state')->setWithExpire($form_build_id, $data, $expire);
     }
   }
 
   /**
-   * Returns an array of $form_state keys that shouldn't be cached.
-   */
-  protected function getUncacheableKeys() {
-    return array(
-      // Public properties defined by form constructors and form handlers.
-      'always_process',
-      'must_validate',
-      'rebuild',
-      'rebuild_info',
-      'redirect',
-      'redirect_route',
-      'no_redirect',
-      'temporary',
-      // Internal properties defined by form processing.
-      'buttons',
-      'triggering_element',
-      'complete_form',
-      'groups',
-      'input',
-      'method',
-      'submit_handlers',
-      'validation_complete',
-      'submitted',
-      'executed',
-      'validate_handlers',
-      'values',
-      'errors',
-      'limit_validation_errors',
-    );
-  }
-
-  /**
    * {@inheritdoc}
    */
-  public function submitForm($form_arg, &$form_state) {
+  public function submitForm($form_arg, FormStateInterface $form_state) {
     if (!isset($form_state['build_info']['args'])) {
       $args = func_get_args();
       // Remove $form and $form_state from the arguments.
@@ -431,7 +372,7 @@ public function submitForm($form_arg, &$form_state) {
       $form_state['build_info']['args'] = array_values($args);
     }
     // Merge in default values.
-    $form_state += $this->getFormStateDefaults();
+    $form_state->addFormStateDefaults();
 
     // Populate $form_state['input'] with the submitted values before retrieving
     // the form, to be consistent with what self::buildForm() does for
@@ -457,7 +398,7 @@ public function submitForm($form_arg, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function retrieveForm($form_id, &$form_state) {
+  public function retrieveForm($form_id, FormStateInterface $form_state) {
     // Record the $form_id.
     $form_state['build_info']['form_id'] = $form_id;
 
@@ -497,7 +438,7 @@ public function retrieveForm($form_id, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function processForm($form_id, &$form, &$form_state) {
+  public function processForm($form_id, &$form, FormStateInterface $form_state) {
     $form_state['values'] = array();
 
     // With GET, these forms are always submitted if requested.
@@ -598,7 +539,7 @@ public function processForm($form_id, &$form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function prepareForm($form_id, &$form, &$form_state) {
+  public function prepareForm($form_id, &$form, FormStateInterface $form_state) {
     $user = $this->currentUser();
 
     $form['#type'] = 'form';
@@ -702,7 +643,7 @@ public function prepareForm($form_id, &$form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm($form_id, &$form, &$form_state) {
+  public function validateForm($form_id, &$form, FormStateInterface $form_state) {
     $this->formValidator->validateForm($form_id, $form, $form_state);
   }
 
@@ -716,42 +657,42 @@ public function redirectForm($form_state) {
   /**
    * {@inheritdoc}
    */
-  public function executeValidateHandlers(&$form, &$form_state) {
+  public function executeValidateHandlers(&$form, FormStateInterface $form_state) {
     $this->formValidator->executeValidateHandlers($form, $form_state);
   }
 
   /**
    * {@inheritdoc}
    */
-  public function executeSubmitHandlers(&$form, &$form_state) {
+  public function executeSubmitHandlers(&$form, FormStateInterface $form_state) {
     $this->formSubmitter->executeSubmitHandlers($form, $form_state);
   }
 
   /**
    * {@inheritdoc}
    */
-  public function doSubmitForm(&$form, &$form_state) {
+  public function doSubmitForm(&$form, FormStateInterface $form_state) {
     throw new \LogicException('Use FormBuilderInterface::processForm() instead.');
   }
 
   /**
    * {@inheritdoc}
    */
-  public function setErrorByName($name, array &$form_state, $message = '') {
+  public function setErrorByName($name, FormStateInterface $form_state, $message = '') {
     $this->formValidator->setErrorByName($name, $form_state, $message);
   }
 
   /**
    * {@inheritdoc}
    */
-  public function clearErrors(array &$form_state) {
+  public function clearErrors(FormStateInterface $form_state) {
     $this->formValidator->clearErrors($form_state);
   }
 
   /**
    * {@inheritdoc}
    */
-  public function getErrors(array $form_state) {
+  public function getErrors(FormStateInterface $form_state) {
     return $this->formValidator->getErrors($form_state);
   }
 
@@ -765,21 +706,21 @@ public function getAnyErrors() {
   /**
    * {@inheritdoc}
    */
-  public function getError($element, array &$form_state) {
+  public function getError($element, FormStateInterface $form_state) {
     return $this->formValidator->getError($element, $form_state);
   }
 
   /**
    * {@inheritdoc}
    */
-  public function setError(&$element, array &$form_state, $message = '') {
+  public function setError(&$element, FormStateInterface $form_state, $message = '') {
     $this->formValidator->setError($element, $form_state, $message);
   }
 
   /**
    * {@inheritdoc}
    */
-  public function doBuildForm($form_id, &$element, &$form_state) {
+  public function doBuildForm($form_id, &$element, FormStateInterface $form_state) {
     // Initialize as unprocessed.
     $element['#processed'] = FALSE;
 
@@ -810,7 +751,7 @@ public function doBuildForm($form_id, &$element, &$form_state) {
       // Store a reference to the complete form in $form_state prior to building
       // the form. This allows advanced #process and #after_build callbacks to
       // perform changes elsewhere in the form.
-      $form_state['complete_form'] = &$element;
+      $form_state->setCompleteForm($element);
 
       // Set a flag if we have a correct form submission. This is always TRUE
       // for programmed forms coming from self::submitForm(), or if the form_id
@@ -971,7 +912,7 @@ public function doBuildForm($form_id, &$element, &$form_state) {
   /**
    * Adds the #name and #value properties of an input element before rendering.
    */
-  protected function handleInputElement($form_id, &$element, &$form_state) {
+  protected function handleInputElement($form_id, &$element, FormStateInterface $form_state) {
     if (!isset($element['#name'])) {
       $name = array_shift($element['#parents']);
       $element['#name'] = $name;
@@ -1122,7 +1063,7 @@ protected function handleInputElement($form_id, &$element, &$form_state) {
    * element value. An example where this is needed is if there are several
    * // buttons all named 'op', and only differing in their value.
    */
-  protected function elementTriggeredScriptedSubmission($element, &$form_state) {
+  protected function elementTriggeredScriptedSubmission($element, FormStateInterface $form_state) {
     if (!empty($form_state['input']['_triggering_element_name']) && $element['#name'] == $form_state['input']['_triggering_element_name']) {
       if (empty($form_state['input']['_triggering_element_value']) || $form_state['input']['_triggering_element_value'] == $element['#value']) {
         return TRUE;
@@ -1151,7 +1092,7 @@ protected function elementTriggeredScriptedSubmission($element, &$form_state) {
    * to know which button was clicked should get that information from
    * $form_state['triggering_element'].
    */
-  protected function buttonWasClicked($element, &$form_state) {
+  protected function buttonWasClicked($element, FormStateInterface $form_state) {
     // First detect normal 'vanilla' button clicks. Traditionally, all standard
     // buttons on a form share the same name (usually 'op'), and the specific
     // return value is used to determine which was clicked. This ONLY works as
@@ -1174,7 +1115,7 @@ protected function buttonWasClicked($element, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function setValue($element, $value, &$form_state) {
+  public function setValue($element, $value, FormStateInterface $form_state) {
     NestedArray::setValue($form_state['values'], $element['#parents'], $value, TRUE);
   }
 
diff --git a/core/lib/Drupal/Core/Form/FormBuilderInterface.php b/core/lib/Drupal/Core/Form/FormBuilderInterface.php
index 6f42d14..62b8b17 100644
--- a/core/lib/Drupal/Core/Form/FormBuilderInterface.php
+++ b/core/lib/Drupal/Core/Form/FormBuilderInterface.php
@@ -17,13 +17,13 @@
    *
    * @param \Drupal\Core\Form\FormInterface|string $form_arg
    *   The value is identical to that of self::getForm()'s $form_arg argument.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return string
    *   The unique string identifying the desired form.
    */
-  public function getFormId($form_arg, &$form_state);
+  public function getFormId($form_arg, FormStateInterface $form_state);
 
   /**
    * Gets a renderable form array.
@@ -58,164 +58,12 @@ public function getForm($form_arg);
    * previous page-load. The form is then passed on for processing, validation
    * and submission if there is proper input.
    *
-   * @param \Drupal\Core\Form\FormInterface|string $form_arg
+   * @param \Drupal\Core\Form\FormInterface|string $form_id
    *   The value must be one of the following:
    *   - The name of a class that implements \Drupal\Core\Form\FormInterface.
    *   - An instance of a class that implements \Drupal\Core\Form\FormInterface.
-   * @param array $form_state
-   *   An array which stores information about the form. This is passed as a
-   *   reference so that the caller can use it to examine what in the form
-   *   changed when the form submission process is complete. Furthermore, it may
-   *   be used to store information related to the processed data in the form,
-   *   which will persist across page requests when the 'cache' or 'rebuild'
-   *   flag is set. The following parameters may be set in $form_state to affect
-   *   how the form is rendered:
-   *   - build_info: Internal. An associative array of information stored by
-   *     Form API that is necessary to build and rebuild the form from cache
-   *     when the original context may no longer be available:
-   *     - callback: The actual callback to be used to retrieve the form array.
-   *       Can be any callable. If none is provided $form_id is used as the name
-   *       of a function to call instead.
-   *     - args: A list of arguments to pass to the form constructor.
-   *     - files: An optional array defining include files that need to be
-   *       loaded for building the form. Each array entry may be the path to a
-   *       file or another array containing values for the parameters 'type',
-   *       'module' and 'name' as needed by module_load_include(). The files
-   *       listed here are automatically loaded by form_get_cache(). By default
-   *       the current menu router item's 'file' definition is added, if any.
-   *       Use form_load_include() to add include files from a form constructor.
-   *     - form_id: Identification of the primary form being constructed and
-   *       processed.
-   *     - base_form_id: Identification for a base form, as declared in the form
-  *       class's \Drupal\Core\Form\BaseFormIdInterface::getBaseFormId() method.
-   *   - rebuild_info: Internal. Similar to 'build_info', but pertaining to
-   *     self::rebuildForm().
-   *   - rebuild: Normally, after the entire form processing is completed and
-   *     submit handlers have run, a form is considered to be done and
-   *     self::redirectForm() will redirect the user to a new page using a GET
-   *     request (so a browser refresh does not re-submit the form). However, if
-   *     'rebuild' has been set to TRUE, then a new copy of the form is
-   *     immediately built and sent to the browser, instead of a redirect. This
-   *     is used for multi-step forms, such as wizards and confirmation forms.
-   *     Normally, $form_state['rebuild'] is set by a submit handler, since its
-   *     is usually logic within a submit handler that determines whether a form
-   *     is done or requires another step. However, a validation handler may
-   *     already set $form_state['rebuild'] to cause the form processing to
-   *     bypass submit handlers and rebuild the form instead, even if there are
-   *     no validation errors.
-   *   - response: Used when a form needs to return some kind of a
-   *     \Symfony\Component\HttpFoundation\Response object, e.g., a
-   *     \Symfony\Component\HttpFoundation\BinaryFileResponse when triggering a
-   *     file download. If you use the $form_state['redirect'] key, it will be
-   *     used to build a \Symfony\Component\HttpFoundation\RedirectResponse and
-   *     will populate this key.
-   *   - redirect: Used to redirect the form on submission. It may either be a
-   *     string containing the destination URL, or an array of arguments
-   *     compatible with url(). See url() for complete information.
-   *   - no_redirect: If set to TRUE the form will NOT perform a redirect,
-   *     even if 'redirect' is set.
-   *   - method: The HTTP form method to use for finding the input for this
-   *     form. May be 'post' or 'get'. Defaults to 'post'. Note that 'get'
-   *     method forms do not use form ids so are always considered to be
-   *     submitted, which can have unexpected effects. The 'get' method should
-   *     only be used on forms that do not change data, as that is exclusively
-   *     the domain of 'post.'
-   *   - cache: If set to TRUE the original, unprocessed form structure will be
-   *     cached, which allows the entire form to be rebuilt from cache. A
-   *     typical form workflow involves two page requests; first, a form is
-   *     built and rendered for the user to fill in. Then, the user fills the
-   *     form in and submits it, triggering a second page request in which the
-   *     form must be built and processed. By default, $form and $form_state are
-   *     built from scratch during each of these page requests. Often, it is
-   *     necessary or desired to persist the $form and $form_state variables
-   *     from the initial page request to the one that processes the submission.
-   *     'cache' can be set to TRUE to do this. A prominent example is an
-   *     Ajax-enabled form, in which ajax_process_form() enables form caching
-   *     for all forms that include an element with the #ajax property. (The
-   *     Ajax handler has no way to build the form itself, so must rely on the
-   *     cached version.) Note that the persistence of $form and $form_state
-   *     happens automatically for (multi-step) forms having the 'rebuild' flag
-   *     set, regardless of the value for 'cache'.
-   *   - no_cache: If set to TRUE the form will NOT be cached, even if 'cache'
-   *     is set.
-   *   - values: An associative array of values submitted to the form. The
-   *     validation functions and submit functions use this array for nearly all
-   *     their decision making. (Note that #tree determines whether the values
-   *     are a flat array or an array whose structure parallels the $form array.
-   *     See the @link forms_api_reference.html Form API reference @endlink for
-   *     more information.)
-   *   - input: The array of values as they were submitted by the user. These
-   *     are raw and unvalidated, so should not be used without a thorough
-   *     understanding of security implications. In almost all cases, code
-   *     should use the data in the 'values' array exclusively. The most common
-   *     use of this key is for multi-step forms that need to clear some of the
-   *     user input when setting 'rebuild'. The values correspond to
-   *     \Drupal::request()->request or \Drupal::request()->query, depending on
-   *     the 'method' chosen.
-   *   - always_process: If TRUE and the method is GET, a form_id is not
-   *     necessary. This should only be used on RESTful GET forms that do NOT
-   *     write data, as this could lead to security issues. It is useful so that
-   *     searches do not need to have a form_id in their query arguments to
-   *     trigger the search.
-   *   - must_validate: Ordinarily, a form is only validated once, but there are
-   *     times when a form is resubmitted internally and should be validated
-   *     again. Setting this to TRUE will force that to happen. This is most
-   *     likely to occur during Ajax operations.
-   *   - programmed: If TRUE, the form was submitted programmatically, usually
-   *     invoked via self::submitForm(). Defaults to FALSE.
-   *   - programmed_bypass_access_check: If TRUE, programmatic form submissions
-   *     are processed without taking #access into account. Set this to FALSE
-   *     when submitting a form programmatically with values that may have been
-   *     input by the user executing the current request; this will cause
-   *     #access to be respected as it would on a normal form submission.
-   *     Defaults to TRUE.
-   *   - process_input: Boolean flag. TRUE signifies correct form submission.
-   *     This is always TRUE for programmed forms coming from self::submitForm()
-   *     (see 'programmed' key), or if the form_id coming from the
-   *     \Drupal::request()->request data is set and matches the current form_id.
-   *   - submitted: If TRUE, the form has been submitted. Defaults to FALSE.
-   *   - executed: If TRUE, the form was submitted and has been processed and
-   *     executed. Defaults to FALSE.
-   *   - triggering_element: (read-only) The form element that triggered
-   *     submission, which may or may not be a button (in the case of Ajax
-   *     forms). This key is often used to distinguish between various buttons
-   *     in a submit handler, and is also used in Ajax handlers.
-   *   - has_file_element: Internal. If TRUE, there is a file element and Form
-   *     API will set the appropriate 'enctype' HTML attribute on the form.
-   *   - groups: Internal. An array containing references to details elements to
-   *     render them within vertical tabs.
-   *   - storage: $form_state['storage'] is not a special key, and no specific
-   *     support is provided for it in the Form API. By tradition it was
-   *     the location where application-specific data was stored for
-   *     communication between the submit, validation, and form builder
-   *     functions, especially in a multi-step-style form. Form implementations
-   *     may use any key(s) within $form_state (other than the keys listed here
-   *     and other reserved ones used by Form API internals) for this kind of
-   *     storage. The recommended way to ensure that the chosen key doesn't
-   *     conflict with ones used by the Form API or other modules is to use the
-   *     module name as the key name or a prefix for the key name. For example,
-   *     the entity form classes use $this->entity in entity forms,
-   *     or $form_state['controller']->getEntity() outside the controller, to
-   *     store information about the entity being edited, and this information
-   *     stays available across successive clicks of the "Preview" button (if
-   *     available) as well as when the "Save" button is finally clicked.
-   *   - buttons: A list containing copies of all submit and button elements in
-   *     the form.
-   *   - complete_form: A reference to the $form variable containing the
-   *     complete form structure. #process, #after_build, #element_validate, and
-   *     other handlers being invoked on a form element may use this reference
-   *     to access other information in the form the element is contained in.
-   *   - temporary: An array holding temporary data accessible during the
-   *     current page request only. All $form_state properties that are not
-   *     reserved keys (see form_state_keys_no_cache()) persist throughout a
-   *     multistep form sequence. Form API provides this key for modules to
-   *     communicate information across form-related functions during a single
-   *     page request. It may be used to temporarily save data that does not
-   *     need to or should not be cached during the whole form workflow; e.g.,
-   *     data that needs to be accessed during the current form build process
-   *     only. There is no use-case for this functionality in Drupal core.
-   *   Information on how certain $form_state properties control redirection
-   *   behavior after form submission may be found in self::redirectForm().
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return array
    *   The rendered form. This function may also perform a redirect and hence
@@ -223,12 +71,7 @@ public function getForm($form_arg);
    *
    * @see self::redirectForm()
    */
-  public function buildForm($form_id, array &$form_state);
-
-  /**
-   * Retrieves default values for the $form_state array.
-   */
-  public function getFormStateDefaults();
+  public function buildForm($form_id, FormStateInterface $form_state);
 
   /**
    * Constructs a new $form from the information in $form_state.
@@ -249,7 +92,7 @@ public function getFormStateDefaults();
    * @param string $form_id
    *   The unique string identifying the desired form. If a function with that
    *   name exists, it is called to build the form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A keyed array containing the current state of the form.
    * @param array|null $old_form
    *   (optional) A previously built $form. Used to retain the #build_id and
@@ -266,12 +109,12 @@ public function getFormStateDefaults();
    * @see self::processForm()
    * @see \Drupal\system\FormAjaxController::content()
    */
-  public function rebuildForm($form_id, &$form_state, $old_form = NULL);
+  public function rebuildForm($form_id, FormStateInterface $form_state, $old_form = NULL);
 
   /**
    * Fetches a form from the cache.
    */
-  public function getCache($form_build_id, &$form_state);
+  public function getCache($form_build_id, FormStateInterface $form_state);
 
   /**
    * Stores a form in the cache.
@@ -292,7 +135,7 @@ public function setCache($form_build_id, $form, $form_state);
    *   A form object to use to build the form, or the unique string identifying
    *   the desired form. If $form_arg is a string and a function with that
    *   name exists, it is called to build the form array.
-   * @param $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A keyed array containing the current state of the form. Most important is
    *   the $form_state['values'] collection, a tree of data used to simulate the
    *   incoming \Drupal::request()->request information from a user's form
@@ -310,7 +153,7 @@ public function setCache($form_build_id, $form, $form_state);
    *   $form_state build info array so that the reference can be preserved. For
    *   example, a form builder function with the following signature:
    *   @code
-   *   function mymodule_form($form, &$form_state, &$object) {
+   *   function mymodule_form($form, FormStateInterface $form_state, &$object) {
    *   }
    *   @endcode
    *   would be called via self::submitForm() as follows:
@@ -331,7 +174,7 @@ public function setCache($form_build_id, $form, $form_state);
    * drupal_form_submit('user_register_form', $form_state);
    * @endcode
    */
-  public function submitForm($form_arg, &$form_state);
+  public function submitForm($form_arg, FormStateInterface $form_state);
 
   /**
    * Retrieves the structured array that defines a given form.
@@ -339,14 +182,14 @@ public function submitForm($form_arg, &$form_state);
    * @param string $form_id
    *   The unique string identifying the desired form. If a function
    *   with that name exists, it is called to build the form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A keyed array containing the current state of the form, including the
    *   additional arguments to self::getForm() or self::submitForm() in the
    *   'args' component of the array.
    *
    * @return mixed|\Symfony\Component\HttpFoundation\Response
    */
-  public function retrieveForm($form_id, &$form_state);
+  public function retrieveForm($form_id, FormStateInterface $form_state);
 
   /**
    * Processes a form submission.
@@ -358,7 +201,7 @@ public function retrieveForm($form_id, &$form_state);
    *   The unique string identifying the current form.
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A keyed array containing the current state of the form. This
    *   includes the current persistent storage data for the form, and
    *   any data passed along by earlier steps when displaying a
@@ -367,7 +210,7 @@ public function retrieveForm($form_id, &$form_state);
    *
    * @return \Symfony\Component\HttpFoundation\RedirectResponse|null
    */
-  public function processForm($form_id, &$form, &$form_state);
+  public function processForm($form_id, &$form, FormStateInterface $form_state);
 
   /**
    * Prepares a structured form array.
@@ -380,11 +223,11 @@ public function processForm($form_id, &$form, &$form_state);
    *   theming, and hook_form_alter functions.
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A keyed array containing the current state of the form. Passed
    *   in here so that hook_form_alter() calls can use it, as well.
    */
-  public function prepareForm($form_id, &$form, &$form_state);
+  public function prepareForm($form_id, &$form, FormStateInterface $form_state);
 
   /**
    * Builds and processes all elements in the structured form array.
@@ -473,7 +316,7 @@ public function prepareForm($form_id, &$form, &$form_state);
    *   theming, and hook_form_alter functions.
    * @param array $element
    *   An associative array containing the structure of the current element.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A keyed array containing the current state of the form. In this
    *   context, it is used to accumulate information about which button
    *   was clicked when the form was submitted, as well as the sanitized
@@ -481,7 +324,7 @@ public function prepareForm($form_id, &$form, &$form_state);
    *
    * @return array
    */
-  public function doBuildForm($form_id, &$element, &$form_state);
+  public function doBuildForm($form_id, &$element, FormStateInterface $form_state);
 
   /**
    * Changes submitted form values during form validation.
@@ -507,9 +350,9 @@ public function doBuildForm($form_id, &$element, &$form_state);
    *   $element['#parents'] = array('elem1','elem2').
    * @param $value
    *   The new value for the form element.
-   * @param $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   Form state array where the value change should be recorded.
    */
-  public function setValue($element, $value, &$form_state);
+  public function setValue($element, $value, FormStateInterface $form_state);
 
 }
diff --git a/core/lib/Drupal/Core/Form/FormErrorInterface.php b/core/lib/Drupal/Core/Form/FormErrorInterface.php
index 43d0c5a..5d83574 100644
--- a/core/lib/Drupal/Core/Form/FormErrorInterface.php
+++ b/core/lib/Drupal/Core/Form/FormErrorInterface.php
@@ -99,8 +99,8 @@
    *   element is array('foo', 'bar', 'baz') then you may set an error on 'foo'
    *   or 'foo][bar][baz'. Setting an error on 'foo' sets an error for every
    *   element where the #parents array starts with 'foo'.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    * @param string $message
    *   (optional) The error message to present to the user.
    *
@@ -108,26 +108,26 @@
    *   Return value is for internal use only. To get a list of errors, use
    *   FormErrorInterface::getErrors() or FormErrorInterface::getError().
    */
-  public function setErrorByName($name, array &$form_state, $message = '');
+  public function setErrorByName($name, FormStateInterface $form_state, $message = '');
 
   /**
    * Clears all errors against all form elements made by FormErrorInterface::setErrorByName().
    *
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    */
-  public function clearErrors(array &$form_state);
+  public function clearErrors(FormStateInterface $form_state);
 
   /**
    * Returns an associative array of all errors.
    *
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return array
    *   An array of all errors, keyed by the name of the form element.
    */
-  public function getErrors(array $form_state);
+  public function getErrors(FormStateInterface $form_state);
 
   /**
    * Returns the error message filed against the given form element.
@@ -137,18 +137,18 @@ public function getErrors(array $form_state);
    *
    * @param array $element
    *   The form element to check for errors.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return string|null
    *   Either the error message for this element or NULL if there are no errors.
    */
-  public function getError($element, array &$form_state);
+  public function getError($element, FormStateInterface $form_state);
 
   /**
    * Flags an element as having an error.
    */
-  public function setError(&$element, array &$form_state, $message = '');
+  public function setError(&$element, FormStateInterface $form_state, $message = '');
 
   /**
    * Returns if there have been any errors during build.
diff --git a/core/lib/Drupal/Core/Form/FormInterface.php b/core/lib/Drupal/Core/Form/FormInterface.php
index fda5aae..1da569f 100644
--- a/core/lib/Drupal/Core/Form/FormInterface.php
+++ b/core/lib/Drupal/Core/Form/FormInterface.php
@@ -25,32 +25,32 @@ public function getFormId();
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return array
    *   The form structure.
    */
-  public function buildForm(array $form, array &$form_state);
+  public function buildForm(array $form, FormStateInterface $form_state);
 
   /**
    * Form validation handler.
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    */
-  public function validateForm(array &$form, array &$form_state);
+  public function validateForm(array &$form, FormStateInterface $form_state);
 
   /**
    * Form submission handler.
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    */
-  public function submitForm(array &$form, array &$form_state);
+  public function submitForm(array &$form, FormStateInterface $form_state);
 
 }
diff --git a/core/lib/Drupal/Core/Form/FormState.php b/core/lib/Drupal/Core/Form/FormState.php
new file mode 100644
index 0000000..1e3992f
--- /dev/null
+++ b/core/lib/Drupal/Core/Form/FormState.php
@@ -0,0 +1,326 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Form\FormState.
+ */
+
+namespace Drupal\Core\Form;
+
+/**
+ * Stores information about the state of a form.
+ */
+class FormState implements FormStateInterface, \ArrayAccess {
+
+  /**
+   * The internal storage of the form state.
+   *
+   * @var array
+   *   An array which stores information about the form. This is passed as a
+   *   reference so that the caller can use it to examine what in the form
+   *   changed when the form submission process is complete. Furthermore, it may
+   *   be used to store information related to the processed data in the form,
+   *   which will persist across page requests when the 'cache' or 'rebuild'
+   *   flag is set. The following parameters may be set in $form_state to affect
+   *   how the form is rendered:
+   *   - build_info: Internal. An associative array of information stored by
+   *     Form API that is necessary to build and rebuild the form from cache
+   *     when the original context may no longer be available:
+   *     - callback: The actual callback to be used to retrieve the form array.
+   *       Can be any callable. If none is provided $form_id is used as the name
+   *       of a function to call instead.
+   *     - args: A list of arguments to pass to the form constructor.
+   *     - files: An optional array defining include files that need to be
+   *       loaded for building the form. Each array entry may be the path to a
+   *       file or another array containing values for the parameters 'type',
+   *       'module' and 'name' as needed by module_load_include(). The files
+   *       listed here are automatically loaded by form_get_cache(). By default
+   *       the current menu router item's 'file' definition is added, if any.
+   *       Use form_load_include() to add include files from a form constructor.
+   *     - form_id: Identification of the primary form being constructed and
+   *       processed.
+   *     - base_form_id: Identification for a base form, as declared in the form
+   *       class's \Drupal\Core\Form\BaseFormIdInterface::getBaseFormId() method.
+   *   - rebuild_info: Internal. Similar to 'build_info', but pertaining to
+   *     self::rebuildForm().
+   *   - rebuild: Normally, after the entire form processing is completed and
+   *     submit handlers have run, a form is considered to be done and
+   *     self::redirectForm() will redirect the user to a new page using a GET
+   *     request (so a browser refresh does not re-submit the form). However, if
+   *     'rebuild' has been set to TRUE, then a new copy of the form is
+   *     immediately built and sent to the browser, instead of a redirect. This
+   *     is used for multi-step forms, such as wizards and confirmation forms.
+   *     Normally, $form_state['rebuild'] is set by a submit handler, since its
+   *     is usually logic within a submit handler that determines whether a form
+   *     is done or requires another step. However, a validation handler may
+   *     already set $form_state['rebuild'] to cause the form processing to
+   *     bypass submit handlers and rebuild the form instead, even if there are
+   *     no validation errors.
+   *   - response: Used when a form needs to return some kind of a
+   *     \Symfony\Component\HttpFoundation\Response object, e.g., a
+   *     \Symfony\Component\HttpFoundation\BinaryFileResponse when triggering a
+   *     file download. If you use the $form_state['redirect'] key, it will be
+   *     used to build a \Symfony\Component\HttpFoundation\RedirectResponse and
+   *     will populate this key.
+   *   - redirect: Used to redirect the form on submission. It may either be a
+   *     string containing the destination URL, or an array of arguments
+   *     compatible with url(). See url() for complete information.
+   *   - no_redirect: If set to TRUE the form will NOT perform a redirect,
+   *     even if 'redirect' is set.
+   *   - method: The HTTP form method to use for finding the input for this
+   *     form. May be 'post' or 'get'. Defaults to 'post'. Note that 'get'
+   *     method forms do not use form ids so are always considered to be
+   *     submitted, which can have unexpected effects. The 'get' method should
+   *     only be used on forms that do not change data, as that is exclusively
+   *     the domain of 'post.'
+   *   - cache: If set to TRUE the original, unprocessed form structure will be
+   *     cached, which allows the entire form to be rebuilt from cache. A
+   *     typical form workflow involves two page requests; first, a form is
+   *     built and rendered for the user to fill in. Then, the user fills the
+   *     form in and submits it, triggering a second page request in which the
+   *     form must be built and processed. By default, $form and $form_state are
+   *     built from scratch during each of these page requests. Often, it is
+   *     necessary or desired to persist the $form and $form_state variables
+   *     from the initial page request to the one that processes the submission.
+   *     'cache' can be set to TRUE to do this. A prominent example is an
+   *     Ajax-enabled form, in which ajax_process_form() enables form caching
+   *     for all forms that include an element with the #ajax property. (The
+   *     Ajax handler has no way to build the form itself, so must rely on the
+   *     cached version.) Note that the persistence of $form and $form_state
+   *     happens automatically for (multi-step) forms having the 'rebuild' flag
+   *     set, regardless of the value for 'cache'.
+   *   - no_cache: If set to TRUE the form will NOT be cached, even if 'cache'
+   *     is set.
+   *   - values: An associative array of values submitted to the form. The
+   *     validation functions and submit functions use this array for nearly all
+   *     their decision making. (Note that #tree determines whether the values
+   *     are a flat array or an array whose structure parallels the $form array.
+   *     See the @link forms_api_reference.html Form API reference @endlink for
+   *     more information.)
+   *   - input: The array of values as they were submitted by the user. These
+   *     are raw and unvalidated, so should not be used without a thorough
+   *     understanding of security implications. In almost all cases, code
+   *     should use the data in the 'values' array exclusively. The most common
+   *     use of this key is for multi-step forms that need to clear some of the
+   *     user input when setting 'rebuild'. The values correspond to
+   *     \Drupal::request()->request or \Drupal::request()->query, depending on
+   *     the 'method' chosen.
+   *   - always_process: If TRUE and the method is GET, a form_id is not
+   *     necessary. This should only be used on RESTful GET forms that do NOT
+   *     write data, as this could lead to security issues. It is useful so that
+   *     searches do not need to have a form_id in their query arguments to
+   *     trigger the search.
+   *   - must_validate: Ordinarily, a form is only validated once, but there are
+   *     times when a form is resubmitted internally and should be validated
+   *     again. Setting this to TRUE will force that to happen. This is most
+   *     likely to occur during Ajax operations.
+   *   - programmed: If TRUE, the form was submitted programmatically, usually
+   *     invoked via self::submitForm(). Defaults to FALSE.
+   *   - programmed_bypass_access_check: If TRUE, programmatic form submissions
+   *     are processed without taking #access into account. Set this to FALSE
+   *     when submitting a form programmatically with values that may have been
+   *     input by the user executing the current request; this will cause
+   *     #access to be respected as it would on a normal form submission.
+   *     Defaults to TRUE.
+   *   - process_input: Boolean flag. TRUE signifies correct form submission.
+   *     This is always TRUE for programmed forms coming from self::submitForm()
+   *     (see 'programmed' key), or if the form_id coming from the
+   *     \Drupal::request()->request data is set and matches the current form_id.
+   *   - submitted: If TRUE, the form has been submitted. Defaults to FALSE.
+   *   - executed: If TRUE, the form was submitted and has been processed and
+   *     executed. Defaults to FALSE.
+   *   - triggering_element: (read-only) The form element that triggered
+   *     submission, which may or may not be a button (in the case of Ajax
+   *     forms). This key is often used to distinguish between various buttons
+   *     in a submit handler, and is also used in Ajax handlers.
+   *   - has_file_element: Internal. If TRUE, there is a file element and Form
+   *     API will set the appropriate 'enctype' HTML attribute on the form.
+   *   - groups: Internal. An array containing references to details elements to
+   *     render them within vertical tabs.
+   *   - storage: $form_state['storage'] is not a special key, and no specific
+   *     support is provided for it in the Form API. By tradition it was
+   *     the location where application-specific data was stored for
+   *     communication between the submit, validation, and form builder
+   *     functions, especially in a multi-step-style form. Form implementations
+   *     may use any key(s) within $form_state (other than the keys listed here
+   *     and other reserved ones used by Form API internals) for this kind of
+   *     storage. The recommended way to ensure that the chosen key doesn't
+   *     conflict with ones used by the Form API or other modules is to use the
+   *     module name as the key name or a prefix for the key name. For example,
+   *     the entity form classes use $this->entity in entity forms,
+   *     or $form_state['controller']->getEntity() outside the controller, to
+   *     store information about the entity being edited, and this information
+   *     stays available across successive clicks of the "Preview" button (if
+   *     available) as well as when the "Save" button is finally clicked.
+   *   - buttons: A list containing copies of all submit and button elements in
+   *     the form.
+   *   - complete_form: A reference to the $form variable containing the
+   *     complete form structure. #process, #after_build, #element_validate, and
+   *     other handlers being invoked on a form element may use this reference
+   *     to access other information in the form the element is contained in.
+   *   - temporary: An array holding temporary data accessible during the
+   *     current page request only. All $form_state properties that are not
+   *     reserved keys (see form_state_keys_no_cache()) persist throughout a
+   *     multistep form sequence. Form API provides this key for modules to
+   *     communicate information across form-related functions during a single
+   *     page request. It may be used to temporarily save data that does not
+   *     need to or should not be cached during the whole form workflow; e.g.,
+   *     data that needs to be accessed during the current form build process
+   *     only. There is no use-case for this functionality in Drupal core.
+   */
+  protected $formState = array();
+
+  /**
+   * The complete form array.
+   *
+   * @see self::getCompleteForm()
+   *
+   * @var array
+   */
+  protected $form;
+
+  /**
+   * @param array $form_state
+   */
+  public function __construct(array $form_state = array()) {
+    $this->formState = $form_state;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function addFormStateDefaults() {
+    $this->formState += array(
+      'rebuild' => FALSE,
+      'rebuild_info' => array(),
+      'redirect' => NULL,
+      'build_info' => array(
+        'args' => array(),
+        'files' => array(),
+      ),
+      'temporary' => array(),
+      'validation_complete' => FALSE,
+      'submitted' => FALSE,
+      'executed' => FALSE,
+      'programmed' => FALSE,
+      'programmed_bypass_access_check' => TRUE,
+      'cache'=> FALSE,
+      'method' => 'post',
+      'groups' => array(),
+      'buttons' => array(),
+      'errors' => array(),
+      'limit_validation_errors' => NULL,
+      'storage' => array(),
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setFormState(array $form_state) {
+    $this->formState = $form_state + $this->formState;
+    return $this;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getCacheableArray($allowed_keys = array()) {
+    $uncacheable_keys = array_diff($this->getUncacheableKeys(), $allowed_keys);
+    return array_diff_key($this->formState, array_flip($uncacheable_keys));
+  }
+
+  /**
+   * Returns an array of $form_state keys that shouldn't be cached.
+   */
+  protected function getUncacheableKeys() {
+    return array(
+      // Public properties defined by form constructors and form handlers.
+      'always_process',
+      'must_validate',
+      'rebuild',
+      'rebuild_info',
+      'redirect',
+      'redirect_route',
+      'no_redirect',
+      'temporary',
+      // Internal properties defined by form processing.
+      'buttons',
+      'triggering_element',
+      'complete_form',
+      'groups',
+      'input',
+      'method',
+      'submit_handlers',
+      'validation_complete',
+      'submitted',
+      'executed',
+      'validate_handlers',
+      'values',
+      'errors',
+      'limit_validation_errors',
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setCompleteForm(array &$form) {
+    $this->form = &$form;
+    return $this;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function &getCompleteForm() {
+    return $this->form;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function offsetExists($offset) {
+    return isset($this->formState[$offset]);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function &offsetGet($offset) {
+    if (!isset($this->formState[$offset])) {
+      $this->formState[$offset] = NULL;
+    }
+
+    // @todo Remove usages of $form_state['complete_form'].
+    if ($offset == 'complete_form') {
+      return $this->getCompleteForm();
+    }
+
+    return $this->formState[$offset];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function offsetSet($offset, $value) {
+      $this->formState[$offset] = $value;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function offsetUnset($offset) {
+    unset($this->formState[$offset]);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setIfNotExists($key, $value) {
+    if (!array_key_exists($key, $this->formState)) {
+      $this->formState[$key] = $value;
+    }
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Form/FormStateInterface.php b/core/lib/Drupal/Core/Form/FormStateInterface.php
new file mode 100644
index 0000000..179235b
--- /dev/null
+++ b/core/lib/Drupal/Core/Form/FormStateInterface.php
@@ -0,0 +1,69 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Form\FormStateInterface.
+ */
+
+namespace Drupal\Core\Form;
+
+/**
+ * Provides an interface for an object containing the current state of a form.
+ */
+interface FormStateInterface {
+
+  /**
+   * Adds the default values to the form state.
+   */
+  public function addFormStateDefaults();
+
+  /**
+   * Returns a reference to the complete form array.
+   *
+   * @return array
+   *   The complete form array.
+   */
+  public function &getCompleteForm();
+
+  /**
+   * Stores the complete form array.
+   *
+   * @param array $form
+   *   The complete form array.
+   *
+   * @return $this
+   */
+  public function setCompleteForm(array &$form);
+
+  /**
+   * Returns an array representation of the cacheable portion of the form state.
+   *
+   * @return array
+   *   The cacheable portion of the form state.
+   */
+  public function getCacheableArray();
+
+  /**
+   * Sets the value of the form state.
+   *
+   * @param array $form_state
+   *   An array of values to add to the form state.
+   *
+   * @return $this
+   */
+  public function setFormState(array $form_state);
+
+  /**
+   * Saves a value for a given key if it does not exist yet.
+   *
+   * @param string $key
+   *   The key of the data to store.
+   * @param mixed $value
+   *   The data to store.
+   *
+   * @return bool
+   *   TRUE if the data was set, FALSE if it already existed.
+   */
+  public function setIfNotExists($key, $value);
+
+}
diff --git a/core/lib/Drupal/Core/Form/FormSubmitter.php b/core/lib/Drupal/Core/Form/FormSubmitter.php
index 78aca72..cd08478 100644
--- a/core/lib/Drupal/Core/Form/FormSubmitter.php
+++ b/core/lib/Drupal/Core/Form/FormSubmitter.php
@@ -47,7 +47,7 @@ public function __construct(RequestStack $request_stack, UrlGeneratorInterface $
   /**
    * {@inheritdoc}
    */
-  public function doSubmitForm(&$form, &$form_state) {
+  public function doSubmitForm(&$form, FormStateInterface $form_state) {
     if (!$form_state['submitted']) {
       return;
     }
@@ -61,18 +61,7 @@ public function doSubmitForm(&$form, &$form_state) {
     // \Drupal\Core\Form\FormBuilderInterface::submitForm).
     if ($batch = &$this->batchGet() && !isset($batch['current_set'])) {
       // Store $form_state information in the batch definition.
-      // We need the full $form_state when either:
-      // - Some submit handlers were saved to be called during batch
-      //   processing. See self::executeSubmitHandlers().
-      // - The form is multistep.
-      // In other cases, we only need the information expected by
-      // self::redirectForm().
-      if ($batch['has_form_submits'] || !empty($form_state['rebuild'])) {
-        $batch['form_state'] = $form_state;
-      }
-      else {
-        $batch['form_state'] = array_intersect_key($form_state, array_flip(array('programmed', 'rebuild', 'storage', 'no_redirect', 'redirect', 'redirect_route')));
-      }
+      $batch['form_state'] = clone $form_state;
 
       $batch['progressive'] = !$form_state['programmed'];
       $response = batch_process();
@@ -103,7 +92,7 @@ public function doSubmitForm(&$form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function executeSubmitHandlers(&$form, &$form_state) {
+  public function executeSubmitHandlers(&$form, FormStateInterface $form_state) {
     // If there was a button pressed, use its handlers.
     if (isset($form_state['submit_handlers'])) {
       $handlers = $form_state['submit_handlers'];
diff --git a/core/lib/Drupal/Core/Form/FormSubmitterInterface.php b/core/lib/Drupal/Core/Form/FormSubmitterInterface.php
index 8ae8b08..3c0c0db 100644
--- a/core/lib/Drupal/Core/Form/FormSubmitterInterface.php
+++ b/core/lib/Drupal/Core/Form/FormSubmitterInterface.php
@@ -17,14 +17,14 @@
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return null|\Symfony\Component\HttpFoundation\Response
    *   If a response was set by a submit handler, or if the form needs to
    *   redirect, a Response object will be returned.
    */
-  public function doSubmitForm(&$form, &$form_state);
+  public function doSubmitForm(&$form, FormStateInterface $form_state);
 
   /**
    * Executes custom submission handlers for a given form.
@@ -34,12 +34,12 @@ public function doSubmitForm(&$form, &$form_state);
    *
    * @param $form
    *   An associative array containing the structure of the form.
-   * @param $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A keyed array containing the current state of the form. If the user
    *   submitted the form by clicking a button with custom handler functions
    *   defined, those handlers will be stored here.
    */
-  public function executeSubmitHandlers(&$form, &$form_state);
+  public function executeSubmitHandlers(&$form, FormStateInterface $form_state);
 
   /**
    * Redirects the user to a URL after a form has been processed.
@@ -93,8 +93,8 @@ public function executeSubmitHandlers(&$form, &$form_state);
    *   string) if it is present, so this will override any values set by
    *   $form_state['redirect'].
    *
-   * @param $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return \Symfony\Component\HttpFoundation\RedirectResponse|null
    *
diff --git a/core/lib/Drupal/Core/Form/FormValidator.php b/core/lib/Drupal/Core/Form/FormValidator.php
index eda8238..5038259 100644
--- a/core/lib/Drupal/Core/Form/FormValidator.php
+++ b/core/lib/Drupal/Core/Form/FormValidator.php
@@ -55,7 +55,7 @@ public function __construct(RequestStack $request_stack, TranslationInterface $s
   /**
    * {@inheritdoc}
    */
-  public function executeValidateHandlers(&$form, &$form_state) {
+  public function executeValidateHandlers(&$form, FormStateInterface $form_state) {
     // If there was a button pressed, use its handlers.
     if (isset($form_state['validate_handlers'])) {
       $handlers = $form_state['validate_handlers'];
@@ -76,7 +76,7 @@ public function executeValidateHandlers(&$form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm($form_id, &$form, &$form_state) {
+  public function validateForm($form_id, &$form, FormStateInterface $form_state) {
     // If this form is flagged to always validate, ensure that previous runs of
     // validation are ignored.
     if (!empty($form_state['must_validate'])) {
@@ -119,12 +119,12 @@ public function validateForm($form_id, &$form, &$form_state) {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    * @param string $form_id
    *   The unique string identifying the form.
    */
-  protected function handleErrorsWithLimitedValidation(&$form, &$form_state, $form_id) {
+  protected function handleErrorsWithLimitedValidation(&$form, FormStateInterface $form_state, $form_id) {
     // If validation errors are limited then remove any non validated form values,
     // so that only values that passed validation are left for submit callbacks.
     if (isset($form_state['triggering_element']['#limit_validation_errors']) && $form_state['triggering_element']['#limit_validation_errors'] !== FALSE) {
@@ -171,12 +171,12 @@ protected function handleErrorsWithLimitedValidation(&$form, &$form_state, $form
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    * @param string $form_id
    *   The unique string identifying the form.
    */
-  protected function finalizeValidation(&$form, &$form_state, $form_id) {
+  protected function finalizeValidation(&$form, FormStateInterface $form_state, $form_id) {
     // After validation, loop through and assign each element its errors.
     $this->setElementErrorsFromFormState($form, $form_state);
     // Mark this form as validated.
@@ -192,7 +192,7 @@ protected function finalizeValidation(&$form, &$form_state, $form_id) {
    *
    * @param $elements
    *   An associative array containing the structure of the form.
-   * @param $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A keyed array containing the current state of the form. The current
    *   user-submitted data is stored in $form_state['values'], though
    *   form validation functions are passed an explicit copy of the
@@ -206,7 +206,7 @@ protected function finalizeValidation(&$form, &$form_state, $form_id) {
    *   A unique string identifying the form for validation, submission,
    *   theming, and hook_form_alter functions.
    */
-  protected function doValidateForm(&$elements, &$form_state, $form_id = NULL) {
+  protected function doValidateForm(&$elements, FormStateInterface $form_state, $form_id = NULL) {
     // Recurse through all children.
     foreach (Element::children($elements) as $key) {
       if (isset($elements[$key]) && $elements[$key]) {
@@ -289,7 +289,7 @@ protected function doValidateForm(&$elements, &$form_state, $form_id = NULL) {
    *
    * @param array $elements
    *   An associative array containing the structure of the form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A keyed array containing the current state of the form. The current
    *   user-submitted data is stored in $form_state['values'], though
    *   form validation functions are passed an explicit copy of the
@@ -300,7 +300,7 @@ protected function doValidateForm(&$elements, &$form_state, $form_id = NULL) {
    *   web service requests, or other expensive requests that should
    *   not be repeated in the submission step.
    */
-  protected function performRequiredValidation(&$elements, &$form_state) {
+  protected function performRequiredValidation(&$elements, FormStateInterface $form_state) {
     // Verify that the value is not longer than #maxlength.
     if (isset($elements['#maxlength']) && Unicode::strlen($elements['#value']) > $elements['#maxlength']) {
       $this->setError($elements, $form_state, $this->t('!name cannot be longer than %max characters but is currently %length characters long.', array('!name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title'], '%max' => $elements['#maxlength'], '%length' => Unicode::strlen($elements['#value']))));
@@ -345,12 +345,12 @@ protected function performRequiredValidation(&$elements, &$form_state) {
   /**
    * Determines if validation errors should be limited.
    *
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return array|null
    */
-  protected function determineLimitValidationErrors(&$form_state) {
+  protected function determineLimitValidationErrors(FormStateInterface $form_state) {
     // While this element is being validated, it may be desired that some
     // calls to self::setErrorByName() be suppressed and not result in a form
     // error, so that a button that implements low-risk functionality (such as
@@ -395,10 +395,10 @@ protected function determineLimitValidationErrors(&$form_state) {
    *
    * @param array $elements
    *   An associative array containing the structure of a form element.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    */
-  protected function setElementErrorsFromFormState(array &$elements, array &$form_state) {
+  protected function setElementErrorsFromFormState(array &$elements, FormStateInterface $form_state) {
     // Recurse through all children.
     foreach (Element::children($elements) as $key) {
       if (isset($elements[$key]) && $elements[$key]) {
@@ -412,7 +412,7 @@ protected function setElementErrorsFromFormState(array &$elements, array &$form_
   /**
    * {@inheritdoc}
    */
-  public function setErrorByName($name, array &$form_state, $message = '') {
+  public function setErrorByName($name, FormStateInterface $form_state, $message = '') {
     if (!empty($form_state['validation_complete'])) {
       throw new \LogicException('Form errors cannot be set after form validation has finished.');
     }
@@ -457,14 +457,14 @@ public function setErrorByName($name, array &$form_state, $message = '') {
   /**
    * {@inheritdoc}
    */
-  public function setError(&$element, array &$form_state, $message = '') {
+  public function setError(&$element, FormStateInterface $form_state, $message = '') {
     $this->setErrorByName(implode('][', $element['#parents']), $form_state, $message);
   }
 
   /**
    * {@inheritdoc}
    */
-  public function getError($element, array &$form_state) {
+  public function getError($element, FormStateInterface $form_state) {
     if ($errors = $this->getErrors($form_state)) {
       $parents = array();
       foreach ($element['#parents'] as $parent) {
@@ -480,7 +480,7 @@ public function getError($element, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function clearErrors(array &$form_state) {
+  public function clearErrors(FormStateInterface $form_state) {
     $form_state['errors'] = array();
     $this->requestStack->getCurrentRequest()->attributes->set('_form_errors', FALSE);
   }
@@ -488,7 +488,7 @@ public function clearErrors(array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function getErrors(array $form_state) {
+  public function getErrors(FormStateInterface $form_state) {
     return $form_state['errors'];
   }
 
diff --git a/core/lib/Drupal/Core/Form/FormValidatorInterface.php b/core/lib/Drupal/Core/Form/FormValidatorInterface.php
index 806e6a0..d1fb110 100644
--- a/core/lib/Drupal/Core/Form/FormValidatorInterface.php
+++ b/core/lib/Drupal/Core/Form/FormValidatorInterface.php
@@ -20,12 +20,12 @@
    *
    * @param $form
    *   An associative array containing the structure of the form.
-   * @param $form_state
-   *   A keyed array containing the current state of the form. If the user
-   *   submitted the form by clicking a button with custom handler functions
-   *   defined, those handlers will be stored here.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form. If the user submitted the form by clicking
+   *   a button with custom handler functions defined, those handlers will be
+   *   stored here.
    */
-  public function executeValidateHandlers(&$form, &$form_state);
+  public function executeValidateHandlers(&$form, FormStateInterface $form_state);
 
   /**
    * Validates user-submitted form data in the $form_state array.
@@ -41,17 +41,17 @@ public function executeValidateHandlers(&$form, &$form_state);
    *   structure, it is responsible for validating the values of changed form
    *   elements in $form_state['values'] to prevent form submit handlers from
    *   receiving unvalidated values.
-   * @param $form_state
-   *   A keyed array containing the current state of the form. The current
-   *   user-submitted data is stored in $form_state['values'], though
-   *   form validation functions are passed an explicit copy of the
-   *   values for the sake of simplicity. Validation handlers can also use
-   *   $form_state to pass information on to submit handlers. For example:
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form. The current user-submitted data is stored
+   *   in $form_state['values'], though form validation functions are passed an
+   *   explicit copy of the values for the sake of simplicity. Validation
+   *   handlers can also use $form_state to pass information on to submit
+   *   handlers. For example:
    *     $form_state['data_for_submission'] = $data;
-   *   This technique is useful when validation requires file parsing,
-   *   web service requests, or other expensive requests that should
-   *   not be repeated in the submission step.
+   *   This technique is useful when validation requires file parsing, web
+   *   service requests, or other expensive requests that should not be repeated
+   *   in the submission step.
    */
-  public function validateForm($form_id, &$form, &$form_state);
+  public function validateForm($form_id, &$form, FormStateInterface $form_state);
 
 }
diff --git a/core/lib/Drupal/Core/ImageToolkit/ImageToolkitInterface.php b/core/lib/Drupal/Core/ImageToolkit/ImageToolkitInterface.php
index 568bcc8..651d274 100644
--- a/core/lib/Drupal/Core/ImageToolkit/ImageToolkitInterface.php
+++ b/core/lib/Drupal/Core/ImageToolkit/ImageToolkitInterface.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\ImageToolkit;
 
 use Drupal\Component\Plugin\PluginInspectionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Image\ImageInterface;
 
 /**
@@ -57,7 +58,7 @@ public function settingsForm();
    *
    * @see system_image_toolkit_settings_submit()
    */
-  public function settingsFormSubmit($form, &$form_state);
+  public function settingsFormSubmit($form, FormStateInterface $form_state);
 
   /**
    * Sets the image object that this toolkit instance is tied to.
diff --git a/core/lib/Drupal/Core/Installer/Form/SelectLanguageForm.php b/core/lib/Drupal/Core/Installer/Form/SelectLanguageForm.php
index d3667f7..a5c0737 100644
--- a/core/lib/Drupal/Core/Installer/Form/SelectLanguageForm.php
+++ b/core/lib/Drupal/Core/Installer/Form/SelectLanguageForm.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\UserAgent;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageManager;
 use Symfony\Component\HttpFoundation\Request;
 
@@ -28,7 +29,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $install_state = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $install_state = NULL) {
     if (count($install_state['translations']) > 1) {
       $files = $install_state['translations'];
     }
@@ -96,7 +97,7 @@ public function buildForm(array $form, array &$form_state, $install_state = NULL
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $install_state = &$form_state['build_info']['args'][0];
     $install_state['parameters']['langcode'] = $form_state['values']['langcode'];
   }
diff --git a/core/lib/Drupal/Core/Installer/Form/SelectProfileForm.php b/core/lib/Drupal/Core/Installer/Form/SelectProfileForm.php
index d88bc56..e16c10e 100644
--- a/core/lib/Drupal/Core/Installer/Form/SelectProfileForm.php
+++ b/core/lib/Drupal/Core/Installer/Form/SelectProfileForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Installer\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides the profile selection form.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $install_state = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $install_state = NULL) {
     $form['#title'] = $this->t('Select an installation profile');
 
     $profiles = array();
@@ -87,7 +88,7 @@ public function buildForm(array $form, array &$form_state, $install_state = NULL
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     global $install_state;
     $install_state['parameters']['profile'] = $form_state['values']['profile'];
   }
diff --git a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php
index 745665b..491a1d9 100644
--- a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php
+++ b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Locale\CountryManagerInterface;
 use Drupal\Core\State\StateInterface;
 use Drupal\user\UserStorageInterface;
@@ -88,7 +89,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['#title'] = $this->t('Configure site');
 
     // Warn about settings.php permissions risk
@@ -227,7 +228,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     if ($error = user_validate_name($form_state['values']['account']['name'])) {
       $this->setFormError('account][name', $form_state, $error);
     }
@@ -236,7 +237,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('system.site')
       ->set('name', $form_state['values']['site_name'])
       ->set('mail', $form_state['values']['site_mail'])
diff --git a/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php b/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php
index 23f0d03..1020620 100644
--- a/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php
+++ b/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\Crypt;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides a form to configure and rewrite settings.php.
@@ -26,7 +27,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $conf_path = './' . conf_path(FALSE);
     $settings_file = $conf_path . '/settings.php';
 
@@ -114,7 +115,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $driver = $form_state['values']['driver'];
     $database = $form_state['values'][$driver];
     $drivers = drupal_get_database_types();
@@ -134,7 +135,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     global $install_state;
 
     // Update global settings array and save.
diff --git a/core/lib/Drupal/Core/Plugin/PluginFormInterface.php b/core/lib/Drupal/Core/Plugin/PluginFormInterface.php
index daceeac..993c841 100644
--- a/core/lib/Drupal/Core/Plugin/PluginFormInterface.php
+++ b/core/lib/Drupal/Core/Plugin/PluginFormInterface.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\Core\Plugin;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Provides an interface for a plugin that contains a form.
  *
@@ -19,32 +21,32 @@
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return array
    *   The form structure.
    */
-  public function buildConfigurationForm(array $form, array &$form_state);
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state);
 
   /**
    * Form validation handler.
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    */
-  public function validateConfigurationForm(array &$form, array &$form_state);
+  public function validateConfigurationForm(array &$form, FormStateInterface $form_state);
 
   /**
    * Form submission handler.
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    */
-  public function submitConfigurationForm(array &$form, array &$form_state);
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state);
 
 }
diff --git a/core/lib/Drupal/Core/Update/Form/UpdateScriptSelectionForm.php b/core/lib/Drupal/Core/Update/Form/UpdateScriptSelectionForm.php
index b6d440d..574ec6c 100644
--- a/core/lib/Drupal/Core/Update/Form/UpdateScriptSelectionForm.php
+++ b/core/lib/Drupal/Core/Update/Form/UpdateScriptSelectionForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Update\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides the list of available database module updates.
@@ -24,7 +25,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $count = 0;
     $incompatible_count = 0;
     $form['start'] = array(
@@ -127,7 +128,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/action/src/ActionAddForm.php b/core/modules/action/src/ActionAddForm.php
index bae8dcb..6d8e4aa 100644
--- a/core/modules/action/src/ActionAddForm.php
+++ b/core/modules/action/src/ActionAddForm.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\Crypt;
 use Drupal\Core\Action\ActionManager;
 use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -54,7 +55,7 @@ public static function create(ContainerInterface $container) {
    * @param string $action_id
    *   The hashed version of the action ID.
    */
-  public function buildForm(array $form, array &$form_state, $action_id = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $action_id = NULL) {
     // In \Drupal\action\Form\ActionAdminManageForm::buildForm() the action
     // are hashed. Here we have to decrypt it to find the desired action ID.
     foreach ($this->actionManager->getDefinitions() as $id => $definition) {
diff --git a/core/modules/action/src/ActionFormBase.php b/core/modules/action/src/ActionFormBase.php
index c2cbee3..23b7f07 100644
--- a/core/modules/action/src/ActionFormBase.php
+++ b/core/modules/action/src/ActionFormBase.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\PluginFormInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -53,7 +54,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $this->plugin = $this->entity->getPlugin();
     return parent::buildForm($form, $form_state);
   }
@@ -61,7 +62,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form['label'] = array(
       '#type' => 'textfield',
       '#title' => $this->t('Label'),
@@ -113,7 +114,7 @@ public function exists($id) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
     unset($actions['delete']);
     return $actions;
@@ -122,7 +123,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     parent::validate($form, $form_state);
 
     if ($this->plugin instanceof PluginFormInterface) {
@@ -133,7 +134,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     parent::submit($form, $form_state);
 
     if ($this->plugin instanceof PluginFormInterface) {
@@ -145,7 +146,7 @@ public function submit(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $this->entity->save();
     drupal_set_message($this->t('The action has been successfully saved.'));
 
diff --git a/core/modules/action/src/Form/ActionAdminManageForm.php b/core/modules/action/src/Form/ActionAdminManageForm.php
index fd1a0d0..81c08f4 100644
--- a/core/modules/action/src/Form/ActionAdminManageForm.php
+++ b/core/modules/action/src/Form/ActionAdminManageForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Form\FormBase;
 use Drupal\Component\Utility\Crypt;
 use Drupal\Core\Action\ActionManager;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -53,7 +54,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $actions = array();
     foreach ($this->manager->getDefinitions() as $id => $definition) {
       if (is_subclass_of($definition['class'], '\Drupal\Core\Plugin\PluginFormInterface')) {
@@ -87,7 +88,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     if ($form_state['values']['action']) {
       $form_state['redirect_route'] = array(
         'route_name' => 'action.admin_add',
diff --git a/core/modules/action/src/Form/ActionDeleteForm.php b/core/modules/action/src/Form/ActionDeleteForm.php
index 48a18c7..3c300c3 100644
--- a/core/modules/action/src/Form/ActionDeleteForm.php
+++ b/core/modules/action/src/Form/ActionDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\action\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -39,7 +40,7 @@ public function getCancelRoute() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
 
     watchdog('user', 'Deleted action %aid (%action)', array('%aid' => $this->entity->id(), '%action' => $this->entity->label()));
diff --git a/core/modules/action/src/Plugin/Action/EmailAction.php b/core/modules/action/src/Plugin/Action/EmailAction.php
index c6589a6..a9a00a9 100644
--- a/core/modules/action/src/Plugin/Action/EmailAction.php
+++ b/core/modules/action/src/Plugin/Action/EmailAction.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Action\ConfigurableActionBase;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Utility\Token;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -114,7 +115,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form['recipient'] = array(
       '#type' => 'textfield',
       '#title' => t('Recipient'),
@@ -143,7 +144,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateConfigurationForm(array &$form, array &$form_state) {
+  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
     if (!valid_email_address($form_state['values']['recipient']) && strpos($form_state['values']['recipient'], ':mail') === FALSE) {
       // We want the literal %author placeholder to be emphasized in the error message.
       form_set_error('recipient', $form_state, t('Enter a valid email address or use a token email address such as %author.', array('%author' => '[node:author:mail]')));
@@ -153,7 +154,7 @@ public function validateConfigurationForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['recipient'] = $form_state['values']['recipient'];
     $this->configuration['subject'] = $form_state['values']['subject'];
     $this->configuration['message'] = $form_state['values']['message'];
diff --git a/core/modules/action/src/Plugin/Action/GotoAction.php b/core/modules/action/src/Plugin/Action/GotoAction.php
index e08d91f..40ba621 100644
--- a/core/modules/action/src/Plugin/Action/GotoAction.php
+++ b/core/modules/action/src/Plugin/Action/GotoAction.php
@@ -8,6 +8,7 @@
 namespace Drupal\action\Plugin\Action;
 
 use Drupal\Core\Action\ConfigurableActionBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Routing\UrlGeneratorInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -94,7 +95,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form['url'] = array(
       '#type' => 'textfield',
       '#title' => t('URL'),
@@ -108,7 +109,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['url'] = $form_state['values']['url'];
   }
 
diff --git a/core/modules/action/src/Plugin/Action/MessageAction.php b/core/modules/action/src/Plugin/Action/MessageAction.php
index cc15650..ece48fa 100644
--- a/core/modules/action/src/Plugin/Action/MessageAction.php
+++ b/core/modules/action/src/Plugin/Action/MessageAction.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\Xss;
 use Drupal\Core\Action\ConfigurableActionBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Utility\Token;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -68,7 +69,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form['message'] = array(
       '#type' => 'textarea',
       '#title' => t('Message'),
@@ -83,7 +84,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['message'] = $form_state['values']['message'];
     unset($this->configuration['node']);
   }
diff --git a/core/modules/aggregator/src/FeedForm.php b/core/modules/aggregator/src/FeedForm.php
index e832d87..6d9d3ea 100644
--- a/core/modules/aggregator/src/FeedForm.php
+++ b/core/modules/aggregator/src/FeedForm.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\ContentEntityForm;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -21,7 +22,7 @@ class FeedForm extends ContentEntityForm {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $feed = $this->entity;
 
     // @todo: convert to a language selection widget defined in the base field.
@@ -41,7 +42,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     $feed = $this->buildEntity($form, $form_state);
     // Check for duplicate titles.
     $feed_storage = $this->entityManager->getStorage('aggregator_feed');
@@ -60,7 +61,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $feed = $this->entity;
     $insert = (bool) $feed->id();
     $feed->save();
diff --git a/core/modules/aggregator/src/Form/FeedDeleteForm.php b/core/modules/aggregator/src/Form/FeedDeleteForm.php
index 26c6423..cd1272c 100644
--- a/core/modules/aggregator/src/Form/FeedDeleteForm.php
+++ b/core/modules/aggregator/src/Form/FeedDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\aggregator\Form;
 
 use Drupal\Core\Entity\ContentEntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -39,7 +40,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     watchdog('aggregator', 'Feed %feed deleted.', array('%feed' => $this->entity->label()));
     drupal_set_message($this->t('The feed %feed has been deleted.', array('%feed' => $this->entity->label())));
diff --git a/core/modules/aggregator/src/Form/FeedItemsDeleteForm.php b/core/modules/aggregator/src/Form/FeedItemsDeleteForm.php
index c9129a1..b5021be 100644
--- a/core/modules/aggregator/src/Form/FeedItemsDeleteForm.php
+++ b/core/modules/aggregator/src/Form/FeedItemsDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\aggregator\Form;
 
 use Drupal\Core\Entity\ContentEntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -39,7 +40,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->deleteItems();
 
     $form_state['redirect_route'] = $this->getCancelRoute();
diff --git a/core/modules/aggregator/src/Form/OpmlFeedAdd.php b/core/modules/aggregator/src/Form/OpmlFeedAdd.php
index 3e2f538..89068dd 100644
--- a/core/modules/aggregator/src/Form/OpmlFeedAdd.php
+++ b/core/modules/aggregator/src/Form/OpmlFeedAdd.php
@@ -10,6 +10,7 @@
 use Drupal\aggregator\FeedStorageInterface;
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use GuzzleHttp\Exception\RequestException;
 use GuzzleHttp\ClientInterface;
@@ -66,7 +67,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $intervals = array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200);
     $period = array_map('format_interval', array_combine($intervals, $intervals));
 
@@ -101,7 +102,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     // If both fields are empty or filled, cancel.
     $file_upload = $this->getRequest()->files->get('files[upload]', NULL, TRUE);
     if (empty($form_state['values']['remote']) == empty($file_upload)) {
@@ -112,7 +113,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $validators = array('file_validate_extensions' => array('opml xml'));
     if ($file = file_save_upload('upload', $validators, FALSE, 0)) {
       $data = file_get_contents($file->getFileUri());
diff --git a/core/modules/aggregator/src/Form/SettingsForm.php b/core/modules/aggregator/src/Form/SettingsForm.php
index 075b614..3177742 100644
--- a/core/modules/aggregator/src/Form/SettingsForm.php
+++ b/core/modules/aggregator/src/Form/SettingsForm.php
@@ -10,6 +10,7 @@
 use Drupal\aggregator\Plugin\AggregatorPluginManager;
 use Drupal\Component\Utility\String;
 use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\PluginFormInterface;
 use Drupal\Core\StringTranslation\TranslationInterface;
 use Drupal\Core\Form\ConfigFormBase;
@@ -98,7 +99,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('aggregator.settings');
 
     // Global aggregator settings.
@@ -187,7 +188,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     parent::validateForm($form, $form_state);
     // Let active plugins validate their settings.
     foreach ($this->configurableInstances as $instance) {
@@ -198,7 +199,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     parent::submitForm($form, $form_state);
     $config = $this->config('aggregator.settings');
     // Let active plugins save their settings.
diff --git a/core/modules/aggregator/src/Plugin/AggregatorPluginSettingsBase.php b/core/modules/aggregator/src/Plugin/AggregatorPluginSettingsBase.php
index ee94c7c..eb6ad36 100644
--- a/core/modules/aggregator/src/Plugin/AggregatorPluginSettingsBase.php
+++ b/core/modules/aggregator/src/Plugin/AggregatorPluginSettingsBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\aggregator\Plugin;
 
 use Drupal\Component\Plugin\ConfigurablePluginInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\PluginBase;
 use Drupal\Core\Plugin\PluginFormInterface;
 
@@ -35,7 +36,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function validateConfigurationForm(array &$form, array &$form_state) {
+  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
   }
 
   /**
diff --git a/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php b/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
index 4381b6d..a0796b4 100644
--- a/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
+++ b/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
@@ -11,6 +11,7 @@
 use Drupal\aggregator\ItemStorageInterface;
 use Drupal\block\BlockBase;
 use Drupal\Core\Entity\Query\QueryInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Session\AccountInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -106,9 +107,9 @@ protected function blockAccess(AccountInterface $account) {
   }
 
   /**
-   * Overrides \Drupal\block\BlockBase::blockForm().
+   * {@inheritdoc}
    */
-  public function blockForm($form, &$form_state) {
+  public function blockForm($form, FormStateInterface $form_state) {
     $feeds = $this->feedStorage->loadMultiple();
     $options = array();
     foreach ($feeds as $feed) {
@@ -131,9 +132,9 @@ public function blockForm($form, &$form_state) {
   }
 
   /**
-   * Overrides \Drupal\block\BlockBase::blockSubmit().
+   * {@inheritdoc}
    */
-  public function blockSubmit($form, &$form_state) {
+  public function blockSubmit($form, FormStateInterface $form_state) {
     $this->configuration['block_count'] = $form_state['values']['block_count'];
     $this->configuration['feed'] = $form_state['values']['feed'];
   }
diff --git a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php
index 058ba18..07414eb 100644
--- a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php
+++ b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php
@@ -14,6 +14,7 @@
 use Drupal\Core\Database\Database;
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Entity\Query\QueryInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -93,7 +94,7 @@ public static function create(ContainerInterface $container, array $configuratio
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $processors = $this->configuration['processors'];
     $info = $this->getPluginDefinition();
     $counts = array(3, 5, 10, 15, 20, 25);
@@ -149,7 +150,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['items']['expire'] = $form_state['values']['aggregator_clear'];
     $this->configuration['items']['teaser_length'] = $form_state['values']['aggregator_teaser_length'];
     $this->configuration['source']['list_max'] = $form_state['values']['aggregator_summary_items'];
diff --git a/core/modules/aggregator/tests/modules/aggregator_test/src/Plugin/aggregator/processor/TestProcessor.php b/core/modules/aggregator/tests/modules/aggregator_test/src/Plugin/aggregator/processor/TestProcessor.php
index 9b76fc9..b4f5fd5 100644
--- a/core/modules/aggregator/tests/modules/aggregator_test/src/Plugin/aggregator/processor/TestProcessor.php
+++ b/core/modules/aggregator/tests/modules/aggregator_test/src/Plugin/aggregator/processor/TestProcessor.php
@@ -11,6 +11,7 @@
 use Drupal\aggregator\Plugin\ProcessorInterface;
 use Drupal\aggregator\FeedInterface;
 use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -66,7 +67,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $processors = $this->configFactory->get('aggregator.settings')->get('processors');
     $info = $this->getPluginDefinition();
 
@@ -90,7 +91,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['items']['dummy_length'] = $form_state['values']['dummy_length'];
     $this->setConfiguration($this->configuration);
   }
diff --git a/core/modules/aggregator/tests/src/Plugin/AggregatorPluginSettingsBaseTest.php b/core/modules/aggregator/tests/src/Plugin/AggregatorPluginSettingsBaseTest.php
index b9390ff..90a4b69 100644
--- a/core/modules/aggregator/tests/src/Plugin/AggregatorPluginSettingsBaseTest.php
+++ b/core/modules/aggregator/tests/src/Plugin/AggregatorPluginSettingsBaseTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\aggregator\Tests\Plugin {
 
 use Drupal\aggregator\Form\SettingsForm;
+use Drupal\Core\Form\FormState;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -73,7 +74,7 @@ public function setUp() {
    */
   public function testSettingsForm() {
     // Emulate a form state of a sumbitted form.
-    $form_state = array('values' => array('dummy_length' => '', 'aggregator_allowed_html_tags' => ''));
+    $form_state = new FormState(array('values' => array('dummy_length' => '', 'aggregator_allowed_html_tags' => '')));
 
     $test_processor = $this->getMock(
       'Drupal\aggregator_test\Plugin\aggregator\processor\TestProcessor',
diff --git a/core/modules/ban/src/Form/BanAdmin.php b/core/modules/ban/src/Form/BanAdmin.php
index 3675e09..bd87ba8 100644
--- a/core/modules/ban/src/Form/BanAdmin.php
+++ b/core/modules/ban/src/Form/BanAdmin.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Form\FormBase;
 use Drupal\ban\BanIpManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -54,7 +55,7 @@ public function getFormId() {
    *   \Drupal::formBuilder()->getForm() for use as the default value of the IP
    *   address form field.
    */
-  public function buildForm(array $form, array &$form_state, $default_ip = '') {
+  public function buildForm(array $form, FormStateInterface $form_state, $default_ip = '') {
     $rows = array();
     $header = array($this->t('banned IP addresses'), $this->t('Operations'));
     $result = $this->ipManager->findAll();
@@ -103,7 +104,7 @@ public function buildForm(array $form, array &$form_state, $default_ip = '') {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $ip = trim($form_state['values']['ip']);
     if ($this->ipManager->isBanned($ip)) {
       $this->setFormError('ip', $form_state, $this->t('This IP address is already banned.'));
@@ -119,7 +120,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $ip = trim($form_state['values']['ip']);
     $this->ipManager->banIp($ip);
     drupal_set_message($this->t('The IP address %ip has been banned.', array('%ip' => $ip)));
diff --git a/core/modules/ban/src/Form/BanDelete.php b/core/modules/ban/src/Form/BanDelete.php
index 0228778..c3f6c74 100644
--- a/core/modules/ban/src/Form/BanDelete.php
+++ b/core/modules/ban/src/Form/BanDelete.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Form\ConfirmFormBase;
 use Drupal\ban\BanIpManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@@ -78,7 +79,7 @@ public function getCancelRoute() {
    * @param string $ban_id
    *   The IP address record ID to unban.
    */
-  public function buildForm(array $form, array &$form_state, $ban_id = '') {
+  public function buildForm(array $form, FormStateInterface $form_state, $ban_id = '') {
     if (!$this->banIp = $this->ipManager->findById($ban_id)) {
       throw new NotFoundHttpException();
     }
@@ -88,7 +89,7 @@ public function buildForm(array $form, array &$form_state, $ban_id = '') {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->ipManager->unbanIp($this->banIp);
     watchdog('user', 'Deleted %ip', array('%ip' => $this->banIp));
     drupal_set_message($this->t('The IP address %ip was deleted.', array('%ip' => $this->banIp)));
diff --git a/core/modules/block/src/BlockBase.php b/core/modules/block/src/BlockBase.php
index eb6b91d..85bb7c7 100644
--- a/core/modules/block/src/BlockBase.php
+++ b/core/modules/block/src/BlockBase.php
@@ -12,6 +12,7 @@
 use Drupal\Component\Plugin\ContextAwarePluginInterface;
 use Drupal\Core\Condition\ConditionAccessResolverTrait;
 use Drupal\Core\Condition\ConditionPluginBag;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContextAwarePluginBase;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Component\Utility\NestedArray;
@@ -206,7 +207,7 @@ protected function blockAccess(AccountInterface $account) {
    *
    * @see \Drupal\block\BlockBase::blockForm()
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $definition = $this->getPluginDefinition();
     $form['provider'] = array(
       '#type' => 'value',
@@ -331,7 +332,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function blockForm($form, &$form_state) {
+  public function blockForm($form, FormStateInterface $form_state) {
     return array();
   }
 
@@ -343,7 +344,7 @@ public function blockForm($form, &$form_state) {
    *
    * @see \Drupal\block\BlockBase::blockValidate()
    */
-  public function validateConfigurationForm(array &$form, array &$form_state) {
+  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
     // Transform the #type = checkboxes value to a numerically indexed array.
     $form_state['values']['cache']['contexts'] = array_values(array_filter($form_state['values']['cache']['contexts']));
 
@@ -361,7 +362,7 @@ public function validateConfigurationForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function blockValidate($form, &$form_state) {}
+  public function blockValidate($form, FormStateInterface $form_state) {}
 
   /**
    * {@inheritdoc}
@@ -371,7 +372,7 @@ public function blockValidate($form, &$form_state) {}
    *
    * @see \Drupal\block\BlockBase::blockSubmit()
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     // Process the block's submission handling if no errors occurred only.
     if (!form_get_errors($form_state)) {
       $this->configuration['label'] = $form_state['values']['label'];
@@ -392,7 +393,7 @@ public function submitConfigurationForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function blockSubmit($form, &$form_state) {}
+  public function blockSubmit($form, FormStateInterface $form_state) {}
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/block/src/BlockForm.php b/core/modules/block/src/BlockForm.php
index f562f52..388a769 100644
--- a/core/modules/block/src/BlockForm.php
+++ b/core/modules/block/src/BlockForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -52,7 +53,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $entity = $this->entity;
 
     // Store theme settings in $form_state for use below.
@@ -133,7 +134,7 @@ public function themeSwitch($form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->t('Save block');
     return $actions;
@@ -142,7 +143,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     parent::validate($form, $form_state);
 
     // The Block Entity form puts all block plugin form elements in the
@@ -157,7 +158,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     parent::submit($form, $form_state);
 
     $entity = $this->entity;
diff --git a/core/modules/block/src/BlockListBuilder.php b/core/modules/block/src/BlockListBuilder.php
index 1bf034d..1b26b9f 100644
--- a/core/modules/block/src/BlockListBuilder.php
+++ b/core/modules/block/src/BlockListBuilder.php
@@ -15,6 +15,7 @@
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Form\FormInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\Request;
 
@@ -133,7 +134,7 @@ public function getFormId() {
    *
    * Form constructor for the main block administration form.
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $placement = FALSE;
     if ($this->request->query->has('block-placement')) {
       $placement = $this->request->query->get('block-placement');
@@ -388,7 +389,7 @@ public function getDefaultOperations(EntityInterface $entity) {
   /**
    * Implements \Drupal\Core\Form\FormInterface::validateForm().
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     // No validation.
   }
 
@@ -397,7 +398,7 @@ public function validateForm(array &$form, array &$form_state) {
    *
    * Form submission handler for the main block administration form.
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $entities = entity_load_multiple('block', array_keys($form_state['values']['blocks']));
     foreach ($entities as $entity_id => $entity) {
       $entity->set('weight', $form_state['values']['blocks'][$entity_id]['weight']);
diff --git a/core/modules/block/src/BlockPluginInterface.php b/core/modules/block/src/BlockPluginInterface.php
index f1a94ca..ee44096 100644
--- a/core/modules/block/src/BlockPluginInterface.php
+++ b/core/modules/block/src/BlockPluginInterface.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Cache\CacheableInterface;
 use Drupal\Component\Plugin\PluginInspectionInterface;
 use Drupal\Component\Plugin\ConfigurablePluginInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\PluginFormInterface;
 use Drupal\Core\Session\AccountInterface;
 
@@ -88,13 +89,13 @@ public function setConfigurationValue($key, $value);
    *
    * @param array $form
    *   The form definition array for the block configuration form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   An array containing the current state of the configuration form.
    *
    * @return array $form
    *   The renderable form array representing the entire configuration form.
    */
-  public function blockForm($form, &$form_state);
+  public function blockForm($form, FormStateInterface $form_state);
 
   /**
    * Adds block type-specific validation for the block form.
@@ -105,13 +106,13 @@ public function blockForm($form, &$form_state);
    *
    * @param array $form
    *   The form definition array for the full block configuration form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   An array containing the current state of the configuration form.
    *
    * @see \Drupal\block\BlockPluginInterface::blockForm()
    * @see \Drupal\block\BlockPluginInterface::blockSubmit()
    */
-  public function blockValidate($form, &$form_state);
+  public function blockValidate($form, FormStateInterface $form_state);
 
   /**
    * Adds block type-specific submission handling for the block form.
@@ -122,13 +123,13 @@ public function blockValidate($form, &$form_state);
    *
    * @param array $form
    *   The form definition array for the full block configuration form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   An array containing the current state of the configuration form.
    *
    * @see \Drupal\block\BlockPluginInterface::blockForm()
    * @see \Drupal\block\BlockPluginInterface::blockValidate()
    */
-  public function blockSubmit($form, &$form_state);
+  public function blockSubmit($form, FormStateInterface $form_state);
 
   /**
    * Suggests a machine name to identify an instance of this block.
diff --git a/core/modules/block/src/Form/BlockDeleteForm.php b/core/modules/block/src/Form/BlockDeleteForm.php
index 957249f..89ebef3 100644
--- a/core/modules/block/src/Form/BlockDeleteForm.php
+++ b/core/modules/block/src/Form/BlockDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\block\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -39,7 +40,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     drupal_set_message($this->t('The block %name has been removed.', array('%name' => $this->entity->label())));
     $form_state['redirect_route'] = $this->getCancelRoute();
diff --git a/core/modules/block/src/Plugin/views/display/Block.php b/core/modules/block/src/Plugin/views/display/Block.php
index 9ee2ca9..aaa79d9 100644
--- a/core/modules/block/src/Plugin/views/display/Block.php
+++ b/core/modules/block/src/Plugin/views/display/Block.php
@@ -222,7 +222,7 @@ public function submitOptionsForm(&$form, &$form_state) {
    *   The ViewsBlock plugin.
    * @param array $form
    *   The form definition array for the block configuration form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   An array containing the current state of the configuration form.
    *
    * @return array $form
@@ -230,7 +230,7 @@ public function submitOptionsForm(&$form, &$form_state) {
    *
    * @see \Drupal\views\Plugin\Block\ViewsBlock::blockForm()
    */
-  public function blockForm(ViewsBlock $block, array &$form, array &$form_state) {
+  public function blockForm(ViewsBlock $block, array &$form, &$form_state) {
     $allow_settings = array_filter($this->getOption('allow'));
 
     $block_configuration = $block->getConfiguration();
@@ -267,12 +267,12 @@ public function blockForm(ViewsBlock $block, array &$form, array &$form_state) {
    *   The ViewsBlock plugin.
    * @param array $form
    *   The form definition array for the block configuration form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   An array containing the current state of the configuration form.
    *
    * @see \Drupal\views\Plugin\Block\ViewsBlock::blockValidate()
    */
-  public function blockValidate(ViewsBlock $block, array $form, array &$form_state) {
+  public function blockValidate(ViewsBlock $block, array $form, &$form_state) {
   }
 
   /**
@@ -282,7 +282,7 @@ public function blockValidate(ViewsBlock $block, array $form, array &$form_state
    *   The ViewsBlock plugin.
    * @param array $form
    *   The form definition array for the full block configuration form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   An array containing the current state of the configuration form.
    *
    * * @see \Drupal\views\Plugin\Block\ViewsBlock::blockSubmit()
diff --git a/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestBlockInstantiation.php b/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestBlockInstantiation.php
index 9a4db70..255ba63 100644
--- a/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestBlockInstantiation.php
+++ b/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestBlockInstantiation.php
@@ -8,6 +8,7 @@
 namespace Drupal\block_test\Plugin\Block;
 
 use Drupal\block\BlockBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 
 /**
@@ -39,7 +40,7 @@ protected function blockAccess(AccountInterface $account) {
   /**
    * {@inheritdoc}
    */
-  public function blockForm($form, &$form_state) {
+  public function blockForm($form, FormStateInterface $form_state) {
     $form['display_message'] = array(
       '#type' => 'textfield',
       '#title' => t('Display message'),
@@ -51,7 +52,7 @@ public function blockForm($form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function blockSubmit($form, &$form_state) {
+  public function blockSubmit($form, FormStateInterface $form_state) {
     $this->configuration['display_message'] = $form_state['values']['display_message'];
   }
 
diff --git a/core/modules/block_content/src/BlockContentForm.php b/core/modules/block_content/src/BlockContentForm.php
index 22ef45b..1524f42 100644
--- a/core/modules/block_content/src/BlockContentForm.php
+++ b/core/modules/block_content/src/BlockContentForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Entity\ContentEntityForm;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Language\LanguageManager;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -83,7 +84,7 @@ protected function prepareEntity() {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $block = $this->entity;
     $account = $this->currentUser();
 
@@ -174,7 +175,7 @@ public function form(array $form, array &$form_state) {
    * form state's entity with the current step's values before proceeding to the
    * next step.
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     // Build the block object from the submitted values.
     $block = parent::submit($form, $form_state);
 
@@ -189,7 +190,7 @@ public function submit(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $block = $this->entity;
     $insert = $block->isNew();
     $block->save();
@@ -236,7 +237,7 @@ public function save(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     if ($this->entity->isNew()) {
       $exists = $this->blockContentStorage->loadByProperties(array('info' => $form_state['values']['info']));
       if (!empty($exists)) {
diff --git a/core/modules/block_content/src/BlockContentTranslationHandler.php b/core/modules/block_content/src/BlockContentTranslationHandler.php
index 148e249..ca7a6d9 100644
--- a/core/modules/block_content/src/BlockContentTranslationHandler.php
+++ b/core/modules/block_content/src/BlockContentTranslationHandler.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\content_translation\ContentTranslationHandler;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Defines the translation handler for custom blocks.
@@ -18,7 +19,7 @@ class BlockContentTranslationHandler extends ContentTranslationHandler {
   /**
    * {@inheritdoc}
    */
-  public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) {
+  public function entityFormAlter(array &$form, FormStateInterface $form_state, EntityInterface $entity) {
     parent::entityFormAlter($form, $form_state, $entity);
     // Move the translation fieldset to a vertical tab.
     if (isset($form['translation'])) {
diff --git a/core/modules/block_content/src/BlockContentTypeForm.php b/core/modules/block_content/src/BlockContentTypeForm.php
index e64bfa3..025d673 100644
--- a/core/modules/block_content/src/BlockContentTypeForm.php
+++ b/core/modules/block_content/src/BlockContentTypeForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Base form for category edit forms.
@@ -16,9 +17,9 @@
 class BlockContentTypeForm extends EntityForm {
 
   /**
-   * Overrides \Drupal\Core\Entity\EntityForm::form().
+   * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form = parent::form($form, $form_state);
 
     $block_type = $this->entity;
@@ -87,7 +88,7 @@ public function form(array $form, array &$form_state) {
   /**
    * Overrides \Drupal\Core\Entity\EntityForm::save().
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $block_type = $this->entity;
     $status = $block_type->save();
 
diff --git a/core/modules/block_content/src/Form/BlockContentDeleteForm.php b/core/modules/block_content/src/Form/BlockContentDeleteForm.php
index 35c0386..3326dcf 100644
--- a/core/modules/block_content/src/Form/BlockContentDeleteForm.php
+++ b/core/modules/block_content/src/Form/BlockContentDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\block_content\Form;
 
 use Drupal\Core\Entity\ContentEntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -39,7 +40,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $instances = $this->entity->getInstances();
 
     $form['message'] = array(
@@ -53,7 +54,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     drupal_set_message($this->t('Custom block %label has been deleted.', array('%label' => $this->entity->label())));
     watchdog('block_content', 'Custom block %label has been deleted.', array('%label' => $this->entity->label()), WATCHDOG_NOTICE);
diff --git a/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php b/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php
index 7e196ee..34ae5b9 100644
--- a/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php
+++ b/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
 use Drupal\Core\Entity\Query\QueryFactory;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -67,7 +68,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $blocks = $this->queryFactory->get('block_content')->condition('type', $this->entity->id())->execute();
     if (!empty($blocks)) {
       $caption = '<p>' . format_plural(count($blocks), '%label is used by 1 custom block on your site. You can not remove this block type until you have removed all of the %label blocks.', '%label is used by @count custom blocks on your site. You may not remove %label until you have removed all of the %label custom blocks.', array('%label' => $this->entity->label())) . '</p>';
@@ -82,7 +83,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     drupal_set_message(t('Custom block type %label has been deleted.', array('%label' => $this->entity->label())));
     watchdog('block_content', 'Custom block type %label has been deleted.', array('%label' => $this->entity->label()), WATCHDOG_NOTICE);
diff --git a/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php
index 49a53dc..8a5a409 100644
--- a/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php
+++ b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php
@@ -11,6 +11,7 @@
 use Drupal\block\BlockManagerInterface;
 use Drupal\Core\Entity\EntityManager;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Session\AccountInterface;
@@ -120,7 +121,7 @@ public function defaultConfiguration() {
    *
    * Adds body and description fields to the block configuration form.
    */
-  public function blockForm($form, &$form_state) {
+  public function blockForm($form, FormStateInterface $form_state) {
     $form['block_content']['view_mode'] = array(
       '#type' => 'select',
       '#options' => $this->entityManager->getViewModeOptions('block_content'),
@@ -133,9 +134,9 @@ public function blockForm($form, &$form_state) {
   }
 
   /**
-   * Overrides \Drupal\block\BlockBase::blockSubmit().
+   * {@inheritdoc}
    */
-  public function blockSubmit($form, &$form_state) {
+  public function blockSubmit($form, FormStateInterface $form_state) {
     // Invalidate the block cache to update custom block-based derivatives.
     if ($this->moduleHandler->moduleExists('block')) {
       $this->configuration['view_mode'] = $form_state['values']['block_content']['view_mode'];
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index ba00049..0ce96bc 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -309,7 +309,7 @@ function book_node_predelete(EntityInterface $node) {
 /**
  * Implements hook_node_prepare_form().
  */
-function book_node_prepare_form(NodeInterface $node, $operation, array &$form_state) {
+function book_node_prepare_form(NodeInterface $node, $operation, &$form_state) {
   /** @var \Drupal\book\BookManagerInterface $book_manager */
   $book_manager = \Drupal::service('book.manager');
 
diff --git a/core/modules/book/src/BookManager.php b/core/modules/book/src/BookManager.php
index c491cf4..45f9adf 100644
--- a/core/modules/book/src/BookManager.php
+++ b/core/modules/book/src/BookManager.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\StringTranslation\TranslationInterface;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
@@ -168,7 +169,7 @@ protected function findChildrenRelativeDepth(array $book_link) {
   /**
    * {@inheritdoc}
    */
-  public function addFormElements(array $form, array &$form_state, NodeInterface $node, AccountInterface $account, $collapsed = TRUE) {
+  public function addFormElements(array $form, FormStateInterface $form_state, NodeInterface $node, AccountInterface $account, $collapsed = TRUE) {
     // If the form is being processed during the Ajax callback of our book bid
     // dropdown, then $form_state will hold the value that was selected.
     if (isset($form_state['values']['book'])) {
diff --git a/core/modules/book/src/BookManagerInterface.php b/core/modules/book/src/BookManagerInterface.php
index 81dfe08..72ca61e 100644
--- a/core/modules/book/src/BookManagerInterface.php
+++ b/core/modules/book/src/BookManagerInterface.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\book;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\node\NodeInterface;
 
@@ -203,8 +204,8 @@ public function getBookParents(array $item, array $parent = array());
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    * @param \Drupal\node\NodeInterface $node
    *   The node whose form is being viewed.
    * @param \Drupal\Core\Session\AccountInterface $account
@@ -215,7 +216,7 @@ public function getBookParents(array $item, array $parent = array());
    * @return array
    *   The form structure, with the book elements added.
    */
-  public function addFormElements(array $form, array &$form_state, NodeInterface $node, AccountInterface $account, $collapsed = TRUE);
+  public function addFormElements(array $form, FormStateInterface $form_state, NodeInterface $node, AccountInterface $account, $collapsed = TRUE);
 
   /**
    * Deletes node's entry from book table.
diff --git a/core/modules/book/src/Form/BookAdminEditForm.php b/core/modules/book/src/Form/BookAdminEditForm.php
index f52c2e4..9a342f0 100644
--- a/core/modules/book/src/Form/BookAdminEditForm.php
+++ b/core/modules/book/src/Form/BookAdminEditForm.php
@@ -11,6 +11,7 @@
 use Drupal\Component\Utility\Crypt;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\node\NodeInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -68,7 +69,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, NodeInterface $node = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, NodeInterface $node = NULL) {
     $form['#title'] = $node->label();
     $form['#node'] = $node;
     $this->bookAdminTable($node, $form);
@@ -83,7 +84,7 @@ public function buildForm(array $form, array &$form_state, NodeInterface $node =
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     if ($form_state['values']['tree_hash'] != $form_state['values']['tree_current_hash']) {
       $this->setFormError('', $form_state, $this->t('This book has been modified by another user, the changes could not be saved.'));
     }
@@ -92,7 +93,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Save elements in the same order as defined in post rather than the form.
     // This ensures parents are updated before their children, preventing orphans.
     $order = array_flip(array_keys($form_state['input']['table']));
diff --git a/core/modules/book/src/Form/BookOutlineForm.php b/core/modules/book/src/Form/BookOutlineForm.php
index f4a97a1..26123c7 100644
--- a/core/modules/book/src/Form/BookOutlineForm.php
+++ b/core/modules/book/src/Form/BookOutlineForm.php
@@ -10,6 +10,7 @@
 use Drupal\book\BookManagerInterface;
 use Drupal\Core\Entity\ContentEntityForm;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -64,7 +65,7 @@ public function getBaseFormID() {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form['#title'] = $this->entity->label();
 
     if (!isset($this->entity->book)) {
@@ -87,7 +88,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->entity->book['original_bid'] ? $this->t('Update book outline') : $this->t('Add to book outline');
     $actions['delete']['#value'] = $this->t('Remove from book outline');
@@ -100,7 +101,7 @@ protected function actions(array $form, array &$form_state) {
    *
    * @see book_remove_button_submit()
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $form_state['redirect_route'] = array(
       'route_name' => 'node.view',
       'route_parameters' => array(
@@ -132,7 +133,7 @@ public function submit(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function delete(array $form, array &$form_state) {
+  public function delete(array $form, &$form_state) {
     $form_state['redirect_route'] = $this->entity->urlInfo('book-remove-form');
   }
 
diff --git a/core/modules/book/src/Form/BookRemoveForm.php b/core/modules/book/src/Form/BookRemoveForm.php
index 23be3ec..16a719d 100644
--- a/core/modules/book/src/Form/BookRemoveForm.php
+++ b/core/modules/book/src/Form/BookRemoveForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\book\BookManagerInterface;
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Drupal\node\NodeInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -61,7 +62,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, NodeInterface $node = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, NodeInterface $node = NULL) {
     $this->node = $node;
     return parent::buildForm($form, $form_state);
   }
@@ -103,7 +104,7 @@ public function getCancelRoute() {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     if ($this->bookManager->checkNodeIsRemovable($this->node)) {
       $this->bookManager->deleteFromBook($this->node->id());
       drupal_set_message($this->t('The post has been removed from the book.'));
diff --git a/core/modules/book/src/Form/BookSettingsForm.php b/core/modules/book/src/Form/BookSettingsForm.php
index 140f8e5..4a7535e 100644
--- a/core/modules/book/src/Form/BookSettingsForm.php
+++ b/core/modules/book/src/Form/BookSettingsForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\book\Form;
 
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Configure book settings for this site.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $types = node_type_get_names();
     $config = $this->config('book.settings');
     $form['book_allowed_types'] = array(
@@ -50,7 +51,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $child_type = $form_state['values']['book_child_type'];
     if (empty($form_state['values']['book_allowed_types'][$child_type])) {
       $this->setFormError('book_child_type', $form_state, $this->t('The content type for the %add-child link must be one of those selected as an allowed book outline type.', array('%add-child' => $this->t('Add child page'))));
@@ -62,7 +63,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $allowed_types = array_filter($form_state['values']['book_allowed_types']);
     // We need to save the allowed types in an array ordered by machine_name so
     // that we can save them in the correct order if node type changes.
diff --git a/core/modules/book/src/Plugin/Block/BookNavigationBlock.php b/core/modules/book/src/Plugin/Block/BookNavigationBlock.php
index 5e85d99..51d0a0d 100644
--- a/core/modules/book/src/Plugin/Block/BookNavigationBlock.php
+++ b/core/modules/book/src/Plugin/Block/BookNavigationBlock.php
@@ -9,6 +9,7 @@
 
 use Drupal\block\BlockBase;
 use Drupal\book\BookManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\RequestStack;
@@ -82,9 +83,9 @@ public function defaultConfiguration() {
   }
 
   /**
-   * Overrides \Drupal\block\BlockBase::blockForm()
+   * {@inheritdoc}
    */
-  function blockForm($form, &$form_state) {
+  function blockForm($form, FormStateInterface $form_state) {
     $options = array(
       'all pages' => t('Show block on all pages'),
       'book pages' => t('Show block only on book pages'),
@@ -101,9 +102,9 @@ function blockForm($form, &$form_state) {
   }
 
   /**
-   * Overrides \Drupal\block\BlockBase::blockSubmit().
+   * {@inheritdoc}
    */
-  public function blockSubmit($form, &$form_state) {
+  public function blockSubmit($form, FormStateInterface $form_state) {
     $this->configuration['block_mode'] = $form_state['values']['book_block_mode'];
   }
 
diff --git a/core/modules/ckeditor/src/CKEditorPluginConfigurableInterface.php b/core/modules/ckeditor/src/CKEditorPluginConfigurableInterface.php
index 619eb51..a5084fd 100644
--- a/core/modules/ckeditor/src/CKEditorPluginConfigurableInterface.php
+++ b/core/modules/ckeditor/src/CKEditorPluginConfigurableInterface.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\ckeditor;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\editor\Entity\Editor;
 
 /**
@@ -36,7 +37,7 @@
    *
    * @param array $form
    *   An empty form array to be populated with a configuration form, if any.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The state of the entire filter administration form.
    * @param \Drupal\editor\Entity\Editor $editor
    *   A configured text editor object.
@@ -44,6 +45,6 @@
    * @return array|FALSE
    *   A render array for the settings form, or FALSE if there is none.
    */
-  public function settingsForm(array $form, array &$form_state, Editor $editor);
+  public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor);
 
 }
diff --git a/core/modules/ckeditor/src/CKEditorPluginManager.php b/core/modules/ckeditor/src/CKEditorPluginManager.php
index dab891d..96d2b0f 100644
--- a/core/modules/ckeditor/src/CKEditorPluginManager.php
+++ b/core/modules/ckeditor/src/CKEditorPluginManager.php
@@ -147,12 +147,12 @@ public function getButtons() {
    *
    * @param array &$form
    *   A reference to an associative array containing the structure of the form.
-   * @param array &$form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A reference to a keyed array containing the current state of the form.
    * @param \Drupal\editor\Entity\Editor $editor
    *   A configured text editor object.
    */
-  public function injectPluginSettingsForm(array &$form, array &$form_state, Editor $editor) {
+  public function injectPluginSettingsForm(array &$form, &$form_state, Editor $editor) {
     $definitions = $this->getDefinitions();
 
     foreach (array_keys($definitions) as $plugin_id) {
diff --git a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php
index d9f411c..4a1329c 100644
--- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php
+++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php
@@ -9,6 +9,7 @@
 
 use Drupal\ckeditor\CKEditorPluginBase;
 use Drupal\ckeditor\CKEditorPluginConfigurableInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\editor\Entity\Editor;
 
 /**
@@ -66,7 +67,7 @@ public function getButtons() {
    * @see \Drupal\editor\Form\EditorImageDialog
    * @see editor_image_upload_settings_form()
    */
-  public function settingsForm(array $form, array &$form_state, Editor $editor) {
+  public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor) {
     form_load_include($form_state, 'inc', 'editor', 'editor.admin');
     $form['image_upload'] = editor_image_upload_settings_form($editor);
     $form['image_upload']['#attached']['library'][] = 'ckeditor/drupal.ckeditor.drupalimage.admin';
@@ -83,7 +84,7 @@ public function settingsForm(array $form, array &$form_state, Editor $editor) {
    * @see \Drupal\editor\Form\EditorImageDialog
    * @see editor_image_upload_settings_form()
    */
-  function validateImageUploadSettings(array $element, array &$form_state) {
+  function validateImageUploadSettings(array $element, FormStateInterface $form_state) {
     $settings = &$form_state['values']['editor']['settings']['plugins']['drupalimage']['image_upload'];
     $form_state['editor']->setImageUploadSettings($settings);
     unset($form_state['values']['editor']['settings']['plugins']['drupalimage']);
diff --git a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php
index 2184cf2..963436d 100644
--- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php
+++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php
@@ -10,6 +10,7 @@
 use Drupal\ckeditor\CKEditorPluginBase;
 use Drupal\ckeditor\CKEditorPluginConfigurableInterface;
 use Drupal\Component\Utility\NestedArray;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\editor\Entity\Editor;
 
 /**
@@ -66,7 +67,7 @@ public function getButtons() {
   /**
    * Implements \Drupal\ckeditor\Plugin\CKEditorPluginConfigurableInterface::settingsForm().
    */
-  public function settingsForm(array $form, array &$form_state, Editor $editor) {
+  public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor) {
     // Defaults.
     $config = array('styles' => '');
     $settings = $editor->getSettings();
@@ -94,7 +95,7 @@ public function settingsForm(array $form, array &$form_state, Editor $editor) {
   /**
    * #element_validate handler for the "styles" element in settingsForm().
    */
-  public function validateStylesValue(array $element, array &$form_state) {
+  public function validateStylesValue(array $element, FormStateInterface $form_state) {
     if ($this->generateStylesSetSetting($element['#value']) === FALSE) {
       form_error($element, $form_state, t('The provided list of styles is syntactically incorrect.'));
     }
diff --git a/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php b/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php
index d538b60..b377f73 100644
--- a/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php
+++ b/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\ckeditor\CKEditorPluginManager;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageManager;
 use Drupal\Core\Render\Element;
 use Drupal\editor\Plugin\EditorBase;
@@ -127,7 +128,7 @@ public function getDefaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state, EditorEntity $editor) {
+  public function settingsForm(array $form, FormStateInterface $form_state, EditorEntity $editor) {
     $settings = $editor->getSettings();
 
     $ckeditor_settings_toolbar = array(
@@ -234,7 +235,7 @@ public function settingsForm(array $form, array &$form_state, EditorEntity $edit
   /**
    * {@inheritdoc}
    */
-  public function settingsFormSubmit(array $form, array &$form_state) {
+  public function settingsFormSubmit(array $form, FormStateInterface $form_state) {
     // Modify the toolbar settings by reference. The values in
     // $form_state['values']['editor']['settings'] will be saved directly by
     // editor_form_filter_admin_format_submit().
diff --git a/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextualAndButton.php b/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextualAndButton.php
index 171e3b3..4c43cb7 100644
--- a/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextualAndButton.php
+++ b/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextualAndButton.php
@@ -11,6 +11,7 @@
 use Drupal\ckeditor\CKEditorPluginContextualInterface;
 use Drupal\ckeditor\CKEditorPluginConfigurableInterface;
 use Drupal\Component\Plugin\PluginBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\editor\Entity\Editor;
 
 /**
@@ -61,7 +62,7 @@ function getFile() {
   /**
    * Implements \Drupal\ckeditor\Plugin\CKEditorPluginConfigurableInterface::settingsForm().
    */
-  function settingsForm(array $form, array &$form_state, Editor $editor) {
+  function settingsForm(array $form, FormStateInterface $form_state, Editor $editor) {
     // Defaults.
     $config = array('ultra_llama_mode' => FALSE);
     $settings = $editor->getSettings();
diff --git a/core/modules/color/color.module b/core/modules/color/color.module
index c82e8d1..0934bba 100644
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -285,14 +285,14 @@ function template_preprocess_color_scheme_form(&$variables) {
  * @param string|bool $input
  *   The incoming input to populate the form element. If this is FALSE,
  *   the element's default value should be returned.
- * @param array $form_state
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   A keyed array containing the current state of the form.
  *
  * @return string
  *   The data that will appear in the $form_state['values'] collection for this
  *   element. Return nothing to use the default.
  */
-function color_palette_color_value($element, $input = FALSE, $form_state = array()) {
+function color_palette_color_value($element, $input = FALSE, $form_state = NULL) {
   // If we suspect a possible cross-site request forgery attack, only accept
   // hexadecimal CSS color strings from user input, to avoid problems when this
   // value is used in the JavaScript preview.
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index a98ea09..3752118 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -874,7 +874,7 @@ function comment_user_predelete($account) {
  * @return array
  *   An array as expected by drupal_render().
  */
-function comment_preview(CommentInterface $comment, array &$form_state) {
+function comment_preview(CommentInterface $comment, &$form_state) {
   $preview_build = array();
   $entity = $comment->getCommentedEntity();
 
diff --git a/core/modules/comment/src/CommentForm.php b/core/modules/comment/src/CommentForm.php
index db4178d..0382128 100644
--- a/core/modules/comment/src/CommentForm.php
+++ b/core/modules/comment/src/CommentForm.php
@@ -13,6 +13,7 @@
 use Drupal\Core\Datetime\DrupalDateTime;
 use Drupal\Core\Entity\ContentEntityForm;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Session\AccountInterface;
@@ -56,7 +57,7 @@ public function __construct(EntityManagerInterface $entity_manager, AccountInter
   /**
    * {@inheritdoc}
    */
-  protected function init(array &$form_state) {
+  protected function init(FormStateInterface $form_state) {
     $comment = $this->entity;
 
     // Make the comment inherit the current content language unless specifically
@@ -72,7 +73,7 @@ protected function init(array &$form_state) {
   /**
    * Overrides Drupal\Core\Entity\EntityForm::form().
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     /** @var \Drupal\comment\CommentInterface $comment */
     $comment = $this->entity;
     $entity = $this->entityManager->getStorage($comment->getCommentedEntityTypeId())->load($comment->getCommentedEntityId());
@@ -218,7 +219,7 @@ public function form(array $form, array &$form_state) {
   /**
    * Overrides Drupal\Core\Entity\EntityForm::actions().
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $element = parent::actions($form, $form_state);
     /* @var \Drupal\comment\CommentInterface $comment */
     $comment = $this->entity;
@@ -255,7 +256,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * Overrides Drupal\Core\Entity\EntityForm::validate().
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     parent::validate($form, $form_state);
     $entity = $this->entity;
 
@@ -289,7 +290,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * Overrides EntityForm::buildEntity().
    */
-  public function buildEntity(array $form, array &$form_state) {
+  public function buildEntity(array $form, FormStateInterface $form_state) {
     $comment = parent::buildEntity($form, $form_state);
     if (!empty($form_state['values']['date']) && $form_state['values']['date'] instanceOf DrupalDateTime) {
       $comment->setCreatedTime($form_state['values']['date']->getTimestamp());
@@ -304,7 +305,7 @@ public function buildEntity(array $form, array &$form_state) {
   /**
    * Overrides Drupal\Core\Entity\EntityForm::submit().
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     /** @var \Drupal\comment\CommentInterface $comment */
     $comment = parent::submit($form, $form_state);
 
@@ -348,7 +349,7 @@ public function submit(array $form, array &$form_state) {
    * @param $form_state
    *   A reference to a keyed array containing the current state of the form.
    */
-  public function preview(array &$form, array &$form_state) {
+  public function preview(array &$form, &$form_state) {
     $comment = $this->entity;
     $form_state['comment_preview'] = comment_preview($comment, $form_state);
     $form_state['comment_preview']['#title'] = $this->t('Preview comment');
@@ -358,7 +359,7 @@ public function preview(array &$form, array &$form_state) {
   /**
    * Overrides Drupal\Core\Entity\EntityForm::save().
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $comment = $this->entity;
     $entity = $comment->getCommentedEntity();
     $field_name = $comment->getFieldName();
diff --git a/core/modules/comment/src/CommentTypeForm.php b/core/modules/comment/src/CommentTypeForm.php
index 43367a5..332e911 100644
--- a/core/modules/comment/src/CommentTypeForm.php
+++ b/core/modules/comment/src/CommentTypeForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Psr\Log\LoggerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -58,7 +59,7 @@ public function __construct(EntityManagerInterface $entity_manager, LoggerInterf
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form = parent::form($form, $form_state);
 
     $comment_type = $this->entity;
@@ -132,7 +133,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $comment_type = $this->entity;
     $status = $comment_type->save();
 
diff --git a/core/modules/comment/src/Form/CommentAdminOverview.php b/core/modules/comment/src/Form/CommentAdminOverview.php
index b58aa0d..7b633d9 100644
--- a/core/modules/comment/src/Form/CommentAdminOverview.php
+++ b/core/modules/comment/src/Form/CommentAdminOverview.php
@@ -14,6 +14,7 @@
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -92,15 +93,15 @@ public function getFormID() {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    * @param string $type
    *   The type of the overview form ('approval' or 'new').
    *
    * @return array
    *   The form structure.
    */
-  public function buildForm(array $form, array &$form_state, $type = 'new') {
+  public function buildForm(array $form, FormStateInterface $form_state, $type = 'new') {
 
     // Build an 'Update options' form.
     $form['options'] = array(
@@ -250,7 +251,7 @@ public function buildForm(array $form, array &$form_state, $type = 'new') {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $form_state['values']['comments'] = array_diff($form_state['values']['comments'], array(0));
     // We can't execute any 'Update options' if no comments were selected.
     if (count($form_state['values']['comments']) == 0) {
@@ -261,7 +262,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $operation = $form_state['values']['operation'];
     $cids = $form_state['values']['comments'];
 
diff --git a/core/modules/comment/src/Form/CommentTypeDeleteForm.php b/core/modules/comment/src/Form/CommentTypeDeleteForm.php
index d653e56..1cc1143 100644
--- a/core/modules/comment/src/Form/CommentTypeDeleteForm.php
+++ b/core/modules/comment/src/Form/CommentTypeDeleteForm.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Entity\EntityConfirmFormBase;
 use Drupal\Core\Entity\EntityManager;
 use Drupal\Core\Entity\Query\QueryFactory;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Drupal\field\Entity\FieldConfig;
 use Psr\Log\LoggerInterface;
@@ -111,7 +112,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $comments = $this->queryFactory->get('comment')->condition('comment_type', $this->entity->id())->execute();
     $entity_type = $this->entity->getTargetEntityTypeId();
     $caption = '';
@@ -140,7 +141,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     $form_state['redirect_route']['route_name'] = 'comment.type_list';
     drupal_set_message($this->t('Comment type %label has been deleted.', array('%label' => $this->entity->label())));
diff --git a/core/modules/comment/src/Form/ConfirmDeleteMultiple.php b/core/modules/comment/src/Form/ConfirmDeleteMultiple.php
index 3a81b1a..4f49a44 100644
--- a/core/modules/comment/src/Form/ConfirmDeleteMultiple.php
+++ b/core/modules/comment/src/Form/ConfirmDeleteMultiple.php
@@ -10,6 +10,7 @@
 use Drupal\comment\CommentStorageInterface;
 use Drupal\Component\Utility\String;
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -82,7 +83,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $edit = $form_state['input'];
 
     $form['comments'] = array(
@@ -116,7 +117,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     if ($form_state['values']['confirm']) {
       $this->commentStorage->delete($this->comments);
       $count = count($form_state['values']['comments']);
diff --git a/core/modules/comment/src/Form/DeleteForm.php b/core/modules/comment/src/Form/DeleteForm.php
index 175ae25..c241589 100644
--- a/core/modules/comment/src/Form/DeleteForm.php
+++ b/core/modules/comment/src/Form/DeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\comment\Form;
 
 use Drupal\Core\Entity\ContentEntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides the comment delete confirmation form.
@@ -46,7 +47,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     // Delete the comment and its replies.
     $this->entity->delete();
     drupal_set_message($this->t('The comment and all its replies have been deleted.'));
diff --git a/core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php b/core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php
index ad59c96..87ec9e7 100644
--- a/core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php
+++ b/core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\Tags;
 use Drupal\Core\Action\ConfigurableActionBase;
 use Drupal\comment\CommentInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Unpublishes a comment containing certain keywords.
@@ -49,7 +50,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form['keywords'] = array(
       '#title' => t('Keywords'),
       '#type' => 'textarea',
@@ -62,7 +63,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['keywords'] = Tags::explode($form_state['values']['keywords']);
   }
 
diff --git a/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php b/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
index 4597761..e140bc3 100644
--- a/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
+++ b/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Entity\EntityViewBuilderInterface;
 use Drupal\Core\Entity\EntityFormBuilderInterface;
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FormatterBase;
@@ -232,7 +233,7 @@ public function viewElements(FieldItemListInterface $items) {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element = array();
     $element['pager_id'] = array(
       '#type' => 'select',
diff --git a/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php b/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php
index 33a88b5..57e41d8 100644
--- a/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php
+++ b/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php
@@ -10,6 +10,7 @@
 use Drupal\comment\CommentManagerInterface;
 use Drupal\comment\Entity\CommentType;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\TypedData\DataDefinition;
 use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\Session\AnonymousUserSession;
@@ -98,7 +99,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
   /**
    * {@inheritdoc}
    */
-  public function instanceSettingsForm(array $form, array &$form_state) {
+  public function instanceSettingsForm(array $form, FormStateInterface $form_state) {
     $element = array();
 
     $settings = $this->getSettings();
@@ -188,7 +189,7 @@ public function isEmpty() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array &$form, array &$form_state, $has_data) {
+  public function settingsForm(array &$form, FormStateInterface $form_state, $has_data) {
     $element = array();
 
     // @todo Inject entity storage once typed-data supports container injection.
diff --git a/core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php b/core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php
index 4b8de0a..0f6d44b 100644
--- a/core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php
+++ b/core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php
@@ -10,6 +10,7 @@
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides a default comment widget.
@@ -27,7 +28,7 @@ class CommentWidget extends WidgetBase {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $entity = $items->getEntity();
 
     $element['status'] = array(
@@ -86,7 +87,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
   /**
    * {@inheritdoc}
    */
-  public function massageFormValues(array $values, array $form, array &$form_state) {
+  public function massageFormValues(array $values, array $form, FormStateInterface $form_state) {
     // Add default values for statistics properties because we don't want to
     // have them in form.
     foreach ($values as &$value) {
diff --git a/core/modules/comment/src/Plugin/views/wizard/Comment.php b/core/modules/comment/src/Plugin/views/wizard/Comment.php
index c2c4ff4..537e95e 100644
--- a/core/modules/comment/src/Plugin/views/wizard/Comment.php
+++ b/core/modules/comment/src/Plugin/views/wizard/Comment.php
@@ -73,7 +73,7 @@ protected function rowStyleOptions() {
     return $options;
   }
 
-  protected function buildFormStyle(array &$form, array &$form_state, $type) {
+  protected function buildFormStyle(array &$form, &$form_state, $type) {
     parent::buildFormStyle($form, $form_state, $type);
     $style_form =& $form['displays'][$type]['options']['style'];
     // Some style plugins don't support row plugins so stop here if that's the
@@ -101,7 +101,7 @@ protected function buildFormStyle(array &$form, array &$form_state, $type) {
   /**
    * {@inheritdoc}
    */
-  protected function pageDisplayOptions(array $form, array &$form_state) {
+  protected function pageDisplayOptions(array $form, &$form_state) {
     $display_options = parent::pageDisplayOptions($form, $form_state);
     $row_plugin = isset($form_state['values']['page']['style']['row_plugin']) ? $form_state['values']['page']['style']['row_plugin'] : NULL;
     $row_options = isset($form_state['values']['page']['style']['row_options']) ? $form_state['values']['page']['style']['row_options'] : array();
@@ -112,7 +112,7 @@ protected function pageDisplayOptions(array $form, array &$form_state) {
   /**
    * Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::blockDisplayOptions().
    */
-  protected function blockDisplayOptions(array $form, array &$form_state) {
+  protected function blockDisplayOptions(array $form, &$form_state) {
     $display_options = parent::blockDisplayOptions($form, $form_state);
     $row_plugin = isset($form_state['values']['block']['style']['row_plugin']) ? $form_state['values']['block']['style']['row_plugin'] : NULL;
     $row_options = isset($form_state['values']['block']['style']['row_options']) ? $form_state['values']['block']['style']['row_options'] : array();
diff --git a/core/modules/config/src/Form/ConfigExportForm.php b/core/modules/config/src/Form/ConfigExportForm.php
index c351818..e76a56c 100644
--- a/core/modules/config/src/Form/ConfigExportForm.php
+++ b/core/modules/config/src/Form/ConfigExportForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\config\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Defines the configuration export form.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['description'] = array(
       '#markup' => '<p>' . $this->t('Use the export button below to download your site configuration.') . '</p>',
     );
@@ -38,7 +39,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['redirect_route']['route_name'] = 'config.export_download';
   }
 
diff --git a/core/modules/config/src/Form/ConfigImportForm.php b/core/modules/config/src/Form/ConfigImportForm.php
index 97d039e..00315e1 100644
--- a/core/modules/config/src/Form/ConfigImportForm.php
+++ b/core/modules/config/src/Form/ConfigImportForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Archiver\ArchiveTar;
 use Drupal\Core\Config\StorageInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -53,7 +54,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['description'] = array(
       '#markup' => '<p>' . $this->t('Use the upload button below.') . '</p>',
     );
@@ -73,7 +74,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $file_upload = $this->getRequest()->files->get('files[import_tarball]', NULL, TRUE);
     if ($file_upload && $file_upload->isValid()) {
       $form_state['values']['import_tarball'] = $file_upload->getRealPath();
@@ -86,7 +87,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     if ($path = $form_state['values']['import_tarball']) {
       $this->configStorage->deleteAll();
       try {
diff --git a/core/modules/config/src/Form/ConfigSingleExportForm.php b/core/modules/config/src/Form/ConfigSingleExportForm.php
index 14255b5..10fdd73 100644
--- a/core/modules/config/src/Form/ConfigSingleExportForm.php
+++ b/core/modules/config/src/Form/ConfigSingleExportForm.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -73,7 +74,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $config_type = NULL, $config_name = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $config_type = NULL, $config_name = NULL) {
     foreach ($this->entityManager->getDefinitions() as $entity_type => $definition) {
       if ($definition->isSubclassOf('Drupal\Core\Config\Entity\ConfigEntityInterface')) {
         $this->definitions[$entity_type] = $definition;
@@ -197,7 +198,7 @@ protected function findConfiguration($config_type) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Nothing to submit.
   }
 
diff --git a/core/modules/config/src/Form/ConfigSingleImportForm.php b/core/modules/config/src/Form/ConfigSingleImportForm.php
index 35b6ee6..4de92c9 100644
--- a/core/modules/config/src/Form/ConfigSingleImportForm.php
+++ b/core/modules/config/src/Form/ConfigSingleImportForm.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Config\StorageInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -114,7 +115,7 @@ public function getQuestion() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // When this is the confirmation step fall through to the confirmation form.
     if ($this->data) {
       return parent::buildForm($form, $form_state);
@@ -177,7 +178,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     // The confirmation step needs no additional validation.
     if ($this->data) {
       return;
@@ -232,7 +233,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // If this form has not yet been confirmed, store the values and rebuild.
     if (!$this->data) {
       $form_state['rebuild'] = TRUE;
diff --git a/core/modules/config/src/Form/ConfigSync.php b/core/modules/config/src/Form/ConfigSync.php
index 7c48dd5..a93c0ff 100644
--- a/core/modules/config/src/Form/ConfigSync.php
+++ b/core/modules/config/src/Form/ConfigSync.php
@@ -17,6 +17,7 @@
 use Drupal\Core\Config\ConfigManagerInterface;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Config\StorageInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Lock\LockBackendInterface;
 use Drupal\Core\Config\StorageComparer;
 use Drupal\Core\Routing\UrlGeneratorInterface;
@@ -152,7 +153,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['actions'] = array('#type' => 'actions');
     $form['actions']['submit'] = array(
       '#type' => 'submit',
@@ -270,7 +271,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $config_importer = new ConfigImporter(
       $form_state['storage_comparer'],
       $this->eventDispatcher,
diff --git a/core/modules/config/tests/config_test/src/ConfigTestForm.php b/core/modules/config/tests/config_test/src/ConfigTestForm.php
index 8a680b2..cbe4c6f 100644
--- a/core/modules/config/tests/config_test/src/ConfigTestForm.php
+++ b/core/modules/config/tests/config_test/src/ConfigTestForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\config_test;
 
 use Drupal\Core\Entity\EntityForm;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form controller for the test config edit forms.
@@ -15,9 +16,9 @@
 class ConfigTestForm extends EntityForm {
 
   /**
-   * Overrides Drupal\Core\Entity\EntityForm::form().
+   * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form = parent::form($form, $form_state);
 
     $entity = $this->entity;
@@ -67,9 +68,9 @@ public function form(array $form, array &$form_state) {
   }
 
   /**
-   * Overrides Drupal\Core\Entity\EntityForm::save().
+   * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $entity = $this->entity;
     $status = $entity->save();
 
diff --git a/core/modules/config/tests/config_test/src/Form/ConfigTestDeleteForm.php b/core/modules/config/tests/config_test/src/Form/ConfigTestDeleteForm.php
index ebdfede..8c5258f 100644
--- a/core/modules/config/tests/config_test/src/Form/ConfigTestDeleteForm.php
+++ b/core/modules/config/tests/config_test/src/Form/ConfigTestDeleteForm.php
@@ -8,6 +8,7 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -39,7 +40,7 @@ public function getCancelRoute() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     drupal_set_message(String::format('%label configuration has been deleted.', array('%label' => $this->entity->label())));
     $form_state['redirect_route'] = $this->getCancelRoute();
diff --git a/core/modules/config_translation/src/Form/ConfigTranslationAddForm.php b/core/modules/config_translation/src/Form/ConfigTranslationAddForm.php
index 9556be2..1930c3b 100644
--- a/core/modules/config_translation/src/Form/ConfigTranslationAddForm.php
+++ b/core/modules/config_translation/src/Form/ConfigTranslationAddForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\config_translation\Form;
 
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, Request $request = NULL, $plugin_id = NULL, $langcode = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, Request $request = NULL, $plugin_id = NULL, $langcode = NULL) {
     $form = parent::buildForm($form, $form_state, $request, $plugin_id, $langcode);
     $form['#title'] = $this->t('Add @language translation for %label', array(
       '%label' => $this->mapper->getTitle(),
@@ -36,7 +37,7 @@ public function buildForm(array $form, array &$form_state, Request $request = NU
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     parent::submitForm($form, $form_state);
     drupal_set_message($this->t('Successfully saved @language translation.', array('@language' => $this->language->name)));
   }
diff --git a/core/modules/config_translation/src/Form/ConfigTranslationDeleteForm.php b/core/modules/config_translation/src/Form/ConfigTranslationDeleteForm.php
index a9a0a83..beac37f 100644
--- a/core/modules/config_translation/src/Form/ConfigTranslationDeleteForm.php
+++ b/core/modules/config_translation/src/Form/ConfigTranslationDeleteForm.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Drupal\language\ConfigurableLanguageManagerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -115,7 +116,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, Request $request = NULL, $plugin_id = NULL, $langcode = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, Request $request = NULL, $plugin_id = NULL, $langcode = NULL) {
     /** @var \Drupal\config_translation\ConfigMapperInterface $mapper */
     $mapper = $this->configMapperManager->createInstance($plugin_id);
     $mapper->populateFromRequest($request);
@@ -133,7 +134,7 @@ public function buildForm(array $form, array &$form_state, Request $request = NU
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     foreach ($this->mapper->getConfigNames() as $name) {
       $this->languageManager->getLanguageConfigOverride($this->language->id, $name)->delete();
     }
diff --git a/core/modules/config_translation/src/Form/ConfigTranslationEditForm.php b/core/modules/config_translation/src/Form/ConfigTranslationEditForm.php
index 565d07a..91e4797 100644
--- a/core/modules/config_translation/src/Form/ConfigTranslationEditForm.php
+++ b/core/modules/config_translation/src/Form/ConfigTranslationEditForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\config_translation\Form;
 
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, Request $request = NULL, $plugin_id = NULL, $langcode = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, Request $request = NULL, $plugin_id = NULL, $langcode = NULL) {
     $form = parent::buildForm($form, $form_state, $request, $plugin_id, $langcode);
     $form['#title'] = $this->t('Edit @language translation for %label', array(
       '%label' => $this->mapper->getTitle(),
@@ -36,7 +37,7 @@ public function buildForm(array $form, array &$form_state, Request $request = NU
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     parent::submitForm($form, $form_state);
     drupal_set_message($this->t('Successfully updated @language translation.', array('@language' => $this->language->name)));
   }
diff --git a/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php b/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php
index 5b6125a..29ed2c9 100644
--- a/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php
+++ b/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php
@@ -14,6 +14,7 @@
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\BaseFormIdInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\language\Config\LanguageConfigOverride;
 use Drupal\language\ConfigurableLanguageManagerInterface;
@@ -138,8 +139,8 @@ public function getBaseFormID() {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    * @param \Symfony\Component\HttpFoundation\Request $request
    *   (optional) Page request object.
    * @param string $plugin_id
@@ -155,7 +156,7 @@ public function getBaseFormID() {
    *   Throws an exception if the language code provided as a query parameter in
    *   the request does not match an active language.
    */
-  public function buildForm(array $form, array &$form_state, Request $request = NULL, $plugin_id = NULL, $langcode = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, Request $request = NULL, $plugin_id = NULL, $langcode = NULL) {
     /** @var \Drupal\config_translation\ConfigMapperInterface $mapper */
     $mapper = $this->configMapperManager->createInstance($plugin_id);
     $mapper->populateFromRequest($request);
@@ -214,7 +215,7 @@ public function buildForm(array $form, array &$form_state, Request $request = NU
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_values = $form_state['values']['config_names'];
 
     // For the form submission handling, use the raw data.
diff --git a/core/modules/config_translation/src/FormElement/DateFormat.php b/core/modules/config_translation/src/FormElement/DateFormat.php
index 2e089cb..0640fa5 100644
--- a/core/modules/config_translation/src/FormElement/DateFormat.php
+++ b/core/modules/config_translation/src/FormElement/DateFormat.php
@@ -46,7 +46,7 @@ public function getFormElement(DataDefinitionInterface $definition, LanguageInte
    *
    * @param array $form
    *   Form API array structure.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   Form state information.
    *
    * @return AjaxResponse
@@ -54,7 +54,7 @@ public function getFormElement(DataDefinitionInterface $definition, LanguageInte
    *   the given format cannot be identified or was empty, the response will
    *   be empty as well.
    */
-  public static function ajaxSample(array $form, array $form_state) {
+  public static function ajaxSample(array $form, $form_state) {
     $response = new AjaxResponse();
 
     $format_value = NestedArray::getValue($form_state['values'], $form_state['triggering_element']['#array_parents']);
diff --git a/core/modules/contact/src/CategoryForm.php b/core/modules/contact/src/CategoryForm.php
index fd315a6..df91084 100644
--- a/core/modules/contact/src/CategoryForm.php
+++ b/core/modules/contact/src/CategoryForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Base form for category edit forms.
@@ -18,7 +19,7 @@ class CategoryForm extends EntityForm {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form = parent::form($form, $form_state);
 
     $category = $this->entity;
@@ -72,7 +73,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     parent::validate($form, $form_state);
 
     // Validate and each email recipient.
@@ -90,7 +91,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $category = $this->entity;
     $status = $category->save();
     $contact_settings = $this->config('contact.settings');
diff --git a/core/modules/contact/src/Form/CategoryDeleteForm.php b/core/modules/contact/src/Form/CategoryDeleteForm.php
index ab66b16..7b3e8a0 100644
--- a/core/modules/contact/src/Form/CategoryDeleteForm.php
+++ b/core/modules/contact/src/Form/CategoryDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\contact\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -39,7 +40,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     drupal_set_message($this->t('Category %label has been deleted.', array('%label' => $this->entity->label())));
     watchdog('contact', 'Category %label has been deleted.', array('%label' => $this->entity->label()), WATCHDOG_NOTICE);
diff --git a/core/modules/contact/src/MessageForm.php b/core/modules/contact/src/MessageForm.php
index d289f38..e021143 100644
--- a/core/modules/contact/src/MessageForm.php
+++ b/core/modules/contact/src/MessageForm.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Entity\ContentEntityForm;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Flood\FloodInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Language\LanguageManagerInterface;
@@ -72,7 +73,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $user = $this->currentUser();
     $message = $this->entity;
     $form = parent::form($form, $form_state, $message);
@@ -150,7 +151,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function actions(array $form, array &$form_state) {
+  public function actions(array $form, FormStateInterface $form_state) {
     $elements = parent::actions($form, $form_state);
     $elements['submit']['#value'] = $this->t('Send message');
     $elements['preview'] = array(
@@ -169,7 +170,7 @@ public function actions(array $form, array &$form_state) {
   /**
    * Form submission handler for the 'preview' action.
    */
-  public function preview(array $form, array &$form_state) {
+  public function preview(array $form, &$form_state) {
     $message = $this->entity;
     $message->preview = TRUE;
     $form_state['rebuild'] = TRUE;
@@ -178,7 +179,7 @@ public function preview(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $user = $this->currentUser();
 
     $language_interface = $this->languageManager->getCurrentLanguage();
@@ -271,7 +272,7 @@ public function save(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function init(array &$form_state) {
+  protected function init(FormStateInterface $form_state) {
     $message = $this->entity;
 
     // Make the message inherit the current content language unless specifically
diff --git a/core/modules/content_translation/content_translation.admin.inc b/core/modules/content_translation/content_translation.admin.inc
index 7e7e790..a405fb7 100644
--- a/core/modules/content_translation/content_translation.admin.inc
+++ b/core/modules/content_translation/content_translation.admin.inc
@@ -60,7 +60,7 @@ function content_translation_field_sync_widget(FieldDefinitionInterface $field)
 /**
  * (proxied) Implements hook_form_FORM_ID_alter().
  */
-function _content_translation_form_language_content_settings_form_alter(array &$form, array &$form_state) {
+function _content_translation_form_language_content_settings_form_alter(array &$form, &$form_state) {
   // Inject into the content language settings the translation settings if the
   // user has the required permission.
   if (!\Drupal::currentUser()->hasPermission('administer content translation')) {
@@ -254,7 +254,7 @@ function _content_translation_preprocess_language_content_settings_table(&$varia
  *
  * @see content_translation_admin_settings_form_submit()
  */
-function content_translation_form_language_content_settings_validate(array $form, array &$form_state) {
+function content_translation_form_language_content_settings_validate(array $form, &$form_state) {
   $settings = &$form_state['values']['settings'];
   foreach ($settings as $entity_type => $entity_settings) {
     foreach ($entity_settings as $bundle => $bundle_settings) {
@@ -284,7 +284,7 @@ function content_translation_form_language_content_settings_validate(array $form
  *
  * @see content_translation_admin_settings_form_validate()
  */
-function content_translation_form_language_content_settings_submit(array $form, array &$form_state) {
+function content_translation_form_language_content_settings_submit(array $form, &$form_state) {
   $entity_types = $form_state['values']['entity_types'];
   $settings = &$form_state['values']['settings'];
 
diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module
index 858ffba..9820d93 100644
--- a/core/modules/content_translation/content_translation.module
+++ b/core/modules/content_translation/content_translation.module
@@ -366,7 +366,7 @@ function content_translation_controller($entity_type_id) {
 /**
  * Returns the entity form for the given form.
  *
- * @param array $form_state
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The form state array holding the entity form.
  *
  * @return \Drupal\Core\Entity\EntityFormInterface;
@@ -375,7 +375,7 @@ function content_translation_controller($entity_type_id) {
  *
  * @todo Move to \Drupal\content_translation\ContentTranslationManager.
  */
-function content_translation_form_controller(array $form_state) {
+function content_translation_form_controller($form_state) {
   return isset($form_state['controller']) && $form_state['controller'] instanceof EntityFormInterface ? $form_state['controller'] : FALSE;
 }
 
@@ -458,7 +458,7 @@ function content_translation_permission() {
 /**
  * Implements hook_form_alter().
  */
-function content_translation_form_alter(array &$form, array &$form_state) {
+function content_translation_form_alter(array &$form, &$form_state) {
   $form_controller = content_translation_form_controller($form_state);
   $entity = $form_controller ? $form_controller->getEntity() : NULL;
 
@@ -644,7 +644,7 @@ function content_translation_entity_extra_field_info() {
 /**
  * Implements hook_form_FORM_ID_alter() for 'field_ui_instance_edit_form'.
  */
-function content_translation_form_field_ui_field_instance_edit_form_alter(array &$form, array &$form_state) {
+function content_translation_form_field_ui_field_instance_edit_form_alter(array &$form, &$form_state) {
   $instance = $form_state['instance'];
   $bundle_is_translatable = content_translation_enabled($instance->entity_type, $instance->bundle);
 
@@ -722,10 +722,10 @@ function content_translation_element_info_alter(&$type) {
  *   The bundle of the entity being configured for translation.
  * @param array $form
  *   The configuration form array.
- * @param array $form_state
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The configuration form state array.
  */
-function content_translation_enable_widget($entity_type, $bundle, array &$form, array &$form_state) {
+function content_translation_enable_widget($entity_type, $bundle, array &$form, &$form_state) {
   $key = $form_state['content_translation']['key'];
   if (!isset($form_state['language'][$key])) {
     $form_state['language'][$key] = array();
@@ -745,7 +745,7 @@ function content_translation_enable_widget($entity_type, $bundle, array &$form,
  * @return
  *   Processed language configuration element.
  */
-function content_translation_language_configuration_element_process(array $element, array &$form_state, array &$form) {
+function content_translation_language_configuration_element_process(array $element, &$form_state, array &$form) {
   if (empty($element['#content_translation_skip_alter']) && \Drupal::currentUser()->hasPermission('administer content translation')) {
     $form_state['content_translation']['key'] = $element['#name'];
     $context = $form_state['language'][$element['#name']];
@@ -772,7 +772,7 @@ function content_translation_language_configuration_element_process(array $eleme
  *
  * @see content_translation_language_configuration_element_submit()
  */
-function content_translation_language_configuration_element_validate($element, array &$form_state, array $form) {
+function content_translation_language_configuration_element_validate($element, &$form_state, array $form) {
   $key = $form_state['content_translation']['key'];
   $values = $form_state['values'][$key];
   if (!$values['language_show'] && $values['content_translation'] && \Drupal::languageManager()->isLanguageLocked($values['langcode'])) {
@@ -793,7 +793,7 @@ function content_translation_language_configuration_element_validate($element, a
  *
  * @see content_translation_language_configuration_element_validate()
  */
-function content_translation_language_configuration_element_submit(array $form, array &$form_state) {
+function content_translation_language_configuration_element_submit(array $form, &$form_state) {
   $key = $form_state['content_translation']['key'];
   $context = $form_state['language'][$key];
   $enabled = $form_state['values'][$key]['content_translation'];
@@ -808,7 +808,7 @@ function content_translation_language_configuration_element_submit(array $form,
 /**
  * Implements hook_form_FORM_ID_alter() for language_content_settings_form().
  */
-function content_translation_form_language_content_settings_form_alter(array &$form, array &$form_state) {
+function content_translation_form_language_content_settings_form_alter(array &$form, &$form_state) {
   module_load_include('inc', 'content_translation', 'content_translation.admin');
   _content_translation_form_language_content_settings_form_alter($form, $form_state);
 }
diff --git a/core/modules/content_translation/src/ContentTranslationHandler.php b/core/modules/content_translation/src/ContentTranslationHandler.php
index 7510d2e..ca96104 100644
--- a/core/modules/content_translation/src/ContentTranslationHandler.php
+++ b/core/modules/content_translation/src/ContentTranslationHandler.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Render\Element;
 
@@ -75,14 +76,14 @@ public function getTranslationAccess(EntityInterface $entity, $op) {
   /**
    * {@inheritdoc}
    */
-  public function getSourceLangcode(array $form_state) {
+  public function getSourceLangcode($form_state) {
     return isset($form_state['content_translation']['source']) ? $form_state['content_translation']['source']->id : FALSE;
   }
 
   /**
    * {@inheritdoc}
    */
-  public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) {
+  public function entityFormAlter(array &$form, FormStateInterface $form_state, EntityInterface $entity) {
     $form_controller = content_translation_form_controller($form_state);
     $form_langcode = $form_controller->getFormLangcode($form_state);
     $entity_langcode = $entity->getUntranslated()->language()->id;
@@ -371,7 +372,7 @@ protected function addTranslatabilityClue(&$element) {
    *
    * @see \Drupal\content_translation\ContentTranslationHandler::entityFormAlter()
    */
-  public function entityFormEntityBuild($entity_type, EntityInterface $entity, array $form, array &$form_state) {
+  public function entityFormEntityBuild($entity_type, EntityInterface $entity, array $form, &$form_state) {
     $form_controller = content_translation_form_controller($form_state);
     $form_langcode = $form_controller->getFormLangcode($form_state);
 
diff --git a/core/modules/content_translation/src/ContentTranslationHandlerInterface.php b/core/modules/content_translation/src/ContentTranslationHandlerInterface.php
index c41fd27..86c5cd2 100644
--- a/core/modules/content_translation/src/ContentTranslationHandlerInterface.php
+++ b/core/modules/content_translation/src/ContentTranslationHandlerInterface.php
@@ -8,6 +8,7 @@
 namespace Drupal\content_translation;
 
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Interface for providing content translation.
@@ -37,13 +38,13 @@ public function getTranslationAccess(EntityInterface $entity, $op);
   /**
    * Retrieves the source language for the translation being created.
    *
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state array.
    *
    * @return string
    *   The source language code.
    */
-  public function getSourceLangcode(array $form_state);
+  public function getSourceLangcode($form_state);
 
   /**
    * Marks translations as outdated.
@@ -61,11 +62,11 @@ public function retranslate(EntityInterface $entity, $langcode = NULL);
    *
    * @param array $form
    *   The entity form to be altered to provide the translation workflow.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state array.
    * @param \Drupal\Core\Entity\EntityInterface $entity
    *   The entity being created or edited.
    */
-  public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity);
+  public function entityFormAlter(array &$form, FormStateInterface $form_state, EntityInterface $entity);
 
 }
diff --git a/core/modules/content_translation/src/Form/ContentTranslationDeleteForm.php b/core/modules/content_translation/src/Form/ContentTranslationDeleteForm.php
index 4100fdb..99bec46 100644
--- a/core/modules/content_translation/src/Form/ContentTranslationDeleteForm.php
+++ b/core/modules/content_translation/src/Form/ContentTranslationDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\content_translation\Form;
 
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -39,7 +40,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $_entity_type_id = NULL, $language = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $_entity_type_id = NULL, $language = NULL) {
     $this->entity = $this->getRequest()->attributes->get($_entity_type_id);
     $this->language = language_load($language);
     return parent::buildForm($form, $form_state);
@@ -69,7 +70,7 @@ public function getCancelRoute() {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Remove the translated values.
     $this->entity->removeTranslation($this->language->id);
     $this->entity->save();
diff --git a/core/modules/datetime/datetime.module b/core/modules/datetime/datetime.module
index b5f98dd..27c364b 100644
--- a/core/modules/datetime/datetime.module
+++ b/core/modules/datetime/datetime.module
@@ -119,7 +119,7 @@ function datetime_theme() {
  *
  * @param array $element
  *   The form element whose value is being validated.
- * @param array $form_state
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The current state of the form.
  */
 function datetime_datetime_widget_validate(&$element, &$form_state) {
@@ -157,7 +157,7 @@ function datetime_datetime_widget_validate(&$element, &$form_state) {
  *
  * @param array $element
  *   The form element whose value is being validated.
- * @param array $form_state
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The current state of the form.
  */
 function datetime_datelist_widget_validate(&$element, &$form_state) {
@@ -352,7 +352,7 @@ function template_preprocess_datetime_wrapper(&$variables) {
  *
  * @param array $element
  *   The form element whose value is being processed.
- * @param array $form_state
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The current state of the form.
  *
  * @return array
@@ -527,7 +527,7 @@ function form_type_datetime_value($element, $input = FALSE) {
  *
  * @param array $element
  *   The form element whose value is being validated.
- * @param array $form_state
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The current state of the form.
  */
 function datetime_datetime_validate($element, &$form_state) {
@@ -675,7 +675,7 @@ function datetime_format_example($format) {
  *
  * @param array $element
  *   The form element whose value is being processed.
- * @param array $form_state
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The current state of the form.
  */
 function datetime_datelist_form_process($element, &$form_state) {
@@ -789,7 +789,7 @@ function datetime_datelist_form_process($element, &$form_state) {
  *   The element being processed.
  * @param array|false $input
  *
- * @param array $form_state
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   (optional) The current state of the form.  Defaults to an empty array.
  *
  * @return array
@@ -871,7 +871,7 @@ function form_type_datelist_value($element, $input = FALSE, &$form_state = array
  *
  * @param array $element
  *   The element being processed.
- * @param array $form_state
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The current state of the form.
  */
 function datetime_datelist_validate($element, &$form_state) {
@@ -1013,7 +1013,7 @@ function datetime_form_node_form_alter(&$form, &$form_state, $form_id) {
 /**
  * Implements hook_node_prepare_form().
  */
-function datetime_node_prepare_form(NodeInterface $node, $operation, array &$form_state) {
+function datetime_node_prepare_form(NodeInterface $node, $operation, &$form_state) {
   // Prepare the 'Authored on' date to use datetime.
   $node->date = DrupalDateTime::createFromTimestamp($node->getCreatedTime());
 }
diff --git a/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php b/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php
index 239f454..c4bf7de 100644
--- a/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php
+++ b/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Field\FormatterBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -162,7 +163,7 @@ function dateFormat($date) {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $time = new DrupalDateTime();
     $format_types = $this->dateStorage->loadMultiple();
     foreach ($format_types as $type => $type_info) {
diff --git a/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeFieldItemList.php b/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeFieldItemList.php
index 75a59ec..4ed473b 100644
--- a/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeFieldItemList.php
+++ b/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeFieldItemList.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemList;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Represents a configurable entity datetime field.
@@ -25,7 +26,7 @@ class DateTimeFieldItemList extends FieldItemList {
   /**
    * {@inheritdoc}
    */
-  public function defaultValuesForm(array &$form, array &$form_state) {
+  public function defaultValuesForm(array &$form, FormStateInterface $form_state) {
     if (empty($this->getFieldDefinition()->default_value_function)) {
       $default_value = $this->getFieldDefinition()->default_value;
 
@@ -48,12 +49,12 @@ public function defaultValuesForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function defaultValuesFormValidate(array $element, array &$form, array &$form_state) { }
+  public function defaultValuesFormValidate(array $element, array &$form, FormStateInterface $form_state) { }
 
   /**
    * {@inheritdoc}
    */
-  public function defaultValuesFormSubmit(array $element, array &$form, array &$form_state) {
+  public function defaultValuesFormSubmit(array $element, array &$form, FormStateInterface $form_state) {
     if ($form_state['values']['default_value_input']['default_date']) {
       return array($form_state['values']['default_value_input']);
     }
diff --git a/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php b/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php
index 615ca1e..992af1e 100644
--- a/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php
+++ b/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php
@@ -8,6 +8,7 @@
 namespace Drupal\datetime\Plugin\Field\FieldType;
 
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\TypedData\DataDefinition;
 use Drupal\Core\Field\FieldItemBase;
 
@@ -83,7 +84,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array &$form, array &$form_state, $has_data) {
+  public function settingsForm(array &$form, FormStateInterface $form_state, $has_data) {
     $element = array();
 
     $element['datetime_type'] = array(
diff --git a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php
index c9c3195..6d05a06 100644
--- a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php
+++ b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php
@@ -8,6 +8,7 @@
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
 
 /**
@@ -37,7 +38,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $date_order = $this->getSetting('date_order');
     $time_type = $this->getSetting('time_type');
     $increment = $this->getSetting('increment');
@@ -122,7 +123,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
   /**
    * {@inheritdoc}
    */
-  function settingsForm(array $form, array &$form_state) {
+  function settingsForm(array $form, FormStateInterface $form_state) {
     $element = parent::settingsForm($form, $form_state);
 
     $element['date_order'] = array(
diff --git a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php
index 00426c0..a411eb4 100644
--- a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php
+++ b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
 use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -60,7 +61,7 @@ public static function create(ContainerInterface $container, array $configuratio
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     // We are nesting some sub-elements inside the parent, so we need a wrapper.
     // We also need to add another #title attribute at the top level for ease in
     // identifying this item in error messages. We do not want to display this
diff --git a/core/modules/dblog/src/Form/DblogClearLogConfirmForm.php b/core/modules/dblog/src/Form/DblogClearLogConfirmForm.php
index 3c668a8..e100156 100644
--- a/core/modules/dblog/src/Form/DblogClearLogConfirmForm.php
+++ b/core/modules/dblog/src/Form/DblogClearLogConfirmForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\dblog\Form;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Form\ConfirmFormBase;
@@ -67,7 +68,7 @@ public function getCancelRoute() {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $_SESSION['dblog_overview_filter'] = array();
     $this->connection->delete('watchdog')->execute();
     drupal_set_message($this->t('Database log cleared.'));
diff --git a/core/modules/dblog/src/Form/DblogClearLogForm.php b/core/modules/dblog/src/Form/DblogClearLogForm.php
index 133ab43..f3781d4 100644
--- a/core/modules/dblog/src/Form/DblogClearLogForm.php
+++ b/core/modules/dblog/src/Form/DblogClearLogForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -53,7 +54,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['dblog_clear'] = array(
       '#type' => 'details',
       '#title' => $this->t('Clear log messages'),
@@ -69,7 +70,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['redirect_route'] = new Url('dblog.confirm');
   }
 
diff --git a/core/modules/dblog/src/Form/DblogFilterForm.php b/core/modules/dblog/src/Form/DblogFilterForm.php
index 2422472..4e963f5 100644
--- a/core/modules/dblog/src/Form/DblogFilterForm.php
+++ b/core/modules/dblog/src/Form/DblogFilterForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\dblog\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides the database logging filter form.
@@ -24,7 +25,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $filters = dblog_filters();
 
     $form['filters'] = array(
@@ -67,7 +68,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     if (empty($form_state['values']['type']) && empty($form_state['values']['severity'])) {
       $this->setFormError('type', $form_state, $this->t('You must select something to filter by.'));
     }
@@ -76,7 +77,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $filters = dblog_filters();
     foreach ($filters as $name => $filter) {
       if (isset($form_state['values'][$name])) {
@@ -88,7 +89,7 @@ public function submitForm(array &$form, array &$form_state) {
   /**
    * Resets the filter form.
    */
-  public function resetForm(array &$form, array &$form_state) {
+  public function resetForm(array &$form, &$form_state) {
     $_SESSION['dblog_overview_filter'] = array();
   }
 
diff --git a/core/modules/editor/src/Form/EditorImageDialog.php b/core/modules/editor/src/Form/EditorImageDialog.php
index 23a4e20..b75fc40 100644
--- a/core/modules/editor/src/Form/EditorImageDialog.php
+++ b/core/modules/editor/src/Form/EditorImageDialog.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\Bytes;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\filter\Entity\FilterFormat;
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\HtmlCommand;
@@ -33,7 +34,7 @@ public function getFormId() {
    * @param \Drupal\filter\Entity\FilterFormat $filter_format
    *   The filter format for which this dialog corresponds.
    */
-  public function buildForm(array $form, array &$form_state, FilterFormat $filter_format = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, FilterFormat $filter_format = NULL) {
     // The default values are set directly from \Drupal::request()->request,
     // provided by the editor plugin opening the dialog.
     if (!isset($form_state['image_element'])) {
@@ -183,7 +184,7 @@ public function buildForm(array $form, array &$form_state, FilterFormat $filter_
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $response = new AjaxResponse();
 
     // Convert any uploaded files from the FID values to data-editor-file-uuid
diff --git a/core/modules/editor/src/Form/EditorLinkDialog.php b/core/modules/editor/src/Form/EditorLinkDialog.php
index b0beb5b..8f31c3c 100644
--- a/core/modules/editor/src/Form/EditorLinkDialog.php
+++ b/core/modules/editor/src/Form/EditorLinkDialog.php
@@ -8,6 +8,7 @@
 namespace Drupal\editor\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\filter\Entity\FilterFormat;
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\HtmlCommand;
@@ -32,7 +33,7 @@ public function getFormId() {
    * @param \Drupal\filter\Entity\FilterFormat $filter_format
    *   The filter format for which this dialog corresponds.
    */
-  public function buildForm(array $form, array &$form_state, FilterFormat $filter_format = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, FilterFormat $filter_format = NULL) {
     // The default values are set directly from \Drupal::request()->request,
     // provided by the editor plugin opening the dialog.
     $input = isset($form_state['input']['editor_object']) ? $form_state['input']['editor_object'] : array();
@@ -78,7 +79,7 @@ public function buildForm(array $form, array &$form_state, FilterFormat $filter_
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $response = new AjaxResponse();
 
     if (form_get_errors($form_state)) {
diff --git a/core/modules/editor/src/Plugin/EditorBase.php b/core/modules/editor/src/Plugin/EditorBase.php
index 32e4408..4cb1fe2 100644
--- a/core/modules/editor/src/Plugin/EditorBase.php
+++ b/core/modules/editor/src/Plugin/EditorBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\editor\Plugin;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\PluginBase;
 use Drupal\editor\Entity\Editor;
 use Drupal\editor\Plugin\EditorPluginInterface;
@@ -54,20 +55,20 @@ public function getDefaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state, Editor $editor) {
+  public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor) {
     return $form;
   }
 
   /**
    * {@inheritdoc}
    */
-  public function settingsFormValidate(array $form, array &$form_state) {
+  public function settingsFormValidate(array $form, FormStateInterface $form_state) {
   }
 
   /**
    * {@inheritdoc}
    */
-  public function settingsFormSubmit(array $form, array &$form_state) {
+  public function settingsFormSubmit(array $form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/editor/src/Plugin/EditorPluginInterface.php b/core/modules/editor/src/Plugin/EditorPluginInterface.php
index c6b6c54..b73326b 100644
--- a/core/modules/editor/src/Plugin/EditorPluginInterface.php
+++ b/core/modules/editor/src/Plugin/EditorPluginInterface.php
@@ -8,6 +8,7 @@
 namespace Drupal\editor\Plugin;
 
 use Drupal\Component\Plugin\PluginInspectionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\editor\Entity\Editor;
 
 /**
@@ -37,7 +38,7 @@ public function getDefaultSettings();
    *
    * @param array $form
    *   An empty form array to be populated with a configuration form, if any.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The state of the entire filter administration form.
    * @param \Drupal\editor\Entity\Editor $editor
    *   A configured text editor object.
@@ -45,7 +46,7 @@ public function getDefaultSettings();
    * @return array
    *   A render array for the settings form.
    */
-  public function settingsForm(array $form, array &$form_state, Editor $editor);
+  public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor);
 
   /**
    * Validates the settings form for an editor.
@@ -56,10 +57,10 @@ public function settingsForm(array $form, array &$form_state, Editor $editor);
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A reference to a keyed array containing the current state of the form.
    */
-  public function settingsFormValidate(array $form, array &$form_state);
+  public function settingsFormValidate(array $form, FormStateInterface $form_state);
 
   /**
    * Modifies any values in the form state to prepare them for saving.
@@ -69,10 +70,10 @@ public function settingsFormValidate(array $form, array &$form_state);
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A reference to a keyed array containing the current state of the form.
    */
-  public function settingsFormSubmit(array $form, array &$form_state);
+  public function settingsFormSubmit(array $form, FormStateInterface $form_state);
 
   /**
    * Returns JavaScript settings to be attached.
diff --git a/core/modules/editor/tests/modules/src/Plugin/Editor/UnicornEditor.php b/core/modules/editor/tests/modules/src/Plugin/Editor/UnicornEditor.php
index 5015759..6937fb2 100644
--- a/core/modules/editor/tests/modules/src/Plugin/Editor/UnicornEditor.php
+++ b/core/modules/editor/tests/modules/src/Plugin/Editor/UnicornEditor.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\editor_test\Plugin\Editor;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\editor\Plugin\EditorBase;
 use Drupal\editor\Entity\Editor as EditorEntity;
 
@@ -33,7 +34,7 @@ function getDefaultSettings() {
   /**
    * {@inheritdoc}
    */
-  function settingsForm(array $form, array &$form_state, EditorEntity $editor) {
+  function settingsForm(array $form, FormStateInterface $form_state, EditorEntity $editor) {
     $form['foo'] = array(
       '#title' => t('Foo'),
       '#type' => 'textfield',
diff --git a/core/modules/entity/src/Entity/EntityFormDisplay.php b/core/modules/entity/src/Entity/EntityFormDisplay.php
index 8365032..6457e23 100644
--- a/core/modules/entity/src/Entity/EntityFormDisplay.php
+++ b/core/modules/entity/src/Entity/EntityFormDisplay.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\Core\Entity\Display\EntityFormDisplayInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\entity\EntityDisplayBase;
 
 /**
@@ -148,7 +149,7 @@ public function getRenderer($field_name) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(ContentEntityInterface $entity, array &$form, array &$form_state) {
+  public function buildForm(ContentEntityInterface $entity, array &$form, FormStateInterface $form_state) {
     // Set #parents to 'top-level' by default.
     $form += array('#parents' => array());
 
@@ -197,7 +198,7 @@ public function processForm($element, $form_state, $form) {
   /**
    * {@inheritdoc}
    */
-  public function extractFormValues(ContentEntityInterface $entity, array &$form, array &$form_state) {
+  public function extractFormValues(ContentEntityInterface $entity, array &$form, FormStateInterface $form_state) {
     $extracted = array();
     foreach ($entity as $name => $items) {
       if ($widget = $this->getRenderer($name)) {
@@ -211,7 +212,7 @@ public function extractFormValues(ContentEntityInterface $entity, array &$form,
   /**
    * {@inheritdoc}
    */
-  public function validateFormValues(ContentEntityInterface $entity, array &$form, array &$form_state) {
+  public function validateFormValues(ContentEntityInterface $entity, array &$form, FormStateInterface $form_state) {
     foreach ($entity as $field_name => $items) {
       // Only validate the fields that actually appear in the form, and let the
       // widget assign the violations to the right form elements.
diff --git a/core/modules/entity/src/Form/EntityDisplayModeAddForm.php b/core/modules/entity/src/Form/EntityDisplayModeAddForm.php
index 49be44f..296fde2 100644
--- a/core/modules/entity/src/Form/EntityDisplayModeAddForm.php
+++ b/core/modules/entity/src/Form/EntityDisplayModeAddForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\entity\Form;
 
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 
 /**
@@ -24,7 +25,7 @@ class EntityDisplayModeAddForm extends EntityDisplayModeFormBase {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $entity_type_id = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL) {
     $this->targetEntityTypeId = $entity_type_id;
     $form = parent::buildForm($form, $form_state);
     // Change replace_pattern to avoid undesired dots.
@@ -37,7 +38,7 @@ public function buildForm(array $form, array &$form_state, $entity_type_id = NUL
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     parent::validate($form, $form_state);
 
     form_set_value($form['id'], $this->targetEntityTypeId . '.' . $form_state['values']['id'], $form_state);
diff --git a/core/modules/entity/src/Form/EntityDisplayModeDeleteForm.php b/core/modules/entity/src/Form/EntityDisplayModeDeleteForm.php
index 4af74a7..03717dd 100644
--- a/core/modules/entity/src/Form/EntityDisplayModeDeleteForm.php
+++ b/core/modules/entity/src/Form/EntityDisplayModeDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\entity\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -48,7 +49,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     parent::submit($form, $form_state);
 
     $entity_type = $this->entity->getEntityType();
diff --git a/core/modules/entity/src/Form/EntityDisplayModeFormBase.php b/core/modules/entity/src/Form/EntityDisplayModeFormBase.php
index e848413..5000a26 100644
--- a/core/modules/entity/src/Form/EntityDisplayModeFormBase.php
+++ b/core/modules/entity/src/Form/EntityDisplayModeFormBase.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\Query\QueryFactory;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -64,7 +65,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  protected function init(array &$form_state) {
+  protected function init(FormStateInterface $form_state) {
     parent::init($form_state);
     $this->entityType = $this->entityManager->getDefinition($this->entity->getEntityTypeId());
   }
@@ -72,7 +73,7 @@ protected function init(array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form['label'] = array(
       '#type' => 'textfield',
       '#title' => t('Label'),
@@ -102,13 +103,13 @@ public function form(array $form, array &$form_state) {
    *   The entity ID.
    * @param array $element
    *   The form element.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state.
    *
    * @return bool
    *   TRUE if the display mode exists, FALSE otherwise.
    */
-  public function exists($entity_id, array $element, array $form_state) {
+  public function exists($entity_id, array $element, $form_state) {
     // Do not allow to add internal 'default' view mode.
     if ($entity_id == 'default') {
       return TRUE;
@@ -122,7 +123,7 @@ public function exists($entity_id, array $element, array $form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     drupal_set_message(t('Saved the %label @entity-type.', array('%label' => $this->entity->label(), '@entity-type' => $this->entityType->getLowercaseLabel())));
     $this->entity->save();
     \Drupal::entityManager()->clearCachedFieldDefinitions();
diff --git a/core/modules/entity_reference/src/ConfigurableEntityReferenceItem.php b/core/modules/entity_reference/src/ConfigurableEntityReferenceItem.php
index cabf660..654ece8 100644
--- a/core/modules/entity_reference/src/ConfigurableEntityReferenceItem.php
+++ b/core/modules/entity_reference/src/ConfigurableEntityReferenceItem.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Form\OptGroup;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\TypedData\AllowedValuesInterface;
@@ -159,7 +160,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array &$form, array &$form_state, $has_data) {
+  public function settingsForm(array &$form, FormStateInterface $form_state, $has_data) {
     $element['target_type'] = array(
       '#type' => 'select',
       '#title' => t('Type of item to reference'),
@@ -176,7 +177,7 @@ public function settingsForm(array &$form, array &$form_state, $has_data) {
   /**
    * {@inheritdoc}
    */
-  public function instanceSettingsForm(array $form, array &$form_state) {
+  public function instanceSettingsForm(array $form, FormStateInterface $form_state) {
     $instance = $form_state['instance'];
 
     // Get all selection plugins for this entity type.
@@ -247,10 +248,10 @@ public function instanceSettingsForm(array $form, array &$form_state) {
    *
    * @param array $form
    *   The form where the settings form is being included in.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state of the (entire) configuration form.
    */
-  public static function instanceSettingsFormValidate(array $form, array &$form_state) {
+  public static function instanceSettingsFormValidate(array $form, &$form_state) {
     if (isset($form_state['values']['instance'])) {
       unset($form_state['values']['instance']['settings']['handler_submit']);
       $form_state['instance']->settings = $form_state['values']['instance']['settings'];
diff --git a/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
index 15f1df1..448343e 100644
--- a/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
+++ b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
@@ -8,6 +8,7 @@
 namespace Drupal\entity_reference\Plugin\Field\FieldFormatter;
 
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\entity_reference\RecursiveRenderingException;
 
 /**
@@ -37,7 +38,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $elements['view_mode'] = array(
       '#type' => 'select',
       '#options' => \Drupal::entityManager()->getViewModeOptions($this->getFieldSetting('target_type')),
diff --git a/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
index 54a1ae7..154759f 100644
--- a/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
+++ b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'entity reference label' formatter.
@@ -36,7 +37,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $elements['link'] = array(
       '#title' => t('Link label to the referenced entity'),
       '#type' => 'checkbox',
diff --git a/core/modules/entity_reference/src/Plugin/Field/FieldType/ConfigurableEntityReferenceFieldItemList.php b/core/modules/entity_reference/src/Plugin/Field/FieldType/ConfigurableEntityReferenceFieldItemList.php
index 3d4bec3..25d8546 100644
--- a/core/modules/entity_reference/src/Plugin/Field/FieldType/ConfigurableEntityReferenceFieldItemList.php
+++ b/core/modules/entity_reference/src/Plugin/Field/FieldType/ConfigurableEntityReferenceFieldItemList.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Field\EntityReferenceFieldItemList;
 use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Represents a configurable entity_reference entity field.
@@ -73,7 +74,7 @@ public static function processDefaultValue($default_value, ContentEntityInterfac
   /**
    * {@inheritdoc}
    */
-  public function defaultValuesFormSubmit(array $element, array &$form, array &$form_state) {
+  public function defaultValuesFormSubmit(array $element, array &$form, FormStateInterface $form_state) {
     $default_value = parent::defaultValuesFormSubmit($element, $form, $form_state);
 
     // Convert numeric IDs to UUIDs to ensure config deployability.
diff --git a/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteWidgetBase.php b/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteWidgetBase.php
index 2ed1dfe..584f8a0 100644
--- a/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteWidgetBase.php
+++ b/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteWidgetBase.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\Tags;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\user\EntityOwnerInterface;
 use Symfony\Component\Validator\ConstraintViolationInterface;
 
@@ -21,7 +22,7 @@
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['match_operator'] = array(
       '#type' => 'radios',
       '#title' => t('Autocomplete matching'),
@@ -70,7 +71,7 @@ public function settingsSummary() {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $entity = $items->getEntity();
 
     // Prepare the autocomplete route parameters.
@@ -103,7 +104,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
   /**
    * {@inheritdoc}
    */
-  public function errorElement(array $element, ConstraintViolationInterface $error, array $form, array &$form_state) {
+  public function errorElement(array $element, ConstraintViolationInterface $error, array $form, FormStateInterface $form_state) {
     return $element['target_id'];
   }
 
diff --git a/core/modules/entity_reference/src/Plugin/Type/Selection/SelectionBroken.php b/core/modules/entity_reference/src/Plugin/Type/Selection/SelectionBroken.php
index eab272e..37a5264 100644
--- a/core/modules/entity_reference/src/Plugin/Type/Selection/SelectionBroken.php
+++ b/core/modules/entity_reference/src/Plugin/Type/Selection/SelectionBroken.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Database\Query\SelectInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * A null implementation of SelectionInterface.
@@ -49,7 +50,7 @@ public function validateReferenceableEntities(array $ids) {
   /**
    * {@inheritdoc}
    */
-  public function validateAutocompleteInput($input, &$element, &$form_state, $form, $strict = TRUE) { }
+  public function validateAutocompleteInput($input, &$element, FormStateInterface $form_state, $form, $strict = TRUE) { }
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/entity_reference/src/Plugin/Type/Selection/SelectionInterface.php b/core/modules/entity_reference/src/Plugin/Type/Selection/SelectionInterface.php
index 28fc2c5..eb3b8ae 100644
--- a/core/modules/entity_reference/src/Plugin/Type/Selection/SelectionInterface.php
+++ b/core/modules/entity_reference/src/Plugin/Type/Selection/SelectionInterface.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Database\Query\SelectInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Interface definition for Entity Reference Selection plugins.
@@ -54,6 +55,10 @@ public function validateReferenceableEntities(array $ids);
    *   Single string from autocomplete widget.
    * @param array $element
    *   The form element to set a form error.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current form state.
+   * @param array $form
+   *   The form.
    * @param boolean $strict
    *   Whether to trigger a form error if an element from $input (eg. an entity)
    *   is not found. Defaults to TRUE.
@@ -63,7 +68,7 @@ public function validateReferenceableEntities(array $ids);
    *
    * @see \Drupal\entity_reference\Plugin\Field\FieldWidget::elementValidate()
    */
-  public function validateAutocompleteInput($input, &$element, &$form_state, $form, $strict = TRUE);
+  public function validateAutocompleteInput($input, &$element, FormStateInterface $form_state, $form, $strict = TRUE);
 
   /**
    * Allows the selection to alter the SelectQuery generated by EntityFieldQuery.
diff --git a/core/modules/entity_reference/src/Plugin/entity_reference/selection/SelectionBase.php b/core/modules/entity_reference/src/Plugin/entity_reference/selection/SelectionBase.php
index 11ee6cd..fbb6537 100644
--- a/core/modules/entity_reference/src/Plugin/entity_reference/selection/SelectionBase.php
+++ b/core/modules/entity_reference/src/Plugin/entity_reference/selection/SelectionBase.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Database\Query\SelectInterface;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\entity_reference\Plugin\Type\Selection\SelectionInterface;
 
 /**
@@ -229,7 +230,7 @@ public function validateReferenceableEntities(array $ids) {
   /**
    * {@inheritdoc}
    */
-  public function validateAutocompleteInput($input, &$element, &$form_state, $form, $strict = TRUE) {
+  public function validateAutocompleteInput($input, &$element, FormStateInterface $form_state, $form, $strict = TRUE) {
     $bundled_entities = $this->getReferenceableEntities($input, '=', 6);
     $entities = array();
     foreach ($bundled_entities as $entities_list) {
diff --git a/core/modules/field/field.api.php b/core/modules/field/field.api.php
index fed48ca..225081d 100644
--- a/core/modules/field/field.api.php
+++ b/core/modules/field/field.api.php
@@ -105,7 +105,7 @@ function hook_field_widget_info_alter(array &$info) {
  * @param $element
  *   The field widget form element as constructed by hook_field_widget_form().
  * @param $form_state
- *   An associative array containing the current state of the form.
+ *   The current state of the form.
  * @param $context
  *   An associative array containing the following key-value pairs:
  *   - form: The form structure to which widgets are being attached. This may be
@@ -139,7 +139,7 @@ function hook_field_widget_form_alter(&$element, &$form_state, $context) {
  * @param $element
  *   The field widget form element as constructed by hook_field_widget_form().
  * @param $form_state
- *   An associative array containing the current state of the form.
+ *   The current state of the form.
  * @param $context
  *   An associative array. See hook_field_widget_form_alter() for the structure
  *   and content of the array.
diff --git a/core/modules/field/src/Tests/FieldAttachOtherTest.php b/core/modules/field/src/Tests/FieldAttachOtherTest.php
index 379d108..8e2d853 100644
--- a/core/modules/field/src/Tests/FieldAttachOtherTest.php
+++ b/core/modules/field/src/Tests/FieldAttachOtherTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\Core\Form\FormState;
 use Drupal\Core\Language\LanguageInterface;
 
 /**
@@ -263,7 +264,8 @@ function testEntityFormDisplayBuildForm() {
     // Test generating widgets for all fields.
     $display = entity_get_form_display($entity_type, $this->instance->bundle, 'default');
     $form = array();
-    $form_state = \Drupal::formBuilder()->getFormStateDefaults();
+    $form_state = new FormState();
+    $form_state->addFormStateDefaults();
     $display->buildForm($entity, $form, $form_state);
 
     $this->assertEqual($form[$this->field_name]['widget']['#title'], $this->instance->getLabel(), "First field's form title is {$this->instance->getLabel()}");
@@ -285,7 +287,8 @@ function testEntityFormDisplayBuildForm() {
       }
     }
     $form = array();
-    $form_state = \Drupal::formBuilder()->getFormStateDefaults();
+    $form_state = new FormState();
+    $form_state->addFormStateDefaults();
     $display->buildForm($entity, $form, $form_state);
 
     $this->assertFalse(isset($form[$this->field_name]), 'The first field does not exist in the form');
@@ -308,7 +311,8 @@ function testEntityFormDisplayExtractFormValues() {
     // Build the form for all fields.
     $display = entity_get_form_display($entity_type, $this->instance->bundle, 'default');
     $form = array();
-    $form_state = \Drupal::formBuilder()->getFormStateDefaults();
+    $form_state = new FormState();
+    $form_state->addFormStateDefaults();
     $display->buildForm($entity_init, $form, $form_state);
 
     // Simulate incoming values.
diff --git a/core/modules/field/src/Tests/FormTest.php b/core/modules/field/src/Tests/FormTest.php
index 2830abe..e79f11e 100644
--- a/core/modules/field/src/Tests/FormTest.php
+++ b/core/modules/field/src/Tests/FormTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Form\FormState;
 
 /**
  * Tests field form handling.
@@ -531,7 +532,8 @@ function testFieldFormAccess() {
 
     $display = entity_get_form_display($entity_type, $entity_type, 'default');
     $form = array();
-    $form_state = \Drupal::formBuilder()->getFormStateDefaults();
+    $form_state = new FormState();
+    $form_state->addFormStateDefaults();
     $display->buildForm($entity, $form, $form_state);
 
     $this->assertFalse($form[$field_name_no_access]['#access'], 'Field #access is FALSE for the field without edit access.');
diff --git a/core/modules/field/tests/modules/field_test/src/Form/NestedEntityTestForm.php b/core/modules/field/tests/modules/field_test/src/Form/NestedEntityTestForm.php
index 89aa42c..ea5a30e 100644
--- a/core/modules/field/tests/modules/field_test/src/Form/NestedEntityTestForm.php
+++ b/core/modules/field/tests/modules/field_test/src/Form/NestedEntityTestForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\entity\Entity\EntityFormDisplay;
 
 /**
@@ -26,7 +27,7 @@ public function getFormId() {
   /**
    * {@inheritdoc]
    */
-  public function buildForm(array $form, array &$form_state, EntityInterface $entity_1 = NULL, EntityInterface $entity_2 = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, EntityInterface $entity_1 = NULL, EntityInterface $entity_2 = NULL) {
     // First entity.
     $form_state['entity_1'] = $entity_1;
     $form_state['form_display_1'] = EntityFormDisplay::collectRenderDisplay($entity_1, 'default');
@@ -57,7 +58,7 @@ public function buildForm(array $form, array &$form_state, EntityInterface $enti
   /**
    * {@inheritdoc]
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $entity_1 = $form_state['entity_1'];
     /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display_1 */
     $form_display_1 = $form_state['form_display_1'];
@@ -74,7 +75,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc]
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     /** @var \Drupal\Core\Entity\EntityInterface $entity_1 */
     $entity_1 = $form_state['entity_1'];
     $entity_1->save();
diff --git a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldDefaultFormatter.php b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldDefaultFormatter.php
index 3e61ca1..d195a31 100644
--- a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldDefaultFormatter.php
+++ b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldDefaultFormatter.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FormatterBase;
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'field_test_default' formatter.
@@ -37,7 +38,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['test_formatter_setting'] = array(
       '#title' => t('Setting'),
       '#type' => 'textfield',
diff --git a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldEmptySettingFormatter.php b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldEmptySettingFormatter.php
index 7cd25fb..84938ec 100644
--- a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldEmptySettingFormatter.php
+++ b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldEmptySettingFormatter.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FormatterBase;
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'field_empty_setting' formatter.
@@ -36,7 +37,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['field_empty_setting'] = array(
       '#title' => t('Setting'),
       '#type' => 'textfield',
diff --git a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldMultipleFormatter.php b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldMultipleFormatter.php
index 1aeb570..a310ad3 100644
--- a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldMultipleFormatter.php
+++ b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldMultipleFormatter.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FormatterBase;
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'field_test_multiple' formatter.
@@ -37,7 +38,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['test_formatter_setting_multiple'] = array(
       '#title' => t('Setting'),
       '#type' => 'textfield',
diff --git a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldPrepareViewFormatter.php b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldPrepareViewFormatter.php
index beb17e9..211c1cd 100644
--- a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldPrepareViewFormatter.php
+++ b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldPrepareViewFormatter.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FormatterBase;
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'field_test_with_prepare_view' formatter.
@@ -37,7 +38,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['test_formatter_setting_additional'] = array(
       '#title' => t('Setting'),
       '#type' => 'textfield',
diff --git a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php
index e21b180..96b3b3f 100644
--- a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php
+++ b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php
@@ -8,6 +8,7 @@
 namespace Drupal\field_test\Plugin\Field\FieldType;
 
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\TypedData\DataDefinition;
 use Drupal\Core\Field\FieldItemBase;
 
@@ -76,7 +77,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array &$form, array &$form_state, $has_data) {
+  public function settingsForm(array &$form, FormStateInterface $form_state, $has_data) {
     $form['test_field_setting'] = array(
       '#type' => 'textfield',
       '#title' => t('Field test field setting'),
@@ -91,7 +92,7 @@ public function settingsForm(array &$form, array &$form_state, $has_data) {
   /**
    * {@inheritdoc}
    */
-  public function instanceSettingsForm(array $form, array &$form_state) {
+  public function instanceSettingsForm(array $form, FormStateInterface $form_state) {
     $form['test_instance_setting'] = array(
       '#type' => 'textfield',
       '#title' => t('Field test field instance setting'),
diff --git a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidget.php b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidget.php
index 1fcc8bc..71b8afa 100644
--- a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidget.php
+++ b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidget.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\Validator\ConstraintViolationInterface;
 
 /**
@@ -38,7 +39,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['test_widget_setting'] = array(
       '#type' => 'textfield',
       '#title' => t('Field test field widget setting'),
@@ -61,7 +62,7 @@ public function settingsSummary() {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $element += array(
       '#type' => 'textfield',
       '#default_value' => isset($items[$delta]->value) ? $items[$delta]->value : '',
@@ -72,7 +73,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
   /**
    * {@inheritdoc}
    */
-  public function errorElement(array $element, ConstraintViolationInterface $error, array $form, array &$form_state) {
+  public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state) {
     return $element['value'];
   }
 
diff --git a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidgetMultiple.php b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidgetMultiple.php
index ac4609c..2a555d1 100644
--- a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidgetMultiple.php
+++ b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidgetMultiple.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\Validator\ConstraintViolationInterface;
 
 /**
@@ -40,7 +41,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['test_widget_setting_multiple'] = array(
       '#type' => 'textfield',
       '#title' => t('Field test field widget setting'),
@@ -63,7 +64,7 @@ public function settingsSummary() {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $values = array();
     foreach ($items as $item) {
       $values[] = $item->value;
@@ -79,7 +80,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
   /**
    * {@inheritdoc}
    */
-  public function errorElement(array $element, ConstraintViolationInterface $error, array $form, array &$form_state) {
+  public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state) {
     return $element;
   }
 
diff --git a/core/modules/field_ui/field_ui.api.php b/core/modules/field_ui/field_ui.api.php
index 070f020..b67d89b 100644
--- a/core/modules/field_ui/field_ui.api.php
+++ b/core/modules/field_ui/field_ui.api.php
@@ -21,7 +21,7 @@
  *   The entity view mode.
  * @param array $form
  *   The (entire) configuration form array.
- * @param array $form_state
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The form state.
  *
  * @return array
@@ -54,7 +54,7 @@ function hook_field_formatter_third_party_settings_form(\Drupal\Core\Field\Forma
  *   The entity form mode.
  * @param array $form
  *   The (entire) configuration form array.
- * @param array $form_state
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The form state.
  *
  * @return array
diff --git a/core/modules/field_ui/src/DisplayOverview.php b/core/modules/field_ui/src/DisplayOverview.php
index 3c55ec0..6d5a677 100644
--- a/core/modules/field_ui/src/DisplayOverview.php
+++ b/core/modules/field_ui/src/DisplayOverview.php
@@ -16,6 +16,7 @@
 use Drupal\Core\Field\FieldTypePluginManager;
 use Drupal\Core\Field\FormatterInterface;
 use Drupal\Core\Field\PluginSettingsInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -77,7 +78,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $entity_type_id = NULL, $bundle = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL, $bundle = NULL) {
     if ($this->getRequest()->attributes->has('view_mode_name')) {
       $this->mode = $this->getRequest()->attributes->get('view_mode_name');
     }
@@ -88,7 +89,7 @@ public function buildForm(array $form, array &$form_state, $entity_type_id = NUL
   /**
    * {@inheritdoc}
    */
-  protected function buildFieldRow(FieldDefinitionInterface $field_definition, EntityDisplayInterface $entity_display, array $form, array &$form_state) {
+  protected function buildFieldRow(FieldDefinitionInterface $field_definition, EntityDisplayInterface $entity_display, array $form, FormStateInterface $form_state) {
     $field_row = parent::buildFieldRow($field_definition, $entity_display, $form, $form_state);
 
     $field_name = $field_definition->getName();
@@ -233,7 +234,7 @@ protected function getFieldLabelOptions() {
   /**
    * {@inheritdoc}
    */
-  protected function thirdPartySettingsForm(PluginSettingsInterface $plugin, FieldDefinitionInterface $field_definition, array $form, array &$form_state) {
+  protected function thirdPartySettingsForm(PluginSettingsInterface $plugin, FieldDefinitionInterface $field_definition, array $form, FormStateInterface $form_state) {
     $settings_form = array();
     // Invoke hook_field_formatter_third_party_settings_form(), keying resulting
     // subforms by module name.
diff --git a/core/modules/field_ui/src/DisplayOverviewBase.php b/core/modules/field_ui/src/DisplayOverviewBase.php
index 8a98e93..a6ed907 100644
--- a/core/modules/field_ui/src/DisplayOverviewBase.php
+++ b/core/modules/field_ui/src/DisplayOverviewBase.php
@@ -15,6 +15,7 @@
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldTypePluginManagerInterface;
 use Drupal\Core\Field\PluginSettingsInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -115,7 +116,7 @@ protected function getFieldDefinitions() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $entity_type_id = NULL, $bundle = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL, $bundle = NULL) {
     parent::buildForm($form, $form_state, $entity_type_id, $bundle);
 
     if (empty($this->mode)) {
@@ -126,10 +127,6 @@ public function buildForm(array $form, array &$form_state, $entity_type_id = NUL
     $extra_fields = $this->getExtraFields();
     $entity_display = $this->getEntityDisplay($this->mode);
 
-    $form_state += array(
-      'plugin_settings_edit' => NULL,
-    );
-
     $form += array(
       '#entity_type' => $this->entity_type,
       '#bundle' => $this->bundle,
@@ -256,13 +253,13 @@ public function buildForm(array $form, array &$form_state, $entity_type_id = NUL
    *   The entity display.
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A reference to a keyed array containing the current state of the form.
    *
    * @return array
    *   A table row array.
    */
-  protected function buildFieldRow(FieldDefinitionInterface $field_definition, EntityDisplayInterface $entity_display, array $form, array &$form_state) {
+  protected function buildFieldRow(FieldDefinitionInterface $field_definition, EntityDisplayInterface $entity_display, array $form, FormStateInterface $form_state) {
     $field_name = $field_definition->getName();
     $display_options = $entity_display->getComponent($field_name);
     $label = $field_definition->getLabel();
@@ -502,7 +499,7 @@ protected function buildExtraFieldRow($field_id, $extra_field, EntityDisplayInte
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_values = $form_state['values'];
     $display = $this->getEntityDisplay($this->mode);
 
@@ -608,7 +605,7 @@ public function submitForm(array &$form, array &$form_state) {
   /**
    * Form submission handler for multistep buttons.
    */
-  public function multistepSubmit($form, &$form_state) {
+  public function multistepSubmit($form, FormStateInterface $form_state) {
     $trigger = $form_state['triggering_element'];
     $op = $trigger['#op'];
 
@@ -652,7 +649,7 @@ public function multistepSubmit($form, &$form_state) {
   /**
    * Ajax handler for multistep buttons.
    */
-  public function multistepAjax($form, &$form_state) {
+  public function multistepAjax($form, FormStateInterface $form_state) {
     $trigger = $form_state['triggering_element'];
     $op = $trigger['#op'];
 
@@ -880,13 +877,13 @@ protected function saveDisplayStatuses($display_statuses) {
    *   The field definition.
    * @param array $form
    *   The (entire) configuration form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state.
    *
    * @return array
    *   The widget or formatter third party settings form.
    */
-  abstract protected function thirdPartySettingsForm(PluginSettingsInterface $plugin, FieldDefinitionInterface $field_definition, array $form, array &$form_state);
+  abstract protected function thirdPartySettingsForm(PluginSettingsInterface $plugin, FieldDefinitionInterface $field_definition, array $form, FormStateInterface $form_state);
 
   /**
    * Alters the widget or formatter settings summary.
diff --git a/core/modules/field_ui/src/FieldOverview.php b/core/modules/field_ui/src/FieldOverview.php
index 300b317..98567e5 100644
--- a/core/modules/field_ui/src/FieldOverview.php
+++ b/core/modules/field_ui/src/FieldOverview.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Field\FieldTypePluginManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\field_ui\OverviewBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -77,7 +78,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $entity_type_id = NULL, $bundle = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL, $bundle = NULL) {
     parent::buildForm($form, $form_state, $entity_type_id, $bundle);
 
     // Gather bundle information.
@@ -281,7 +282,7 @@ public function buildForm(array $form, array &$form_state, $entity_type_id = NUL
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $this->validateAddNew($form, $form_state);
     $this->validateAddExisting($form, $form_state);
   }
@@ -291,12 +292,12 @@ public function validateForm(array &$form, array &$form_state) {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A reference to a keyed array containing the current state of the form.
    *
    * @see \Drupal\field_ui\FieldOverview::validateForm()
    */
-  protected function validateAddNew(array $form, array &$form_state) {
+  protected function validateAddNew(array $form, &$form_state) {
     $field = $form_state['values']['fields']['_add_new_field'];
 
     // Validate if any information was provided in the 'add new field' row.
@@ -331,12 +332,12 @@ protected function validateAddNew(array $form, array &$form_state) {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A reference to a keyed array containing the current state of the form.
    *
    * @see \Drupal\field_ui\FieldOverview::validate()
    */
-  protected function validateAddExisting(array $form, array &$form_state) {
+  protected function validateAddExisting(array $form, &$form_state) {
     // The form element might be absent if no existing fields can be added to
     // this bundle.
     if (isset($form_state['values']['fields']['_add_existing_field'])) {
@@ -361,7 +362,7 @@ protected function validateAddExisting(array $form, array &$form_state) {
   /**
    * Overrides \Drupal\field_ui\OverviewBase::submitForm().
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $error = FALSE;
     $form_values = $form_state['values']['fields'];
     $destinations = array();
diff --git a/core/modules/field_ui/src/Form/FieldEditForm.php b/core/modules/field_ui/src/Form/FieldEditForm.php
index 9d79cf4..e586bd3 100644
--- a/core/modules/field_ui/src/Form/FieldEditForm.php
+++ b/core/modules/field_ui/src/Form/FieldEditForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\TypedData\TypedDataManager;
 use Drupal\field\FieldInstanceConfigInterface;
 use Drupal\field_ui\FieldUI;
@@ -74,7 +75,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, FieldInstanceConfigInterface $field_instance_config = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, FieldInstanceConfigInterface $field_instance_config = NULL) {
     $this->instance = $form_state['instance'] = $field_instance_config;
     $form['#title'] = $this->instance->label();
 
@@ -159,7 +160,7 @@ public function buildForm(array $form, array &$form_state, FieldInstanceConfigIn
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     // Validate field cardinality.
     $cardinality = $form_state['values']['field']['cardinality'];
     $cardinality_number = $form_state['values']['field']['cardinality_number'];
@@ -171,7 +172,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_values = $form_state['values'];
     $field_values = $form_values['field'];
 
diff --git a/core/modules/field_ui/src/Form/FieldInstanceConfigDeleteForm.php b/core/modules/field_ui/src/Form/FieldInstanceConfigDeleteForm.php
index 3dd54c0..e6ad7b2 100644
--- a/core/modules/field_ui/src/Form/FieldInstanceConfigDeleteForm.php
+++ b/core/modules/field_ui/src/Form/FieldInstanceConfigDeleteForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\field_ui\FieldUI;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -67,7 +68,7 @@ public function getCancelRoute() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $field = $this->entity->getFieldStorageDefinition();
     $bundles = entity_get_bundles();
     $bundle_label = $bundles[$this->entity->entity_type][$this->entity->bundle]['label'];
diff --git a/core/modules/field_ui/src/Form/FieldInstanceEditForm.php b/core/modules/field_ui/src/Form/FieldInstanceEditForm.php
index 7ac1aff..b1b3988 100644
--- a/core/modules/field_ui/src/Form/FieldInstanceEditForm.php
+++ b/core/modules/field_ui/src/Form/FieldInstanceEditForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Form\FormBase;
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\field\FieldInstanceConfigInterface;
 use Drupal\field_ui\FieldUI;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -62,7 +63,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, FieldInstanceConfigInterface $field_instance_config = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, FieldInstanceConfigInterface $field_instance_config = NULL) {
     $this->instance = $form_state['instance'] = $field_instance_config;
 
     $bundle = $this->instance->bundle;
@@ -164,7 +165,7 @@ public function buildForm(array $form, array &$form_state, FieldInstanceConfigIn
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     if (isset($form['instance']['default_value'])) {
       $items = $form['#entity']->get($this->instance->getName());
       $items->defaultValuesFormValidate($form['instance']['default_value'], $form, $form_state);
@@ -174,7 +175,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Handle the default value.
     $default_value = array();
     if (isset($form['instance']['default_value'])) {
@@ -209,7 +210,7 @@ public function submitForm(array &$form, array &$form_state) {
   /**
    * Redirects to the field instance deletion form.
    */
-  public function delete(array &$form, array &$form_state) {
+  public function delete(array &$form, &$form_state) {
     $destination = array();
     $request = $this->getRequest();
     if ($request->query->has('destination')) {
diff --git a/core/modules/field_ui/src/FormDisplayOverview.php b/core/modules/field_ui/src/FormDisplayOverview.php
index 3a2546b..4857a53 100644
--- a/core/modules/field_ui/src/FormDisplayOverview.php
+++ b/core/modules/field_ui/src/FormDisplayOverview.php
@@ -15,6 +15,7 @@
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldTypePluginManager;
 use Drupal\Core\Field\PluginSettingsInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -76,7 +77,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $entity_type_id = NULL, $bundle = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL, $bundle = NULL) {
     if ($this->getRequest()->attributes->has('form_mode_name')) {
       $this->mode = $this->getRequest()->attributes->get('form_mode_name');
     }
@@ -87,7 +88,7 @@ public function buildForm(array $form, array &$form_state, $entity_type_id = NUL
   /**
    * {@inheritdoc}
    */
-  protected function buildFieldRow(FieldDefinitionInterface $field_definition, EntityDisplayInterface $entity_display, array $form, array &$form_state) {
+  protected function buildFieldRow(FieldDefinitionInterface $field_definition, EntityDisplayInterface $entity_display, array $form, FormStateInterface $form_state) {
     $field_row = parent::buildFieldRow($field_definition, $entity_display, $form, $form_state);
 
     $field_name = $field_definition->getName();
@@ -183,7 +184,7 @@ protected function getOverviewRoute($mode) {
   /**
    * {@inheritdoc}
    */
-  protected function thirdPartySettingsForm(PluginSettingsInterface $plugin, FieldDefinitionInterface $field_definition, array $form, array &$form_state) {
+  protected function thirdPartySettingsForm(PluginSettingsInterface $plugin, FieldDefinitionInterface $field_definition, array $form, FormStateInterface $form_state) {
     $settings_form = array();
     // Invoke hook_field_widget_third_party_settings_form(), keying resulting
     // subforms by module name.
diff --git a/core/modules/field_ui/src/OverviewBase.php b/core/modules/field_ui/src/OverviewBase.php
index 17104e0..7132eda 100644
--- a/core/modules/field_ui/src/OverviewBase.php
+++ b/core/modules/field_ui/src/OverviewBase.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -74,7 +75,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $entity_type_id = NULL, $bundle = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL, $bundle = NULL) {
     $entity_type = $this->entityManager->getDefinition($entity_type_id);
     $this->bundleEntityType = $entity_type->getBundleEntityType();
     if (!isset($form_state['bundle'])) {
@@ -89,9 +90,9 @@ public function buildForm(array $form, array &$form_state, $entity_type_id = NUL
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::submitForm().
+   * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
   /**
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index 97fa6ff..1ff3180 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -741,8 +741,8 @@ function file_cron() {
  * @param $form_field_name
  *   A string that is the associative array key of the upload form element in
  *   the form array.
- * @param array $form_state
- *   An associative array containing the current state of the form.
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
+ *   The current state of the form.
  * @param $validators
  *   An optional, associative array of callback functions used to validate the
  *   file. See file_validate() for a full discussion of the array format.
@@ -1483,14 +1483,14 @@ function file_managed_file_submit($form, &$form_state) {
  *
  * @param $element
  *   The FAPI element whose values are being saved.
- * @param array $form_state
- *   An associative array containing the current state of the form.
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
+ *   The current state of the form.
  *
  * @return
  *   An array of file entities for each file that was saved, keyed by its file
  *   ID, or FALSE if no files were saved.
  */
-function file_managed_file_save_upload($element, array &$form_state) {
+function file_managed_file_save_upload($element, &$form_state) {
   $upload_name = implode('_', $element['#parents']);
   $file_upload = \Drupal::request()->files->get("files[$upload_name]", NULL, TRUE);
   if (empty($file_upload)) {
diff --git a/core/modules/file/src/Plugin/Field/FieldType/FileFieldItemList.php b/core/modules/file/src/Plugin/Field/FieldType/FileFieldItemList.php
index 43dbefa..f8ee03c 100644
--- a/core/modules/file/src/Plugin/Field/FieldType/FileFieldItemList.php
+++ b/core/modules/file/src/Plugin/Field/FieldType/FileFieldItemList.php
@@ -8,6 +8,7 @@
 namespace Drupal\file\Plugin\Field\FieldType;
 
 use Drupal\Core\Field\EntityReferenceFieldItemList;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Represents a configurable entity file field.
@@ -17,7 +18,7 @@ class FileFieldItemList extends EntityReferenceFieldItemList {
   /**
    * {@inheritdoc}
    */
-  public function defaultValuesForm(array &$form, array &$form_state) { }
+  public function defaultValuesForm(array &$form, FormStateInterface $form_state) { }
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/file/src/Plugin/Field/FieldType/FileItem.php b/core/modules/file/src/Plugin/Field/FieldType/FileItem.php
index a56448a..2b3fcfd 100644
--- a/core/modules/file/src/Plugin/Field/FieldType/FileItem.php
+++ b/core/modules/file/src/Plugin/Field/FieldType/FileItem.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\Bytes;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\TypedData\DataDefinition;
 
 /**
@@ -106,7 +107,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array &$form, array &$form_state, $has_data) {
+  public function settingsForm(array &$form, FormStateInterface $form_state, $has_data) {
     $element = array();
 
     $element['#attached']['library'][] = 'file/drupal.file';
@@ -148,7 +149,7 @@ public function settingsForm(array &$form, array &$form_state, $has_data) {
   /**
    * {@inheritdoc}
    */
-  public function instanceSettingsForm(array $form, array &$form_state) {
+  public function instanceSettingsForm(array $form, FormStateInterface $form_state) {
     $element = array();
     $settings = $this->getSettings();
 
diff --git a/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php b/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php
index 8f7fb02..654309d 100644
--- a/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php
+++ b/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 
 /**
@@ -39,7 +40,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['progress_indicator'] = array(
       '#type' => 'radios',
       '#title' => t('Progress indicator'),
@@ -69,7 +70,7 @@ public function settingsSummary() {
    *
    * Special handling for draggable multiple widgets and 'add more' button.
    */
-  protected function formMultipleElements(FieldItemListInterface $items, array &$form, array &$form_state) {
+  protected function formMultipleElements(FieldItemListInterface $items, array &$form, FormStateInterface $form_state) {
     $field_name = $this->fieldDefinition->getName();
     $parents = $form['#parents'];
 
@@ -186,7 +187,7 @@ protected function formMultipleElements(FieldItemListInterface $items, array &$f
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $field_settings = $this->getFieldSettings();
 
     // The field settings include defaults for the field type. However, this
@@ -256,7 +257,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
   /**
    * {@inheritdoc}
    */
-  public function massageFormValues(array $values, array $form, array &$form_state) {
+  public function massageFormValues(array $values, array $form, FormStateInterface $form_state) {
     // Since file upload widget now supports uploads of more than one file at a
     // time it always returns an array of fids. We have to translate this to a
     // single fid, as field expects single value.
diff --git a/core/modules/file/tests/file_module_test/src/Form/FileModuleTestForm.php b/core/modules/file/tests/file_module_test/src/Form/FileModuleTestForm.php
index 84b2760..19264cc 100644
--- a/core/modules/file/tests/file_module_test/src/Form/FileModuleTestForm.php
+++ b/core/modules/file/tests/file_module_test/src/Form/FileModuleTestForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\file_module_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form controller for file_module_test module.
@@ -26,8 +27,8 @@ public function getFormId() {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    * @param bool $tree
    *   (optional) If the form should use #tree. Defaults to TRUE.
    * @param bool $extended
@@ -37,7 +38,7 @@ public function getFormId() {
    * @param array $default_fids
    *   (optional) Any default file IDs to use.
    */
-  public function buildForm(array $form, array &$form_state, $tree = TRUE, $extended = TRUE, $multiple = FALSE, $default_fids = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $tree = TRUE, $extended = TRUE, $multiple = FALSE, $default_fids = NULL) {
     $form['#tree'] = (bool) $tree;
 
     $form['nested']['file'] = array(
@@ -70,7 +71,7 @@ public function buildForm(array $form, array &$form_state, $tree = TRUE, $extend
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     if ($form['#tree']) {
       $uploads = $form_state['values']['nested']['file'];
     }
diff --git a/core/modules/file/tests/file_test/src/Form/FileTestForm.php b/core/modules/file/tests/file_test/src/Form/FileTestForm.php
index f2d6dc2..68ebf61 100644
--- a/core/modules/file/tests/file_test/src/Form/FileTestForm.php
+++ b/core/modules/file/tests/file_test/src/Form/FileTestForm.php
@@ -7,6 +7,7 @@
 namespace Drupal\file_test\Form;
 
 use Drupal\Core\Form\FormInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * File test form class.
@@ -23,7 +24,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['file_test_upload'] = array(
       '#type' => 'file',
       '#title' => t('Upload a file'),
@@ -72,12 +73,12 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {}
+  public function validateForm(array &$form, FormStateInterface $form_state) {}
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Process the upload and perform validation. Note: we're using the
     // form value for the $replace parameter.
     if (!empty($form_state['values']['file_subdir'])) {
diff --git a/core/modules/filter/src/FilterFormatAddForm.php b/core/modules/filter/src/FilterFormatAddForm.php
index 5a0e83e..8c6ad4a 100644
--- a/core/modules/filter/src/FilterFormatAddForm.php
+++ b/core/modules/filter/src/FilterFormatAddForm.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\filter;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Provides a form for adding a filter format.
  */
@@ -15,14 +17,14 @@ class FilterFormatAddForm extends FilterFormatFormBase {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     return parent::form($form, $form_state);
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     parent::submit($form, $form_state);
     drupal_set_message($this->t('Added text format %format.', array('%format' => $this->entity->label())));
     return $this->entity;
diff --git a/core/modules/filter/src/FilterFormatEditForm.php b/core/modules/filter/src/FilterFormatEditForm.php
index a1448a0..ab437ac 100644
--- a/core/modules/filter/src/FilterFormatEditForm.php
+++ b/core/modules/filter/src/FilterFormatEditForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\filter;
 
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 
 /**
@@ -17,7 +18,7 @@ class FilterFormatEditForm extends FilterFormatFormBase {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     if (!$this->entity->status()) {
       throw new NotFoundHttpException();
     }
@@ -31,7 +32,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     parent::submit($form, $form_state);
     drupal_set_message($this->t('The text format %format has been updated.', array('%format' => $this->entity->label())));
     return $this->entity;
diff --git a/core/modules/filter/src/FilterFormatFormBase.php b/core/modules/filter/src/FilterFormatFormBase.php
index 7a23b93..fce0b93 100644
--- a/core/modules/filter/src/FilterFormatFormBase.php
+++ b/core/modules/filter/src/FilterFormatFormBase.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\Query\QueryFactory;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\filter\Plugin\Filter\FilterNull;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -47,7 +48,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $format = $this->entity;
     $is_fallback = ($format->id() == $this->config('filter.settings')->get('fallback_format'));
 
@@ -209,7 +210,7 @@ public function exists($format_id) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     parent::validate($form, $form_state);
 
     // @todo Move trimming upstream.
@@ -233,7 +234,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     parent::submit($form, $form_state);
 
     // Add the submitted form values to the text format, and save it.
@@ -265,7 +266,7 @@ public function submit(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->t('Save configuration');
     return $actions;
diff --git a/core/modules/filter/src/FilterFormatListBuilder.php b/core/modules/filter/src/FilterFormatListBuilder.php
index 4f1a5cb..0003cfa 100644
--- a/core/modules/filter/src/FilterFormatListBuilder.php
+++ b/core/modules/filter/src/FilterFormatListBuilder.php
@@ -13,6 +13,7 @@
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -136,15 +137,16 @@ public function getDefaultOperations(EntityInterface $entity) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form = parent::buildForm($form, $form_state);
     $form['actions']['submit']['#value'] = $this->t('Save changes');
     return $form;
   }
+
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     parent::submitForm($form, $form_state);
 
     filter_formats_reset();
diff --git a/core/modules/filter/src/Form/FilterDisableForm.php b/core/modules/filter/src/Form/FilterDisableForm.php
index b938fee..dbb67f9 100644
--- a/core/modules/filter/src/Form/FilterDisableForm.php
+++ b/core/modules/filter/src/Form/FilterDisableForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\filter\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -46,7 +47,7 @@ public function getDescription() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->disable()->save();
     drupal_set_message($this->t('Disabled text format %format.', array('%format' => $this->entity->label())));
 
diff --git a/core/modules/filter/src/Plugin/Filter/FilterHtml.php b/core/modules/filter/src/Plugin/Filter/FilterHtml.php
index 6549168..b76933e 100644
--- a/core/modules/filter/src/Plugin/Filter/FilterHtml.php
+++ b/core/modules/filter/src/Plugin/Filter/FilterHtml.php
@@ -8,6 +8,7 @@
 namespace Drupal\filter\Plugin\Filter;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\filter\FilterProcessResult;
 use Drupal\filter\Plugin\FilterBase;
 
@@ -31,7 +32,7 @@ class FilterHtml extends FilterBase {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $form['allowed_html'] = array(
       '#type' => 'textfield',
       '#title' => $this->t('Allowed HTML tags'),
diff --git a/core/modules/filter/src/Plugin/Filter/FilterUrl.php b/core/modules/filter/src/Plugin/Filter/FilterUrl.php
index d717f2c..a915052 100644
--- a/core/modules/filter/src/Plugin/Filter/FilterUrl.php
+++ b/core/modules/filter/src/Plugin/Filter/FilterUrl.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\filter\Plugin\Filter;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\filter\FilterProcessResult;
 use Drupal\filter\Plugin\FilterBase;
 
@@ -27,7 +28,7 @@ class FilterUrl extends FilterBase {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $form['filter_url_length'] = array(
       '#type' => 'number',
       '#title' => $this->t('Maximum link text length'),
diff --git a/core/modules/filter/src/Plugin/FilterBase.php b/core/modules/filter/src/Plugin/FilterBase.php
index cfed8ac..2b39147 100644
--- a/core/modules/filter/src/Plugin/FilterBase.php
+++ b/core/modules/filter/src/Plugin/FilterBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\filter\Plugin;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\PluginBase;
 
 /**
@@ -141,7 +142,7 @@ public function getDescription() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     // Implementations should work with and return $form. Returning an empty
     // array here allows the text format administration form to identify whether
     // the filter plugin has any settings form elements.
diff --git a/core/modules/filter/src/Plugin/FilterInterface.php b/core/modules/filter/src/Plugin/FilterInterface.php
index dbbc490..aa2438b 100644
--- a/core/modules/filter/src/Plugin/FilterInterface.php
+++ b/core/modules/filter/src/Plugin/FilterInterface.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Plugin\PluginInspectionInterface;
 use Drupal\Component\Plugin\ConfigurablePluginInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Defines the interface for text processing filter plugins.
@@ -132,14 +133,14 @@ public function getDescription();
    *
    * @param array $form
    *   A minimally prepopulated form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The state of the (entire) configuration form.
    *
    * @return array
    *   The $form array with additional form elements for the settings of this
    *   filter. The submitted form values should match $this->settings.
    */
-  public function settingsForm(array $form, array &$form_state);
+  public function settingsForm(array $form, FormStateInterface $form_state);
 
   /**
    * Prepares the text for processing.
diff --git a/core/modules/filter/tests/filter_test/src/Form/FilterTestFormatForm.php b/core/modules/filter/tests/filter_test/src/Form/FilterTestFormatForm.php
index be8cd12..8f90746 100644
--- a/core/modules/filter/tests/filter_test/src/Form/FilterTestFormatForm.php
+++ b/core/modules/filter/tests/filter_test/src/Form/FilterTestFormatForm.php
@@ -7,6 +7,7 @@
 namespace Drupal\filter_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Shows a test form for testing the 'text_format' form element.
@@ -23,7 +24,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // This ensures that the parent array key makes it into the HTML ID of the
     // form elements.
     $form['#tree'] = TRUE;
@@ -109,7 +110,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/forum/src/Form/ContainerForm.php b/core/modules/forum/src/Form/ContainerForm.php
index 1918bd0..e167d74 100644
--- a/core/modules/forum/src/Form/ContainerForm.php
+++ b/core/modules/forum/src/Form/ContainerForm.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\forum\Form;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Base form for container term edit forms.
  */
@@ -22,7 +24,7 @@ class ContainerForm extends ForumForm {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $taxonomy_term = $this->entity;
     // Build the bulk of the form from the parent forum form.
     $form = parent::form($form, $form_state, $taxonomy_term);
@@ -40,7 +42,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $is_new = $this->entity->isNew();
     $this->entity->forum_container = TRUE;
     $term = parent::save($form, $form_state);
diff --git a/core/modules/forum/src/Form/DeleteForm.php b/core/modules/forum/src/Form/DeleteForm.php
index 94c21f2..a3f6824 100644
--- a/core/modules/forum/src/Form/DeleteForm.php
+++ b/core/modules/forum/src/Form/DeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\forum\Form;
 
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Drupal\taxonomy\TermInterface;
 
@@ -54,7 +55,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, TermInterface $taxonomy_term = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, TermInterface $taxonomy_term = NULL) {
     $this->taxonomyTerm = $taxonomy_term;
 
     return parent::buildForm($form, $form_state);
@@ -63,7 +64,7 @@ public function buildForm(array $form, array &$form_state, TermInterface $taxono
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->taxonomyTerm->delete();
     drupal_set_message($this->t('The forum %label and all sub-forums have been deleted.', array('%label' => $this->taxonomyTerm->label())));
     watchdog('forum', 'forum: deleted %label and all its sub-forums.', array('%label' => $this->taxonomyTerm->label()), WATCHDOG_NOTICE);
diff --git a/core/modules/forum/src/Form/ForumForm.php b/core/modules/forum/src/Form/ForumForm.php
index 34c64df..9dfb9f0 100644
--- a/core/modules/forum/src/Form/ForumForm.php
+++ b/core/modules/forum/src/Form/ForumForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\forum\Form;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\taxonomy\TermForm;
 
 /**
@@ -31,7 +32,7 @@ class ForumForm extends TermForm {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $taxonomy_term = $this->entity;
     // Build the bulk of the form from the parent taxonomy term form.
     $form = parent::form($form, $form_state, $taxonomy_term);
@@ -61,7 +62,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function buildEntity(array $form, array &$form_state) {
+  public function buildEntity(array $form, FormStateInterface $form_state) {
     $term = parent::buildEntity($form, $form_state);
 
     // Assign parents from forum parent select field.
@@ -73,7 +74,7 @@ public function buildEntity(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $term = $this->entity;
     $term_storage = $this->entityManager->getStorage('taxonomy_term');
     $status = $term_storage->save($term);
@@ -98,7 +99,7 @@ public function save(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
 
     if (!$this->entity->isNew() && $this->entity->hasLinkTemplate('forum-delete-form')) {
diff --git a/core/modules/forum/src/Form/Overview.php b/core/modules/forum/src/Form/Overview.php
index 98c3feb..98688ab 100644
--- a/core/modules/forum/src/Form/Overview.php
+++ b/core/modules/forum/src/Form/Overview.php
@@ -8,6 +8,7 @@
 namespace Drupal\forum\Form;
 
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\taxonomy\Form\OverviewTerms;
 use Drupal\Core\Config\ConfigFactoryInterface;
@@ -60,7 +61,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $forum_config = $this->config('forum.settings');
     $vid = $forum_config->get('vocabulary');
     $vocabulary = $this->entityManager->getStorage('taxonomy_vocabulary')->load($vid);
diff --git a/core/modules/forum/src/ForumSettingsForm.php b/core/modules/forum/src/ForumSettingsForm.php
index dbe486f..51b42a3 100644
--- a/core/modules/forum/src/ForumSettingsForm.php
+++ b/core/modules/forum/src/ForumSettingsForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\forum;
 
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Configure forum settings for this site.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('forum.settings');
 
     $options = array(5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 80, 100, 150, 200, 250, 300, 350, 400, 500);
@@ -63,7 +64,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('forum.settings')
       ->set('topics.hot_threshold', $form_state['values']['forum_hot_topic'])
       ->set('topics.page_limit', $form_state['values']['forum_per_page'])
diff --git a/core/modules/forum/src/Plugin/Block/ForumBlockBase.php b/core/modules/forum/src/Plugin/Block/ForumBlockBase.php
index 6a5b492..b9bab02 100644
--- a/core/modules/forum/src/Plugin/Block/ForumBlockBase.php
+++ b/core/modules/forum/src/Plugin/Block/ForumBlockBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\forum\Plugin\Block;
 
 use Drupal\block\BlockBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Cache\Cache;
 
@@ -61,9 +62,9 @@ protected function blockAccess(AccountInterface $account) {
   }
 
   /**
-   * Overrides \Drupal\block\BlockBase::blockForm().
+   * {@inheritdoc}
    */
-  public function blockForm($form, &$form_state) {
+  public function blockForm($form, FormStateInterface $form_state) {
     $range = range(2, 20);
     $form['block_count'] = array(
       '#type' => 'select',
@@ -75,9 +76,9 @@ public function blockForm($form, &$form_state) {
   }
 
   /**
-   * Overrides \Drupal\block\BlockBase::blockSubmit().
+   * {@inheritdoc}
    */
-  public function blockSubmit($form, &$form_state) {
+  public function blockSubmit($form, FormStateInterface $form_state) {
     $this->configuration['block_count'] = $form_state['values']['block_count'];
   }
 
diff --git a/core/modules/image/src/ConfigurableImageEffectBase.php b/core/modules/image/src/ConfigurableImageEffectBase.php
index ce42164..7b391b5 100644
--- a/core/modules/image/src/ConfigurableImageEffectBase.php
+++ b/core/modules/image/src/ConfigurableImageEffectBase.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\image;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Provides a base class for configurable image effects.
  */
@@ -15,13 +17,13 @@
   /**
    * {@inheritdoc}
    */
-  public function validateConfigurationForm(array &$form, array &$form_state) {
+  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/image/src/Form/ImageEffectAddForm.php b/core/modules/image/src/Form/ImageEffectAddForm.php
index 1efeab1..e491d07 100644
--- a/core/modules/image/src/Form/ImageEffectAddForm.php
+++ b/core/modules/image/src/Form/ImageEffectAddForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\image\Form;
 
 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\image\ImageEffectManager;
 use Drupal\image\ImageStyleInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -46,7 +47,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, ImageStyleInterface $image_style = NULL, $image_effect = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, ImageStyleInterface $image_style = NULL, $image_effect = NULL) {
     $form = parent::buildForm($form, $form_state, $image_style, $image_effect);
 
     $form['#title'] = $this->t('Add %label effect', array('%label' => $this->imageEffect->label()));
diff --git a/core/modules/image/src/Form/ImageEffectDeleteForm.php b/core/modules/image/src/Form/ImageEffectDeleteForm.php
index a9ffdde..4663672 100644
--- a/core/modules/image/src/Form/ImageEffectDeleteForm.php
+++ b/core/modules/image/src/Form/ImageEffectDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\image\Form;
 
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\image\ImageStyleInterface;
 
 /**
@@ -60,7 +61,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, ImageStyleInterface $image_style = NULL, $image_effect = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, ImageStyleInterface $image_style = NULL, $image_effect = NULL) {
     $this->imageStyle = $image_style;
     $this->imageEffect = $this->imageStyle->getEffect($image_effect);
 
@@ -70,7 +71,7 @@ public function buildForm(array $form, array &$form_state, ImageStyleInterface $
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->imageStyle->deleteImageEffect($this->imageEffect);
     drupal_set_message($this->t('The image effect %name has been deleted.', array('%name' => $this->imageEffect->label())));
     $form_state['redirect_route'] = $this->imageStyle->urlInfo('edit-form');
diff --git a/core/modules/image/src/Form/ImageEffectEditForm.php b/core/modules/image/src/Form/ImageEffectEditForm.php
index f949e6c..1e2ba85 100644
--- a/core/modules/image/src/Form/ImageEffectEditForm.php
+++ b/core/modules/image/src/Form/ImageEffectEditForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\image\Form;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\image\ImageStyleInterface;
 
 /**
@@ -17,7 +18,7 @@ class ImageEffectEditForm extends ImageEffectFormBase {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, ImageStyleInterface $image_style = NULL, $image_effect = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, ImageStyleInterface $image_style = NULL, $image_effect = NULL) {
     $form = parent::buildForm($form, $form_state, $image_style, $image_effect);
 
     $form['#title'] = $this->t('Edit %label effect', array('%label' => $this->imageEffect->label()));
diff --git a/core/modules/image/src/Form/ImageEffectFormBase.php b/core/modules/image/src/Form/ImageEffectFormBase.php
index 6cc8d1d..439fc23 100644
--- a/core/modules/image/src/Form/ImageEffectFormBase.php
+++ b/core/modules/image/src/Form/ImageEffectFormBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\image\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\image\ConfigurableImageEffectInterface;
 use Drupal\image\ImageStyleInterface;
 use Drupal\Component\Plugin\Exception\PluginNotFoundException;
@@ -53,7 +54,7 @@ public function getFormId() {
    *
    * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
    */
-  public function buildForm(array $form, array &$form_state, ImageStyleInterface $image_style = NULL, $image_effect = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, ImageStyleInterface $image_style = NULL, $image_effect = NULL) {
     $this->imageStyle = $image_style;
     try {
       $this->imageEffect = $this->prepareImageEffect($image_effect);
@@ -101,7 +102,7 @@ public function buildForm(array $form, array &$form_state, ImageStyleInterface $
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     // The image effect configuration is stored in the 'data' key in the form,
     // pass that through for validation.
     $effect_data = array(
@@ -113,7 +114,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     form_state_values_clean($form_state);
 
     // The image effect configuration is stored in the 'data' key in the form,
diff --git a/core/modules/image/src/Form/ImageStyleAddForm.php b/core/modules/image/src/Form/ImageStyleAddForm.php
index 64c2a37..7d34a1d 100644
--- a/core/modules/image/src/Form/ImageStyleAddForm.php
+++ b/core/modules/image/src/Form/ImageStyleAddForm.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\image\Form;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Controller for image style addition forms.
  */
@@ -15,7 +17,7 @@ class ImageStyleAddForm extends ImageStyleFormBase {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     parent::save($form, $form_state);
     drupal_set_message($this->t('Style %name was created.', array('%name' => $this->entity->label())));
   }
@@ -23,7 +25,7 @@ public function save(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function actions(array $form, array &$form_state) {
+  public function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->t('Create new style');
 
diff --git a/core/modules/image/src/Form/ImageStyleDeleteForm.php b/core/modules/image/src/Form/ImageStyleDeleteForm.php
index 2957051..7aeacb1 100644
--- a/core/modules/image/src/Form/ImageStyleDeleteForm.php
+++ b/core/modules/image/src/Form/ImageStyleDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\image\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -46,7 +47,7 @@ public function getDescription() {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $replacement_styles = array_diff_key(image_style_options(), array($this->entity->id() => ''));
     $form['replacement'] = array(
       '#title' => $this->t('Replacement style'),
@@ -61,7 +62,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->set('replacementID', $form_state['values']['replacement']);
     $this->entity->delete();
     drupal_set_message($this->t('Style %name was deleted.', array('%name' => $this->entity->label())));
diff --git a/core/modules/image/src/Form/ImageStyleEditForm.php b/core/modules/image/src/Form/ImageStyleEditForm.php
index 8b27119..4d61a15 100644
--- a/core/modules/image/src/Form/ImageStyleEditForm.php
+++ b/core/modules/image/src/Form/ImageStyleEditForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\image\ConfigurableImageEffectInterface;
 use Drupal\image\ImageEffectManager;
 use Drupal\Component\Utility\String;
@@ -52,7 +53,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form['#title'] = $this->t('Edit style %name', array('%name' => $this->entity->label()));
     $form['#tree'] = TRUE;
     $form['#attached']['css'][drupal_get_path('module', 'image') . '/css/image.admin.css'] = array();
@@ -214,7 +215,7 @@ public function effectSave($form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
 
     // Update image effect weights.
     if (!empty($form_state['values']['effects'])) {
@@ -228,7 +229,7 @@ public function save(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function actions(array $form, array &$form_state) {
+  public function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->t('Update style');
 
@@ -253,7 +254,7 @@ protected function updateEffectWeights(array $effects) {
   /**
    * {@inheritdoc}
    */
-  protected function copyFormValuesToEntity(EntityInterface $entity, array $form, array &$form_state) {
+  protected function copyFormValuesToEntity(EntityInterface $entity, array $form, FormStateInterface $form_state) {
     foreach ($form_state['values'] as $key => $value) {
       // Do not copy effects here, see self::updateEffectWeights().
       if ($key != 'effects') {
diff --git a/core/modules/image/src/Form/ImageStyleFlushForm.php b/core/modules/image/src/Form/ImageStyleFlushForm.php
index 4de1d05..a1dbddf 100644
--- a/core/modules/image/src/Form/ImageStyleFlushForm.php
+++ b/core/modules/image/src/Form/ImageStyleFlushForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\image\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -46,7 +47,7 @@ public function getCancelRoute() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->flush();
     drupal_set_message($this->t('The image style %name has been flushed.', array('%name' => $this->entity->label())));
     $form_state['redirect_route'] = $this->getCancelRoute();
diff --git a/core/modules/image/src/Form/ImageStyleFormBase.php b/core/modules/image/src/Form/ImageStyleFormBase.php
index efac805..ad4ce5c 100644
--- a/core/modules/image/src/Form/ImageStyleFormBase.php
+++ b/core/modules/image/src/Form/ImageStyleFormBase.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -52,7 +53,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
 
     $form['label'] = array(
       '#type' => 'textfield',
@@ -75,7 +76,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $this->entity->save();
     $form_state['redirect_route'] = $this->entity->urlInfo('edit-form');
   }
diff --git a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
index c14ab91..069178d 100644
--- a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
+++ b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
@@ -8,6 +8,7 @@
 namespace Drupal\image\Plugin\Field\FieldFormatter;
 
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'image' formatter.
@@ -35,7 +36,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $image_styles = image_style_options(FALSE);
     $element['image_style'] = array(
       '#title' => t('Image style'),
diff --git a/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php b/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php
index c2e8737..b7a4fd7 100644
--- a/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php
+++ b/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php
@@ -8,6 +8,7 @@
 namespace Drupal\image\Plugin\Field\FieldType;
 
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\TypedData\DataDefinition;
 use Drupal\file\Plugin\Field\FieldType\FileItem;
 
@@ -152,7 +153,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array &$form, array &$form_state, $has_data) {
+  public function settingsForm(array &$form, FormStateInterface $form_state, $has_data) {
     $element = array();
 
     // We need the field-level 'default_image' setting, and $this->getSettings()
@@ -182,7 +183,7 @@ public function settingsForm(array &$form, array &$form_state, $has_data) {
   /**
    * {@inheritdoc}
    */
-  public function instanceSettingsForm(array $form, array &$form_state) {
+  public function instanceSettingsForm(array $form, FormStateInterface $form_state) {
     // Get base form from FileItem::instanceSettingsForm().
     $element = parent::instanceSettingsForm($form, $form_state);
 
@@ -383,10 +384,10 @@ protected function defaultImageForm(array &$element, array $settings) {
    *
    * @param array $element
    *   The form element to process.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state.
    */
-  public static function validateDefaultImageForm(array &$element, array &$form_state) {
+  public static function validateDefaultImageForm(array &$element, &$form_state) {
     // Consolidate the array value of this field to a single FID as #extended
     // for default image is not TRUE and this is a single value.
     if (isset($element['fids']['#value'][0])) {
diff --git a/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php b/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php
index 0ba9e7e..d7a73a5 100644
--- a/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php
+++ b/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Component\Utility\NestedArray;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\file\Plugin\Field\FieldWidget\FileWidget;
 
 /**
@@ -37,7 +38,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element = parent::settingsForm($form, $form_state);
 
     $element['preview_image_style'] = array(
@@ -82,7 +83,7 @@ public function settingsSummary() {
    *
    * Special handling for draggable multiple widgets and 'add more' button.
    */
-  protected function formMultipleElements(FieldItemListInterface $items, array &$form, array &$form_state) {
+  protected function formMultipleElements(FieldItemListInterface $items, array &$form, FormStateInterface $form_state) {
     $elements = parent::formMultipleElements($items, $form, $form_state);
 
     $cardinality = $this->fieldDefinition->getFieldStorageDefinition()->getCardinality();
@@ -109,7 +110,7 @@ protected function formMultipleElements(FieldItemListInterface $items, array &$f
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $element = parent::formElement($items, $delta, $element, $form, $form_state);
 
     $field_settings = $this->getFieldSettings();
diff --git a/core/modules/image/src/Plugin/ImageEffect/CropImageEffect.php b/core/modules/image/src/Plugin/ImageEffect/CropImageEffect.php
index 42f6561..0edac98 100644
--- a/core/modules/image/src/Plugin/ImageEffect/CropImageEffect.php
+++ b/core/modules/image/src/Plugin/ImageEffect/CropImageEffect.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\image\Plugin\ImageEffect;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Image\ImageInterface;
 
 /**
@@ -59,7 +60,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form = parent::buildConfigurationForm($form, $form_state);
     $form['anchor'] = array(
       '#type' => 'radios',
diff --git a/core/modules/image/src/Plugin/ImageEffect/ResizeImageEffect.php b/core/modules/image/src/Plugin/ImageEffect/ResizeImageEffect.php
index f7d495d..15f0080 100644
--- a/core/modules/image/src/Plugin/ImageEffect/ResizeImageEffect.php
+++ b/core/modules/image/src/Plugin/ImageEffect/ResizeImageEffect.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\image\Plugin\ImageEffect;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Image\ImageInterface;
 use Drupal\image\ConfigurableImageEffectBase;
 
@@ -67,7 +68,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form['width'] = array(
       '#type' => 'number',
       '#title' => t('Width'),
@@ -90,7 +91,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     parent::submitConfigurationForm($form, $form_state);
 
     $this->configuration['height'] = $form_state['values']['height'];
diff --git a/core/modules/image/src/Plugin/ImageEffect/RotateImageEffect.php b/core/modules/image/src/Plugin/ImageEffect/RotateImageEffect.php
index 49529cd..7f29aaf 100644
--- a/core/modules/image/src/Plugin/ImageEffect/RotateImageEffect.php
+++ b/core/modules/image/src/Plugin/ImageEffect/RotateImageEffect.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\image\Plugin\ImageEffect;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Image\ImageInterface;
 use Drupal\Core\Utility\Color;
 use Drupal\image\ConfigurableImageEffectBase;
@@ -97,7 +98,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form['degrees'] = array(
       '#type' => 'number',
       '#default_value' => $this->configuration['degrees'],
@@ -126,7 +127,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateConfigurationForm(array &$form, array &$form_state) {
+  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
     if (!Color::validateHex($form_state['values']['bgcolor'])) {
       form_set_error('bgcolor', $form_state, $this->t('Background color must be a hexadecimal color value.'));
     }
@@ -135,7 +136,7 @@ public function validateConfigurationForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     parent::submitConfigurationForm($form, $form_state);
 
     $this->configuration['degrees'] = $form_state['values']['degrees'];
diff --git a/core/modules/image/src/Plugin/ImageEffect/ScaleImageEffect.php b/core/modules/image/src/Plugin/ImageEffect/ScaleImageEffect.php
index e1d8ec5..a5dae9a 100644
--- a/core/modules/image/src/Plugin/ImageEffect/ScaleImageEffect.php
+++ b/core/modules/image/src/Plugin/ImageEffect/ScaleImageEffect.php
@@ -8,6 +8,7 @@
 namespace Drupal\image\Plugin\ImageEffect;
 
 use Drupal\Component\Utility\Image;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Image\ImageInterface;
 
 /**
@@ -66,7 +67,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form = parent::buildConfigurationForm($form, $form_state);
     $form['width']['#required'] = FALSE;
     $form['height']['#required'] = FALSE;
@@ -82,7 +83,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateConfigurationForm(array &$form, array &$form_state) {
+  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
     parent::validateConfigurationForm($form, $form_state);
     if (empty($form_state['values']['width']) && empty($form_state['values']['height'])) {
       form_set_error('data', $form_state, $this->t('Width and height can not both be blank.'));
@@ -92,7 +93,7 @@ public function validateConfigurationForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     parent::submitConfigurationForm($form, $form_state);
 
     $this->configuration['upscale'] = $form_state['values']['upscale'];
diff --git a/core/modules/language/src/Form/ContentLanguageSettingsForm.php b/core/modules/language/src/Form/ContentLanguageSettingsForm.php
index 4738a18..47c136e 100644
--- a/core/modules/language/src/Form/ContentLanguageSettingsForm.php
+++ b/core/modules/language/src/Form/ContentLanguageSettingsForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -58,7 +59,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $entity_types = $this->entityManager->getDefinitions();
     $labels = array();
     $default = array();
@@ -146,7 +147,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $config = $this->config('language.settings');
     foreach ($form_state['values']['settings'] as $entity_type => $entity_settings) {
       foreach ($entity_settings as $bundle => $bundle_settings) {
diff --git a/core/modules/language/src/Form/LanguageAddForm.php b/core/modules/language/src/Form/LanguageAddForm.php
index 3eb0bc6..91b0618 100644
--- a/core/modules/language/src/Form/LanguageAddForm.php
+++ b/core/modules/language/src/Form/LanguageAddForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\language\Form;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\language\Form\LanguageFormBase;
 use Drupal\Core\Language\Language;
 
@@ -26,7 +27,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form['#title'] = $this->t('Add language');
 
     $predefined_languages = $this->languageManager->getStandardLanguageListWithoutConfigured();
@@ -81,7 +82,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $langcode = $form_state['values']['predefined_langcode'];
     if ($langcode == 'custom') {
       $langcode = $form_state['values']['langcode'];
@@ -109,7 +110,7 @@ public function submitForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function actions(array $form, array &$form_state) {
+  public function actions(array $form, FormStateInterface $form_state) {
     // No actions needed.
     return array();
   }
@@ -117,7 +118,7 @@ public function actions(array $form, array &$form_state) {
   /**
    * Validates the language addition form on custom language button.
    */
-  public function validateCustom(array $form, array &$form_state) {
+  public function validateCustom(array $form, &$form_state) {
     if ($form_state['values']['predefined_langcode'] == 'custom') {
       $langcode = $form_state['values']['langcode'];
       // Reuse the editing form validation routine if we add a custom language.
diff --git a/core/modules/language/src/Form/LanguageDeleteForm.php b/core/modules/language/src/Form/LanguageDeleteForm.php
index 1e1e2a0..979c2c8 100644
--- a/core/modules/language/src/Form/LanguageDeleteForm.php
+++ b/core/modules/language/src/Form/LanguageDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\language\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\UrlGeneratorInterface;
 use Drupal\Core\Url;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -84,7 +85,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $langcode = $this->entity->id();
 
     // Warn and redirect user when attempting to delete the default language.
@@ -105,7 +106,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     // @todo This should be replaced with $this->entity->delete() when the
     //   additional logic in language_delete() is ported.
     $success = language_delete($this->entity->id());
diff --git a/core/modules/language/src/Form/LanguageEditForm.php b/core/modules/language/src/Form/LanguageEditForm.php
index 2dacdc2..f5d7498 100644
--- a/core/modules/language/src/Form/LanguageEditForm.php
+++ b/core/modules/language/src/Form/LanguageEditForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\language\Form;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\language\Form\LanguageFormBase;
 
 /**
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $this->commonForm($form);
     return parent::form($form, $form_state);
   }
@@ -33,7 +34,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function actions(array $form, array &$form_state) {
+  public function actions(array $form, FormStateInterface $form_state) {
     $actions['submit'] = array(
       '#type' => 'submit',
       '#value' => $this->t('Save language'),
@@ -46,7 +47,7 @@ public function actions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Prepare a language object for saving.
     $languages = language_list();
     $langcode = $form_state['values']['langcode'];
diff --git a/core/modules/language/src/Form/LanguageFormBase.php b/core/modules/language/src/Form/LanguageFormBase.php
index 583787a..87a1165 100644
--- a/core/modules/language/src/Form/LanguageFormBase.php
+++ b/core/modules/language/src/Form/LanguageFormBase.php
@@ -96,7 +96,7 @@ public function commonForm(array &$form) {
   /**
    * Validates the language editing element.
    */
-  public function validateCommon(array $form, array &$form_state) {
+  public function validateCommon(array $form, &$form_state) {
     // Ensure sane field values for langcode and name.
     if (!isset($form['langcode_view']) && preg_match('@[^a-zA-Z_-]@', $form_state['values']['langcode'])) {
       $this->setFormError('langcode', $form_state, $this->t('%field may only contain characters a-z, underscores, or hyphens.', array('%field' => $form['langcode']['#title'])));
diff --git a/core/modules/language/src/Form/NegotiationBrowserDeleteForm.php b/core/modules/language/src/Form/NegotiationBrowserDeleteForm.php
index 1d4260b..d0da6d1 100644
--- a/core/modules/language/src/Form/NegotiationBrowserDeleteForm.php
+++ b/core/modules/language/src/Form/NegotiationBrowserDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\language\Form;
 
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -45,7 +46,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $browser_langcode = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $browser_langcode = NULL) {
     $this->browserLangcode = $browser_langcode;
 
     $form = parent::buildForm($form, $form_state);
@@ -58,7 +59,7 @@ public function buildForm(array $form, array &$form_state, $browser_langcode = N
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $mappings = language_get_browser_drupal_langcode_mappings();
 
     if (array_key_exists($this->browserLangcode, $mappings)) {
diff --git a/core/modules/language/src/Form/NegotiationBrowserForm.php b/core/modules/language/src/Form/NegotiationBrowserForm.php
index f82e54a..9d1177b 100644
--- a/core/modules/language/src/Form/NegotiationBrowserForm.php
+++ b/core/modules/language/src/Form/NegotiationBrowserForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\language\ConfigurableLanguageManagerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -55,7 +56,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form = array();
 
     // Initialize a language list to the ones available, including English.
@@ -128,7 +129,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     // Array to check if all browser language codes are unique.
     $unique_values = array();
 
@@ -167,7 +168,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $mappings = $form_state['mappings'];
     if (!empty($mappings)) {
       $config = $this->config('language.mappings');
diff --git a/core/modules/language/src/Form/NegotiationConfigureForm.php b/core/modules/language/src/Form/NegotiationConfigureForm.php
index a6d241f..afc39aa 100644
--- a/core/modules/language/src/Form/NegotiationConfigureForm.php
+++ b/core/modules/language/src/Form/NegotiationConfigureForm.php
@@ -14,6 +14,7 @@
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\language\ConfigurableLanguageManagerInterface;
 use Drupal\language\LanguageNegotiatorInterface;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationSelected;
@@ -93,7 +94,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $configurable = $this->languageTypes->get('configurable');
 
     $form = array(
@@ -127,7 +128,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $configurable_types = $form['#language_types'];
 
     $stored_values = $this->languageTypes->get('configurable');
diff --git a/core/modules/language/src/Form/NegotiationSelectedForm.php b/core/modules/language/src/Form/NegotiationSelectedForm.php
index 47d61eb..f88daa8 100644
--- a/core/modules/language/src/Form/NegotiationSelectedForm.php
+++ b/core/modules/language/src/Form/NegotiationSelectedForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\language\Form;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Form\ConfigFormBase;
 
@@ -23,9 +24,9 @@ public function getFormId() {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::buildForm().
+   * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('language.negotiation');
     $form['selected_langcode'] = array(
       '#type' => 'language_select',
@@ -38,9 +39,9 @@ public function buildForm(array $form, array &$form_state) {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::submitForm().
+   * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('language.negotiation')
       ->set('selected_langcode', $form_state['values']['selected_langcode'])
       ->save();
diff --git a/core/modules/language/src/Form/NegotiationSessionForm.php b/core/modules/language/src/Form/NegotiationSessionForm.php
index 13936af..ef4cb3d 100644
--- a/core/modules/language/src/Form/NegotiationSessionForm.php
+++ b/core/modules/language/src/Form/NegotiationSessionForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\language\Form;
 
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Configure the session language negotiation method for this site.
@@ -22,9 +23,9 @@ public function getFormId() {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::buildForm().
+   * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('language.negotiation');
     $form['language_negotiation_session_param'] = array(
       '#title' => t('Request/session parameter'),
@@ -39,9 +40,9 @@ public function buildForm(array $form, array &$form_state) {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::submitForm().
+   * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('language.settings')
       ->set('session.parameter', $form_state['values']['language_negotiation_session_param'])
       ->save();
diff --git a/core/modules/language/src/Form/NegotiationUrlForm.php b/core/modules/language/src/Form/NegotiationUrlForm.php
index d8c2490..96cbbb8 100644
--- a/core/modules/language/src/Form/NegotiationUrlForm.php
+++ b/core/modules/language/src/Form/NegotiationUrlForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\language\Form;
 
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl;
 
 /**
@@ -23,9 +24,9 @@ public function getFormId() {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::buildForm().
+   * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     global $base_url;
     $config = $this->config('language.negotiation');
 
@@ -96,7 +97,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * Implements \Drupal\Core\Form\FormInterface::validateForm().
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $languages = language_list();
 
     // Count repeated values for uniqueness check.
@@ -158,9 +159,9 @@ public function validateForm(array &$form, array &$form_state) {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::submitForm().
+   * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Save selected format (prefix or domain).
     $this->config('language.negotiation')
       ->set('url.source', $form_state['values']['language_negotiation_url_part'])
diff --git a/core/modules/language/src/LanguageListBuilder.php b/core/modules/language/src/LanguageListBuilder.php
index c5bd66a..3c28810 100644
--- a/core/modules/language/src/LanguageListBuilder.php
+++ b/core/modules/language/src/LanguageListBuilder.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Config\Entity\DraggableListBuilder;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Defines a class to build a listing of language entities.
@@ -75,7 +76,7 @@ public function buildRow(EntityInterface $entity) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form = parent::buildForm($form, $form_state);
     $form[$this->entitiesKey]['#languages'] = $this->entities;
     $form['actions']['submit']['#value'] = t('Save configuration');
@@ -85,7 +86,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     parent::submitForm($form, $form_state);
 
     $language_manager = \Drupal::languageManager();
diff --git a/core/modules/language/src/Plugin/Condition/Language.php b/core/modules/language/src/Plugin/Condition/Language.php
index 46a99cb..3ae2b09 100644
--- a/core/modules/language/src/Plugin/Condition/Language.php
+++ b/core/modules/language/src/Plugin/Condition/Language.php
@@ -8,6 +8,7 @@
 namespace Drupal\language\Plugin\Condition;
 
 use Drupal\Core\Condition\ConditionPluginBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 
 /**
@@ -27,7 +28,7 @@ class Language extends ConditionPluginBase {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     if (\Drupal::languageManager()->isMultilingual()) {
       // Fetch languages.
       $languages = language_list(LanguageInterface::STATE_ALL);
@@ -55,7 +56,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['langcodes'] = array_filter($form_state['values']['langcodes']);
     parent::submitConfigurationForm($form, $form_state);
   }
diff --git a/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElement.php b/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElement.php
index a213d5c..f9a0e1b 100644
--- a/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElement.php
+++ b/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElement.php
@@ -7,6 +7,7 @@
 namespace Drupal\language_elements_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * A form containing a language configuration element.
@@ -23,7 +24,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $conf = language_get_default_configuration('some_custom_type', 'some_bundle');
 
     $form['lang_configuration'] = array(
@@ -46,6 +47,6 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 }
diff --git a/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElementTest.php b/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElementTest.php
index bf53149..130c069 100644
--- a/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElementTest.php
+++ b/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElementTest.php
@@ -7,6 +7,7 @@
 namespace Drupal\language_elements_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * A form containing a language select element.
@@ -23,7 +24,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['langcode'] = array(
       '#title' => t('Language select'),
       '#type' => 'language_select',
@@ -35,6 +36,6 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 }
diff --git a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php
index 37df049..0c08d66 100644
--- a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php
+++ b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FormatterBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Drupal\link\LinkItemInterface;
 
@@ -42,7 +43,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $elements = parent::settingsForm($form, $form_state);
 
     $elements['trim_length'] = array(
diff --git a/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php b/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php
index 850c19e..f8639bb 100644
--- a/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php
+++ b/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\TypedData\DataDefinition;
 use Drupal\Core\TypedData\MapDataDefinition;
 use Drupal\link\LinkItemInterface;
@@ -104,7 +105,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
   /**
    * {@inheritdoc}
    */
-  public function instanceSettingsForm(array $form, array &$form_state) {
+  public function instanceSettingsForm(array $form, FormStateInterface $form_state) {
     $element = array();
 
     $element['link_type'] = array(
diff --git a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
index 27072ee..941de57 100644
--- a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
+++ b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\ParamConverter\ParamNotConvertedException;
 use Drupal\Core\Routing\MatchingRouteNotFoundException;
 use Drupal\Core\Url;
@@ -42,7 +43,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
 
     $default_url_value = NULL;
     if (isset($items[$delta]->url)) {
@@ -138,7 +139,7 @@ protected function supportsExternalLinks() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $elements = parent::settingsForm($form, $form_state);
 
     $elements['placeholder_url'] = array(
@@ -200,7 +201,7 @@ public function validateTitle(&$element, &$form_state, $form) {
   /**
    * {@inheritdoc}
    */
-  public function massageFormValues(array $values, array $form, array &$form_state) {
+  public function massageFormValues(array $values, array $form, FormStateInterface $form_state) {
     foreach ($values as &$value) {
       if (!empty($value['url'])) {
         try {
diff --git a/core/modules/locale/src/Form/ExportForm.php b/core/modules/locale/src/Form/ExportForm.php
index 70f611c..dcac323 100644
--- a/core/modules/locale/src/Form/ExportForm.php
+++ b/core/modules/locale/src/Form/ExportForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Gettext\PoStreamWriter;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\locale\PoDatabaseReader;
@@ -56,7 +57,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $languages = $this->languageManager->getLanguages();
     $language_options = array();
     foreach ($languages as $langcode => $language) {
@@ -127,7 +128,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // If template is required, language code is not given.
     if ($form_state['values']['langcode'] != LanguageInterface::LANGCODE_SYSTEM) {
       $language = $this->languageManager->getLanguage($form_state['values']['langcode']);
diff --git a/core/modules/locale/src/Form/ImportForm.php b/core/modules/locale/src/Form/ImportForm.php
index f1ae6a1..e789a0d 100644
--- a/core/modules/locale/src/Form/ImportForm.php
+++ b/core/modules/locale/src/Form/ImportForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\Language;
 use Drupal\language\ConfigurableLanguageManagerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -71,7 +72,7 @@ public function getFormID() {
   /**
    * Form constructor for the translation import screen.
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $languages = $this->languageManager->getLanguages();
 
     // Initialize a language list to the ones available, including English if we
@@ -157,7 +158,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $this->file = file_save_upload('file', $form['file']['#upload_validators'], 'translations://', 0);
 
     // Ensure we have the file uploaded.
@@ -169,7 +170,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Add language, if not yet supported.
     $language = $this->languageManager->getLanguage($form_state['values']['langcode']);
     if (empty($language)) {
diff --git a/core/modules/locale/src/Form/LocaleSettingsForm.php b/core/modules/locale/src/Form/LocaleSettingsForm.php
index 5bc2968..ccd6549 100644
--- a/core/modules/locale/src/Form/LocaleSettingsForm.php
+++ b/core/modules/locale/src/Form/LocaleSettingsForm.php
@@ -7,6 +7,7 @@
 namespace Drupal\locale\Form;
 
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Configure locale settings for this site.
@@ -21,9 +22,9 @@ public function getFormId() {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::buildForm().
+   * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('locale.settings');
 
     $form['update_interval_days'] = array(
@@ -83,7 +84,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * Implements \Drupal\Core\Form\FormInterface::validateForm().
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     parent::validateForm($form, $form_state);
 
     if (empty($form['#translation_directory']) && $form_state['values']['use_source'] == LOCALE_TRANSLATION_USE_SOURCE_LOCAL) {
@@ -92,9 +93,9 @@ public function validateForm(array &$form, array &$form_state) {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::submitForm().
+   * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $values = $form_state['values'];
 
     $config = $this->config('locale.settings');
diff --git a/core/modules/locale/src/Form/TranslateEditForm.php b/core/modules/locale/src/Form/TranslateEditForm.php
index c846026..83c45f9 100644
--- a/core/modules/locale/src/Form/TranslateEditForm.php
+++ b/core/modules/locale/src/Form/TranslateEditForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\locale\Form;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\locale\SourceString;
 
@@ -26,7 +27,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $filter_values = $this->translateFilterValues();
     $langcode = $filter_values['langcode'];
 
@@ -158,7 +159,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $langcode = $form_state['values']['langcode'];
     foreach ($form_state['values']['strings'] as $lid => $translations) {
       foreach ($translations['translations'] as $key => $value) {
@@ -174,7 +175,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $langcode = $form_state['values']['langcode'];
     $updated = array();
 
diff --git a/core/modules/locale/src/Form/TranslateFilterForm.php b/core/modules/locale/src/Form/TranslateFilterForm.php
index 213935a..850395f 100644
--- a/core/modules/locale/src/Form/TranslateFilterForm.php
+++ b/core/modules/locale/src/Form/TranslateFilterForm.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\locale\Form;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Provides a filtered translation edit form.
  */
@@ -22,7 +24,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $filters = $this->translateFilters();
     $filter_values = $this->translateFilterValues();
 
@@ -82,7 +84,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $filters = $this->translateFilters();
     foreach ($filters as $name => $filter) {
       if (isset($form_state['values'][$name])) {
@@ -95,7 +97,7 @@ public function submitForm(array &$form, array &$form_state) {
   /**
    * Provides a submit handler for the reset button.
    */
-  public function resetForm(array &$form, array &$form_state) {
+  public function resetForm(array &$form, &$form_state) {
     $_SESSION['locale_translate_filter'] = array();
     $form_state['redirect_route']['route_name'] = 'locale.translate_page';
   }
diff --git a/core/modules/locale/src/Form/TranslationStatusForm.php b/core/modules/locale/src/Form/TranslationStatusForm.php
index a1c7e34..b09658f 100644
--- a/core/modules/locale/src/Form/TranslationStatusForm.php
+++ b/core/modules/locale/src/Form/TranslationStatusForm.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\State\StateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -67,7 +68,7 @@ public function getFormID() {
    *
    * @ingroup forms
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $languages = locale_translatable_language_list();
     $status = locale_translation_get_status();
     $options = array();
@@ -264,7 +265,7 @@ protected function createInfoString($project_info) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     // Check if a language has been selected. 'tableselect' doesn't.
     if (!array_filter($form_state['values']['langcodes'])) {
       $this->setFormError('', $this->t('Select a language to update.'));
@@ -274,7 +275,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->moduleHandler->loadInclude('locale', 'fetch.inc');
     $langcodes = array_filter($form_state['values']['langcodes']);
     $projects = array_filter($form_state['values']['projects_update']);
diff --git a/core/modules/menu_link/src/MenuLinkForm.php b/core/modules/menu_link/src/MenuLinkForm.php
index f5cbca1..0c49cc9 100644
--- a/core/modules/menu_link/src/MenuLinkForm.php
+++ b/core/modules/menu_link/src/MenuLinkForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Core\Entity\EntityForm;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Path\AliasManagerInterface;
 use Drupal\Core\Routing\UrlGenerator;
@@ -68,9 +69,9 @@ public static function create(ContainerInterface $container) {
   }
 
   /**
-   * Overrides EntityForm::form().
+   * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $menu_link = $this->entity;
     // Since menu_link_load() no longer returns a translated and access checked
     // item, do it here instead.
@@ -190,18 +191,18 @@ public function form(array $form, array &$form_state) {
   }
 
   /**
-   * Overrides EntityForm::actions().
+   * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $element = parent::actions($form, $form_state);
     $element['submit']['#button_type'] = 'primary';
     return $element;
   }
 
   /**
-   * Overrides EntityForm::validate().
+   * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     $menu_link = $this->buildEntity($form, $form_state);
 
     $normal_path = $this->pathAliasManager->getPathByAlias($menu_link->link_path);
@@ -241,7 +242,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function buildEntity(array $form, array &$form_state) {
+  public function buildEntity(array $form, FormStateInterface $form_state) {
     // @todo: Remove this when menu links are converted to content entities in
     //   http://drupal.org/node/1842858.
     $entity = clone $this->entity;
@@ -268,9 +269,9 @@ public function buildEntity(array $form, array &$form_state) {
   }
 
   /**
-   * Overrides EntityForm::submit().
+   * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     // Build the menu link object from the submitted values.
     $menu_link = parent::submit($form, $form_state);
 
@@ -286,9 +287,9 @@ public function submit(array $form, array &$form_state) {
   }
 
   /**
-   * Overrides EntityForm::save().
+   * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $menu_link = $this->entity;
 
     $saved = $menu_link->save();
diff --git a/core/modules/menu_ui/menu_ui.module b/core/modules/menu_ui/menu_ui.module
index 70b5b59..936287f 100644
--- a/core/modules/menu_ui/menu_ui.module
+++ b/core/modules/menu_ui/menu_ui.module
@@ -377,7 +377,7 @@ function menu_ui_node_predelete(EntityInterface $node) {
 /**
  * Implements hook_node_prepare_form().
  */
-function menu_ui_node_prepare_form(NodeInterface $node, $operation, array &$form_state) {
+function menu_ui_node_prepare_form(NodeInterface $node, $operation, &$form_state) {
   if (empty($node->menu)) {
     // Prepare the node for the edit form so that $node->menu always exists.
     $node_type_config = \Drupal::config('menu.entity.node.' . $node->getType());
diff --git a/core/modules/menu_ui/src/Form/MenuDeleteForm.php b/core/modules/menu_ui/src/Form/MenuDeleteForm.php
index d6ceff4..b751317 100644
--- a/core/modules/menu_ui/src/Form/MenuDeleteForm.php
+++ b/core/modules/menu_ui/src/Form/MenuDeleteForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Entity\EntityConfirmFormBase;
 use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -92,7 +93,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $form_state['redirect_route'] = new Url('menu_ui.overview_page');
 
     // Locked menus may not be deleted.
diff --git a/core/modules/menu_ui/src/Form/MenuLinkDeleteForm.php b/core/modules/menu_ui/src/Form/MenuLinkDeleteForm.php
index bfcc5fc..18437b0 100644
--- a/core/modules/menu_ui/src/Form/MenuLinkDeleteForm.php
+++ b/core/modules/menu_ui/src/Form/MenuLinkDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\menu_ui\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -34,7 +35,7 @@ public function getCancelRoute() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     menu_link_delete($this->entity->id());
     $t_args = array('%title' => $this->entity->link_title);
     drupal_set_message(t('The menu link %title has been deleted.', $t_args));
diff --git a/core/modules/menu_ui/src/Form/MenuLinkResetForm.php b/core/modules/menu_ui/src/Form/MenuLinkResetForm.php
index d3d2a67..ba5e5dc 100644
--- a/core/modules/menu_ui/src/Form/MenuLinkResetForm.php
+++ b/core/modules/menu_ui/src/Form/MenuLinkResetForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\menu_ui\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -48,7 +49,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity = $this->entity->reset();
     drupal_set_message(t('The menu link was reset to its default settings.'));
     $form_state['redirect_route'] = $this->getCancelRoute();
diff --git a/core/modules/menu_ui/src/MenuForm.php b/core/modules/menu_ui/src/MenuForm.php
index d854f3c..4b7e495 100644
--- a/core/modules/menu_ui/src/MenuForm.php
+++ b/core/modules/menu_ui/src/MenuForm.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\Query\QueryFactory;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Render\Element;
 use Drupal\menu_link\MenuLinkStorageInterface;
@@ -79,7 +80,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $menu = $this->entity;
 
     if ($this->operation == 'edit') {
@@ -175,7 +176,7 @@ public function menuNameExists($value) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
 
     // Add the language configuration submit handler. This is needed because the
@@ -196,7 +197,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * Submit handler to update the bundle for the default language configuration.
    */
-  public function languageConfigurationSubmit(array &$form, array &$form_state) {
+  public function languageConfigurationSubmit(array &$form, &$form_state) {
     // Since the machine name is not known yet, and it can be changed anytime,
     // we have to also update the bundle property for the default language
     // configuration in order to have the correct bundle value.
@@ -209,7 +210,7 @@ public function languageConfigurationSubmit(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $menu = $this->entity;
     if (!$menu->isNew() || $menu->isLocked()) {
       $this->submitOverviewForm($form, $form_state);
@@ -244,12 +245,12 @@ public function save(array $form, array &$form_state) {
    * Forms integrating this section should call menu_overview_form_submit() from
    * their form submit handler.
    */
-  protected function buildOverviewForm(array &$form, array &$form_state) {
+  protected function buildOverviewForm(array &$form, &$form_state) {
     // Ensure that menu_overview_form_submit() knows the parents of this form
     // section.
     $form['#tree'] = TRUE;
     $form['#theme'] = 'menu_overview_form';
-    $form_state += array('menu_overview_form_parents' => array());
+    $form_state->setIfNotExists('menu_overview_form_parents', array());
 
     $form['#attached']['css'] = array(drupal_get_path('module', 'menu') . '/css/menu.admin.css');
 
@@ -365,7 +366,7 @@ protected function buildOverviewTreeForm($tree, $delta) {
    * This function takes great care in saving parent items first, then items
    * underneath them. Saving items in the incorrect order can break the menu tree.
    */
-  protected function submitOverviewForm(array $complete_form, array &$form_state) {
+  protected function submitOverviewForm(array $complete_form, &$form_state) {
     // Form API supports constructing and validating self-contained sections
     // within forms, but does not allow to handle the form section's submission
     // equally separated yet. Therefore, we use a $form_state key to point to
diff --git a/core/modules/menu_ui/src/MenuSettingsForm.php b/core/modules/menu_ui/src/MenuSettingsForm.php
index 73bc7d7..77c3c15 100644
--- a/core/modules/menu_ui/src/MenuSettingsForm.php
+++ b/core/modules/menu_ui/src/MenuSettingsForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\menu_ui;
 
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Select the menus to be used for the main and secondary links for this site.
@@ -22,9 +23,9 @@ public function getFormId() {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::buildForm().
+   * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('menu_ui.settings');
     $form['intro'] = array(
       '#type' => 'item',
@@ -58,9 +59,9 @@ public function buildForm(array $form, array &$form_state) {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::submitForm().
+   * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('menu_ui.settings')
       ->set('main_links', $form_state['values']['menu_main_links_source'])
       ->set('secondary_links', $form_state['values']['menu_secondary_links_source'])
diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc
index 9757596..f253b1a 100644
--- a/core/modules/node/node.pages.inc
+++ b/core/modules/node/node.pages.inc
@@ -48,7 +48,7 @@ function template_preprocess_node_add_list(&$variables) {
  *
  * @see node_form_build_preview()
  */
-function node_preview(NodeInterface $node, array &$form_state) {
+function node_preview(NodeInterface $node, &$form_state) {
   if ($node->access('create') || $node->access('update')) {
 
     $node->changed = REQUEST_TIME;
diff --git a/core/modules/node/src/Form/DeleteMultiple.php b/core/modules/node/src/Form/DeleteMultiple.php
index 6b7db34..cbf7ed0 100644
--- a/core/modules/node/src/Form/DeleteMultiple.php
+++ b/core/modules/node/src/Form/DeleteMultiple.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Form\ConfirmFormBase;
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\user\TempStoreFactory;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -93,7 +94,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $this->nodes = $this->tempStoreFactory->get('node_multiple_delete_confirm')->get(\Drupal::currentUser()->id());
     if (empty($this->nodes)) {
       return new RedirectResponse(url('admin/content', array('absolute' => TRUE)));
@@ -115,7 +116,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     if ($form_state['values']['confirm'] && !empty($this->nodes)) {
       $this->storage->delete($this->nodes);
       $this->tempStoreFactory->get('node_multiple_delete_confirm')->delete(\Drupal::currentUser()->id());
diff --git a/core/modules/node/src/Form/NodeDeleteForm.php b/core/modules/node/src/Form/NodeDeleteForm.php
index dd54204..67a1517 100644
--- a/core/modules/node/src/Form/NodeDeleteForm.php
+++ b/core/modules/node/src/Form/NodeDeleteForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\ContentEntityConfirmFormBase;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\UrlGeneratorInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -71,7 +72,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     watchdog('content', '@type: deleted %title.', array('@type' => $this->entity->bundle(), '%title' => $this->entity->label()));
     $node_type_storage = $this->entityManager->getStorage('node_type');
diff --git a/core/modules/node/src/Form/NodeRevisionDeleteForm.php b/core/modules/node/src/Form/NodeRevisionDeleteForm.php
index 8890709..9c91d3f 100644
--- a/core/modules/node/src/Form/NodeRevisionDeleteForm.php
+++ b/core/modules/node/src/Form/NodeRevisionDeleteForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\node\NodeInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -104,7 +105,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $node_revision = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $node_revision = NULL) {
     $this->revision = $this->nodeStorage->loadRevision($node_revision);
     $form = parent::buildForm($form, $form_state);
 
@@ -116,7 +117,7 @@ public function buildForm(array $form, array &$form_state, $node_revision = NULL
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->nodeStorage->deleteRevision($this->revision->getRevisionId());
 
     watchdog('content', '@type: deleted %title revision %revision.', array('@type' => $this->revision->bundle(), '%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()));
diff --git a/core/modules/node/src/Form/NodeRevisionRevertForm.php b/core/modules/node/src/Form/NodeRevisionRevertForm.php
index 335e3a1..a3dcca6 100644
--- a/core/modules/node/src/Form/NodeRevisionRevertForm.php
+++ b/core/modules/node/src/Form/NodeRevisionRevertForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\node\NodeInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -87,7 +88,7 @@ public function getDescription() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $node_revision = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $node_revision = NULL) {
     $this->revision = $this->nodeStorage->loadRevision($node_revision);
     $form = parent::buildForm($form, $form_state);
 
@@ -99,7 +100,7 @@ public function buildForm(array $form, array &$form_state, $node_revision = NULL
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->revision->setNewRevision();
     // Make this the new default revision for the node.
     $this->revision->isDefaultRevision(TRUE);
diff --git a/core/modules/node/src/Form/NodeTypeDeleteConfirm.php b/core/modules/node/src/Form/NodeTypeDeleteConfirm.php
index a25ff7d..b542d38 100644
--- a/core/modules/node/src/Form/NodeTypeDeleteConfirm.php
+++ b/core/modules/node/src/Form/NodeTypeDeleteConfirm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
 use Drupal\Core\Database\Connection;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -67,7 +68,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $num_nodes = $this->database->query("SELECT COUNT(*) FROM {node} WHERE type = :type", array(':type' => $this->entity->id()))->fetchField();
     if ($num_nodes) {
       $caption = '<p>' . format_plural($num_nodes, '%type is used by 1 piece of content on your site. You can not remove this content type until you have removed all of the %type content.', '%type is used by @count pieces of content on your site. You may not remove %type until you have removed all of the %type content.', array('%type' => $this->entity->label())) . '</p>';
@@ -82,7 +83,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     $t_args = array('%name' => $this->entity->label());
     drupal_set_message(t('The content type %name has been deleted.', $t_args));
diff --git a/core/modules/node/src/Form/RebuildPermissionsForm.php b/core/modules/node/src/Form/RebuildPermissionsForm.php
index d284d0e..caf96b9 100644
--- a/core/modules/node/src/Form/RebuildPermissionsForm.php
+++ b/core/modules/node/src/Form/RebuildPermissionsForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\node\Form;
 
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 class RebuildPermissionsForm extends ConfirmFormBase {
@@ -50,7 +51,7 @@ public function getDescription() {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     node_access_rebuild(TRUE);
     $form_state['redirect_route'] = $this->getCancelRoute();
   }
diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php
index 69d91a5..945e7b8 100644
--- a/core/modules/node/src/NodeForm.php
+++ b/core/modules/node/src/NodeForm.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Datetime\DrupalDateTime;
 use Drupal\Core\Entity\ContentEntityForm;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Component\Utility\String;
 
@@ -43,9 +44,9 @@ protected function prepareEntity() {
   }
 
   /**
-   * Overrides Drupal\Core\Entity\EntityForm::form().
+   * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     /** @var \Drupal\node\NodeInterface $node */
     $node = $this->entity;
 
@@ -209,9 +210,9 @@ public function form(array $form, array &$form_state) {
   }
 
   /**
-   * Overrides Drupal\Core\Entity\EntityForm::actions().
+   * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $element = parent::actions($form, $form_state);
     $node = $this->entity;
     $preview_mode = $this->settings['preview'];
@@ -290,9 +291,9 @@ protected function actions(array $form, array &$form_state) {
   }
 
   /**
-   * Overrides Drupal\Core\Entity\EntityForm::validate().
+   * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     $node = $this->buildEntity($form, $form_state);
 
     if ($node->id() && (node_last_changed($node->id(), $this->getFormLangcode($form_state)) > $node->getChangedTime())) {
@@ -331,10 +332,8 @@ public function validate(array $form, array &$form_state) {
    * This function can be called by a "Next" button of a wizard to update the
    * form state's entity with the current step's values before proceeding to the
    * next step.
-   *
-   * Overrides Drupal\Core\Entity\EntityForm::submit().
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     // Build the node object from the submitted values.
     $node = parent::submit($form, $form_state);
 
@@ -366,7 +365,7 @@ public function submit(array $form, array &$form_state) {
    * @param $form_state
    *   A reference to a keyed array containing the current state of the form.
    */
-  public function preview(array $form, array &$form_state) {
+  public function preview(array $form, &$form_state) {
     // @todo Remove this: we should not have explicit includes in autoloaded
     //   classes.
     module_load_include('inc', 'node', 'node.pages');
@@ -382,7 +381,7 @@ public function preview(array $form, array &$form_state) {
    * @param $form_state
    *   A reference to a keyed array containing the current state of the form.
    */
-  public function publish(array $form, array &$form_state) {
+  public function publish(array $form, &$form_state) {
     $node = $this->entity;
     $node->setPublished(TRUE);
     return $node;
@@ -396,7 +395,7 @@ public function publish(array $form, array &$form_state) {
    * @param $form_state
    *   A reference to a keyed array containing the current state of the form.
    */
-  public function unpublish(array $form, array &$form_state) {
+  public function unpublish(array $form, &$form_state) {
     $node = $this->entity;
     $node->setPublished(FALSE);
     return $node;
@@ -405,7 +404,7 @@ public function unpublish(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function buildEntity(array $form, array &$form_state) {
+  public function buildEntity(array $form, FormStateInterface $form_state) {
     /** @var \Drupal\node\NodeInterface $entity */
     $entity = parent::buildEntity($form, $form_state);
     // A user might assign the node author by entering a user name in the node
@@ -426,11 +425,10 @@ public function buildEntity(array $form, array &$form_state) {
     return $entity;
   }
 
-
   /**
-   * Overrides Drupal\Core\Entity\EntityForm::save().
+   * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $node = $this->entity;
     $insert = $node->isNew();
     $node->save();
diff --git a/core/modules/node/src/NodeTranslationHandler.php b/core/modules/node/src/NodeTranslationHandler.php
index 21ab7e0..7dc2b0e 100644
--- a/core/modules/node/src/NodeTranslationHandler.php
+++ b/core/modules/node/src/NodeTranslationHandler.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\content_translation\ContentTranslationHandler;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Defines the translation handler for nodes.
@@ -18,7 +19,7 @@ class NodeTranslationHandler extends ContentTranslationHandler {
   /**
    * {@inheritdoc}
    */
-  public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) {
+  public function entityFormAlter(array &$form, FormStateInterface $form_state, EntityInterface $entity) {
     parent::entityFormAlter($form, $form_state, $entity);
 
     // Move the translation fieldset to a vertical tab.
@@ -73,7 +74,7 @@ protected function entityFormTitle(EntityInterface $entity) {
   /**
    * {@inheritdoc}
    */
-  public function entityFormEntityBuild($entity_type, EntityInterface $entity, array $form, array &$form_state) {
+  public function entityFormEntityBuild($entity_type, EntityInterface $entity, array $form, &$form_state) {
     if (isset($form_state['values']['content_translation'])) {
       $form_controller = content_translation_form_controller($form_state);
       $translation = &$form_state['values']['content_translation'];
diff --git a/core/modules/node/src/NodeTypeForm.php b/core/modules/node/src/NodeTypeForm.php
index ec00d50..f8cf927 100644
--- a/core/modules/node/src/NodeTypeForm.php
+++ b/core/modules/node/src/NodeTypeForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form controller for node type forms.
@@ -19,7 +20,7 @@ class NodeTypeForm extends EntityForm {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form = parent::form($form, $form_state);
 
     $type = $this->entity;
@@ -152,7 +153,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = t('Save content type');
     $actions['delete']['#value'] = t('Delete content type');
@@ -162,7 +163,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     parent::validate($form, $form_state);
 
     $id = trim($form_state['values']['type']);
@@ -175,7 +176,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $type = $this->entity;
     $type->type = trim($type->id());
     $type->name = trim($type->name);
diff --git a/core/modules/node/src/Plugin/Action/AssignOwnerNode.php b/core/modules/node/src/Plugin/Action/AssignOwnerNode.php
index 7823ccb..b2ead47 100644
--- a/core/modules/node/src/Plugin/Action/AssignOwnerNode.php
+++ b/core/modules/node/src/Plugin/Action/AssignOwnerNode.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Action\ConfigurableActionBase;
 use Drupal\Core\Database\Connection;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -77,7 +78,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $description = t('The username of the user to which you would like to assign ownership.');
     $count = $this->connection->query("SELECT COUNT(*) FROM {users}")->fetchField();
     $owner_name = '';
@@ -117,7 +118,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateConfigurationForm(array &$form, array &$form_state) {
+  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
     $exists = (bool) $this->connection->queryRange('SELECT 1 FROM {users} WHERE name = :name', 0, 1, array(':name' => $form_state['values']['owner_name']))->fetchField();
     if (!$exists) {
       form_set_error('owner_name', $form_state, t('Enter a valid username.'));
@@ -127,7 +128,7 @@ public function validateConfigurationForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['owner_uid'] = $this->connection->query('SELECT uid from {users} WHERE name = :name', array(':name' => $form_state['values']['owner_name']))->fetchField();
   }
 
diff --git a/core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php b/core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php
index 6fb4674..7dab8be 100644
--- a/core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php
+++ b/core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\Tags;
 use Drupal\Core\Action\ConfigurableActionBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Unpublishes a node containing certain keywords.
@@ -47,7 +48,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form['keywords'] = array(
       '#title' => t('Keywords'),
       '#type' => 'textarea',
@@ -60,7 +61,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['keywords'] = Tags::explode($form_state['values']['keywords']);
   }
 
diff --git a/core/modules/node/src/Plugin/Block/SyndicateBlock.php b/core/modules/node/src/Plugin/Block/SyndicateBlock.php
index ace314a..d0038fc 100644
--- a/core/modules/node/src/Plugin/Block/SyndicateBlock.php
+++ b/core/modules/node/src/Plugin/Block/SyndicateBlock.php
@@ -8,6 +8,7 @@
 namespace Drupal\node\Plugin\Block;
 
 use Drupal\block\BlockBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 
 /**
@@ -50,7 +51,7 @@ public function build() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form = parent::buildConfigurationForm($form, $form_state);
 
     // @see ::isCacheable()
diff --git a/core/modules/node/src/Plugin/Condition/NodeType.php b/core/modules/node/src/Plugin/Condition/NodeType.php
index 612d82d..9727bed 100644
--- a/core/modules/node/src/Plugin/Condition/NodeType.php
+++ b/core/modules/node/src/Plugin/Condition/NodeType.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Condition\ConditionPluginBase;
 use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -68,7 +69,7 @@ public static function create(ContainerInterface $container, array $configuratio
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $options = array();
     $node_types = $this->entityStorage->loadMultiple();
     foreach ($node_types as $type) {
@@ -86,7 +87,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['bundles'] = array_filter($form_state['values']['bundles']);
     parent::submitConfigurationForm($form, $form_state);
   }
diff --git a/core/modules/node/src/Plugin/Search/NodeSearch.php b/core/modules/node/src/Plugin/Search/NodeSearch.php
index 3409383..0a585f7 100644
--- a/core/modules/node/src/Plugin/Search/NodeSearch.php
+++ b/core/modules/node/src/Plugin/Search/NodeSearch.php
@@ -13,6 +13,7 @@
 use Drupal\Core\Database\Query\SelectExtender;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\State\StateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Session\AccountInterface;
@@ -395,7 +396,7 @@ public function indexStatus() {
   /**
    * {@inheritdoc}
    */
-  public function searchFormAlter(array &$form, array &$form_state) {
+  public function searchFormAlter(array &$form, FormStateInterface $form_state) {
     // Add advanced search keyword-related boxes.
     $form['advanced'] = array(
       '#type' => 'details',
@@ -557,7 +558,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     // Output form for defining rank factor weights.
     $form['content_ranking'] = array(
       '#type' => 'details',
@@ -586,7 +587,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     foreach ($this->getRankings() as $var => $values) {
       if (!empty($form_state['values']["rankings_$var"])) {
         $this->configuration['rankings'][$var] = $form_state['values']["rankings_$var"];
diff --git a/core/modules/node/src/Plugin/views/wizard/Node.php b/core/modules/node/src/Plugin/views/wizard/Node.php
index fc5aadb..bbcefba 100644
--- a/core/modules/node/src/Plugin/views/wizard/Node.php
+++ b/core/modules/node/src/Plugin/views/wizard/Node.php
@@ -86,12 +86,12 @@ protected function rowStyleOptions() {
    *
    * @param array $form
    *   The full wizard form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the wizard form.
    * @param string $type
    *   The display ID (e.g. 'page' or 'block').
    */
-  protected function buildFormStyle(array &$form, array &$form_state, $type) {
+  protected function buildFormStyle(array &$form, &$form_state, $type) {
     parent::buildFormStyle($form, $form_state, $type);
     $style_form =& $form['displays'][$type]['options']['style'];
     // Some style plugins don't support row plugins so stop here if that's the
@@ -156,7 +156,7 @@ protected function defaultDisplayOptions() {
   /**
    * Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayFiltersUser().
    */
-  protected function defaultDisplayFiltersUser(array $form, array &$form_state) {
+  protected function defaultDisplayFiltersUser(array $form, &$form_state) {
     $filters = parent::defaultDisplayFiltersUser($form, $form_state);
 
     if (!empty($form_state['values']['show']['tagged_with']['tids'])) {
@@ -183,7 +183,7 @@ protected function defaultDisplayFiltersUser(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function pageDisplayOptions(array $form, array &$form_state) {
+  protected function pageDisplayOptions(array $form, &$form_state) {
     $display_options = parent::pageDisplayOptions($form, $form_state);
     $row_plugin = isset($form_state['values']['page']['style']['row_plugin']) ? $form_state['values']['page']['style']['row_plugin'] : NULL;
     $row_options = isset($form_state['values']['page']['style']['row_options']) ? $form_state['values']['page']['style']['row_options'] : array();
@@ -194,7 +194,7 @@ protected function pageDisplayOptions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function blockDisplayOptions(array $form, array &$form_state) {
+  protected function blockDisplayOptions(array $form, &$form_state) {
     $display_options = parent::blockDisplayOptions($form, $form_state);
     $row_plugin = isset($form_state['values']['block']['style']['row_plugin']) ? $form_state['values']['block']['style']['row_plugin'] : NULL;
     $row_options = isset($form_state['values']['block']['style']['row_options']) ? $form_state['values']['block']['style']['row_options'] : array();
diff --git a/core/modules/options/src/Plugin/Field/FieldType/ListBooleanItem.php b/core/modules/options/src/Plugin/Field/FieldType/ListBooleanItem.php
index 5d16585..7ba5cf7 100644
--- a/core/modules/options/src/Plugin/Field/FieldType/ListBooleanItem.php
+++ b/core/modules/options/src/Plugin/Field/FieldType/ListBooleanItem.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\Core\Field\FieldItemBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\TypedData\AllowedValuesInterface;
 use Drupal\Core\TypedData\DataDefinition;
@@ -102,7 +103,7 @@ public function isEmpty() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array &$form, array &$form_state, $has_data) {
+  public function settingsForm(array &$form, FormStateInterface $form_state, $has_data) {
     $allowed_values = $this->getSetting('allowed_values');
     $allowed_values_function = $this->getSetting('allowed_values_function');
 
diff --git a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php
index d61aef1..937e8ae 100644
--- a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php
+++ b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\options\Plugin\Field\FieldType;
 
 use Drupal\Core\Field\FieldItemBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Form\OptGroup;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\TypedData\AllowedValuesInterface;
@@ -72,7 +73,7 @@ public function isEmpty() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array &$form, array &$form_state, $has_data) {
+  public function settingsForm(array &$form, FormStateInterface $form_state, $has_data) {
     $allowed_values = $this->getSetting('allowed_values');
     $allowed_values_function = $this->getSetting('allowed_values_function');
 
diff --git a/core/modules/options/src/Plugin/Field/FieldWidget/ButtonsWidget.php b/core/modules/options/src/Plugin/Field/FieldWidget/ButtonsWidget.php
index 9746b0f..6de8595 100644
--- a/core/modules/options/src/Plugin/Field/FieldWidget/ButtonsWidget.php
+++ b/core/modules/options/src/Plugin/Field/FieldWidget/ButtonsWidget.php
@@ -8,6 +8,7 @@
 namespace Drupal\options\Plugin\Field\FieldWidget;
 
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\options\Plugin\Field\FieldWidget\OptionsWidgetBase;
 
 /**
@@ -30,7 +31,7 @@ class ButtonsWidget extends OptionsWidgetBase {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $element = parent::formElement($items, $delta, $element, $form, $form_state);
 
     $options = $this->getOptions($items[$delta]);
diff --git a/core/modules/options/src/Plugin/Field/FieldWidget/OnOffWidget.php b/core/modules/options/src/Plugin/Field/FieldWidget/OnOffWidget.php
index 731f3b2..4e81862 100644
--- a/core/modules/options/src/Plugin/Field/FieldWidget/OnOffWidget.php
+++ b/core/modules/options/src/Plugin/Field/FieldWidget/OnOffWidget.php
@@ -8,6 +8,7 @@
 namespace Drupal\options\Plugin\Field\FieldWidget;
 
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\options\Plugin\Field\FieldWidget\OptionsWidgetBase;
 
 /**
@@ -36,7 +37,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['display_label'] = array(
       '#type' => 'checkbox',
       '#title' => t('Use field label instead of the "On value" as label'),
@@ -61,7 +62,7 @@ public function settingsSummary() {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $element = parent::formElement($items, $delta, $element, $form, $form_state);
 
     $options = $this->getOptions($items[$delta]);
diff --git a/core/modules/options/src/Plugin/Field/FieldWidget/OptionsWidgetBase.php b/core/modules/options/src/Plugin/Field/FieldWidget/OptionsWidgetBase.php
index 01e7688..8232d8e 100644
--- a/core/modules/options/src/Plugin/Field/FieldWidget/OptionsWidgetBase.php
+++ b/core/modules/options/src/Plugin/Field/FieldWidget/OptionsWidgetBase.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FieldItemInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Base class for the 'options_*' widgets.
@@ -54,7 +55,7 @@ public function __construct($plugin_id, $plugin_definition, FieldDefinitionInter
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     // Prepare some properties for the child methods to build the actual form
     // element.
     $this->required = $element['#required'];
@@ -75,10 +76,10 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
    *
    * @param array $element
    *   The form element.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state.
    */
-  public static function validateElement(array $element, array &$form_state) {
+  public static function validateElement(array $element, &$form_state) {
     if ($element['#required'] && $element['#value'] == '_none') {
       \Drupal::formBuilder()->setError($element, $form_state, t('!name field is required.', array('!name' => $element['#title'])));
     }
diff --git a/core/modules/options/src/Plugin/Field/FieldWidget/SelectWidget.php b/core/modules/options/src/Plugin/Field/FieldWidget/SelectWidget.php
index 6d37440..093e06c 100644
--- a/core/modules/options/src/Plugin/Field/FieldWidget/SelectWidget.php
+++ b/core/modules/options/src/Plugin/Field/FieldWidget/SelectWidget.php
@@ -8,6 +8,7 @@
 namespace Drupal\options\Plugin\Field\FieldWidget;
 
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\options\Plugin\Field\FieldWidget\OptionsWidgetBase;
 
 /**
@@ -29,7 +30,7 @@ class SelectWidget extends OptionsWidgetBase {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $element = parent::formElement($items, $delta, $element, $form, $form_state);
 
     $element += array(
diff --git a/core/modules/path/src/Form/DeleteForm.php b/core/modules/path/src/Form/DeleteForm.php
index e7b3307..ece964c 100644
--- a/core/modules/path/src/Form/DeleteForm.php
+++ b/core/modules/path/src/Form/DeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\path\Form;
 
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Path\AliasStorageInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -70,9 +71,9 @@ public function getCancelRoute() {
   }
 
   /**
-   * Overrides \Drupal\Core\Form\ConfirmFormBase::buildForm().
+   * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $pid = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $pid = NULL) {
     $this->pathAlias = $this->aliasStorage->load(array('pid' => $pid));
 
     $form = parent::buildForm($form, $form_state);
@@ -83,9 +84,9 @@ public function buildForm(array $form, array &$form_state, $pid = NULL) {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::submitForm().
+   * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->aliasStorage->delete(array('pid' => $this->pathAlias['pid']));
 
     $form_state['redirect'] = 'admin/config/search/path';
diff --git a/core/modules/path/src/Form/EditForm.php b/core/modules/path/src/Form/EditForm.php
index 0c1a7ab..bc7c4a9 100644
--- a/core/modules/path/src/Form/EditForm.php
+++ b/core/modules/path/src/Form/EditForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\path\Form;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -32,7 +33,7 @@ protected function buildPath($pid) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $pid = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $pid = NULL) {
     $form = parent::buildForm($form, $form_state, $pid);
 
     $form['#title'] = String::checkPlain($this->path['alias']);
@@ -51,7 +52,7 @@ public function buildForm(array $form, array &$form_state, $pid = NULL) {
   /**
    * Submits the delete form.
    */
-  public function deleteSubmit(array &$form, array &$form_state) {
+  public function deleteSubmit(array &$form, &$form_state) {
     $form_state['redirect_route'] = new Url('path.delete', array(
       'pid' => $form_state['values']['pid'],
     ));
diff --git a/core/modules/path/src/Form/PathFilterForm.php b/core/modules/path/src/Form/PathFilterForm.php
index ce66c70..6e28e24 100644
--- a/core/modules/path/src/Form/PathFilterForm.php
+++ b/core/modules/path/src/Form/PathFilterForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\path\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $keys = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $keys = NULL) {
     $form['#attributes'] = array('class' => array('search-form'));
     $form['basic'] = array(
       '#type' => 'details',
@@ -59,7 +60,7 @@ public function buildForm(array $form, array &$form_state, $keys = NULL) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['redirect_route'] = new Url('path.admin_overview_filter', array(
       'keys' => trim($form_state['values']['filter']),
     ));
@@ -68,7 +69,7 @@ public function submitForm(array &$form, array &$form_state) {
   /**
    * Resets the filter selections.
    */
-  public function resetForm(array &$form, array &$form_state) {
+  public function resetForm(array &$form, &$form_state) {
     $form_state['redirect_route'] = new Url('path.admin_overview');
   }
 
diff --git a/core/modules/path/src/Form/PathFormBase.php b/core/modules/path/src/Form/PathFormBase.php
index a9e80c4..f4d7ffd 100644
--- a/core/modules/path/src/Form/PathFormBase.php
+++ b/core/modules/path/src/Form/PathFormBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\path\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Path\AliasManagerInterface;
 use Drupal\Core\Path\AliasStorageInterface;
@@ -74,7 +75,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $pid = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $pid = NULL) {
     $this->path = $this->buildPath($pid);
     $form['source'] = array(
       '#type' => 'textfield',
@@ -135,7 +136,7 @@ public function buildForm(array $form, array &$form_state, $pid = NULL) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $source = &$form_state['values']['source'];
     $source = $this->aliasManager->getPathByAlias($source);
     $alias = $form_state['values']['alias'];
@@ -154,7 +155,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Remove unnecessary values.
     form_state_values_clean($form_state);
 
diff --git a/core/modules/path/src/Plugin/Field/FieldWidget/PathWidget.php b/core/modules/path/src/Plugin/Field/FieldWidget/PathWidget.php
index d090022..27955c8 100644
--- a/core/modules/path/src/Plugin/Field/FieldWidget/PathWidget.php
+++ b/core/modules/path/src/Plugin/Field/FieldWidget/PathWidget.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Symfony\Component\Validator\ConstraintViolationInterface;
 
@@ -28,7 +29,7 @@ class PathWidget extends WidgetBase {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $entity = $items->getEntity();
     $path = array();
     if (!$entity->isNew()) {
@@ -79,10 +80,10 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
    *
    * @param array $element
    *   The form element.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state.
    */
-  public static function validateFormElement(array &$element, array &$form_state) {
+  public static function validateFormElement(array &$element, &$form_state) {
     // Trim the submitted value.
     $alias = trim($element['alias']['#value']);
     if (!empty($alias)) {
@@ -100,7 +101,7 @@ public static function validateFormElement(array &$element, array &$form_state)
   /**
    * {@inheritdoc}
    */
-  public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, array &$form_state) {
+  public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state) {
     return $element['alias'];
   }
 
diff --git a/core/modules/quickedit/src/Form/QuickEditFieldForm.php b/core/modules/quickedit/src/Form/QuickEditFieldForm.php
index 38b82a5..dd199e2 100644
--- a/core/modules/quickedit/src/Form/QuickEditFieldForm.php
+++ b/core/modules/quickedit/src/Form/QuickEditFieldForm.php
@@ -13,6 +13,7 @@
 use Drupal\Core\Entity\EntityChangedInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\entity\Entity\EntityFormDisplay;
 use Drupal\user\TempStoreFactory;
@@ -83,7 +84,7 @@ public function getFormId() {
    *
    * Builds a form for a single entity field.
    */
-  public function buildForm(array $form, array &$form_state, EntityInterface $entity = NULL, $field_name = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, EntityInterface $entity = NULL, $field_name = NULL) {
     if (!isset($form_state['entity'])) {
       $this->init($form_state, $entity, $field_name);
     }
@@ -116,7 +117,7 @@ public function buildForm(array $form, array &$form_state, EntityInterface $enti
   /**
    * Initialize the form state and the entity before the first form build.
    */
-  protected function init(array &$form_state, EntityInterface $entity, $field_name) {
+  protected function init(&$form_state, EntityInterface $entity, $field_name) {
     // @todo Rather than special-casing $node->revision, invoke prepareEdit()
     //   once http://drupal.org/node/1863258 lands.
     if ($entity->getEntityTypeId() == 'node') {
@@ -143,7 +144,7 @@ protected function init(array &$form_state, EntityInterface $entity, $field_name
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $entity = $this->buildEntity($form, $form_state);
 
     $form_state['form_display']->validateFormValues($entity, $form, $form_state);
@@ -164,7 +165,7 @@ public function validateForm(array &$form, array &$form_state) {
    *
    * Saves the entity with updated values for the edited field.
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['entity'] = $this->buildEntity($form, $form_state);
 
     // Store entity in tempstore with its UUID as tempstore key.
@@ -177,7 +178,7 @@ public function submitForm(array &$form, array &$form_state) {
    * Calling code may then validate the returned entity, and if valid, transfer
    * it back to the form state and save it.
    */
-  protected function buildEntity(array $form, array &$form_state) {
+  protected function buildEntity(array $form, &$form_state) {
     /** @var $entity \Drupal\Core\Entity\EntityInterface */
     $entity = clone $form_state['entity'];
     $field_name = $form_state['field_name'];
@@ -203,10 +204,10 @@ protected function buildEntity(array $form, array &$form_state) {
    *
    * @param array &$form
    *   A reference to an associative array containing the structure of the form.
-   * @param array &$form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A reference to a keyed array containing the current state of the form.
    */
-  protected function simplify(array &$form, array &$form_state) {
+  protected function simplify(array &$form, &$form_state) {
     $field_name = $form_state['field_name'];
     $widget_element =& $form[$field_name]['widget'];
 
diff --git a/core/modules/quickedit/src/QuickEditController.php b/core/modules/quickedit/src/QuickEditController.php
index 2c1c093..ad1751d 100644
--- a/core/modules/quickedit/src/QuickEditController.php
+++ b/core/modules/quickedit/src/QuickEditController.php
@@ -8,6 +8,7 @@
 namespace Drupal\quickedit;
 
 use Drupal\Core\Controller\ControllerBase;
+use Drupal\Core\Form\FormState;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\Request;
@@ -177,13 +178,13 @@ public function fieldForm(EntityInterface $entity, $field_name, $langcode, $view
       $this->tempStoreFactory->get('quickedit')->set($entity->uuid(), $entity);
     }
 
-    $form_state = array(
+    $form_state = new FormState(array(
       'langcode' => $langcode,
       'no_redirect' => TRUE,
       'build_info' => array(
         'args' => array($entity, $field_name),
       ),
-    );
+    ));
     $form = $this->formBuilder()->buildForm('Drupal\quickedit\Form\QuickEditFieldForm', $form_state);
 
     if (!empty($form_state['executed'])) {
diff --git a/core/modules/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php b/core/modules/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php
index af270cb..b3df9d4 100644
--- a/core/modules/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php
+++ b/core/modules/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\responsive_image\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 class ResponsiveImageMappingDeleteForm extends EntityConfirmFormBase {
@@ -36,7 +37,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     drupal_set_message($this->t('Responsive image mapping %label has been deleted.', array('%label' => $this->entity->label())));
     watchdog('responsive_image', 'Responsive image mapping %label has been deleted.', array('%label' => $this->entity->label()), WATCHDOG_NOTICE);
diff --git a/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php b/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php
index ad4723f..24a80d4 100644
--- a/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php
+++ b/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\image\Plugin\Field\FieldFormatter\ImageFormatterBase;
 
 /**
@@ -38,7 +39,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $responsive_image_options = array();
     $responsive_image_mappings = entity_load_multiple('responsive_image_mapping');
     if ($responsive_image_mappings && !empty($responsive_image_mappings)) {
diff --git a/core/modules/responsive_image/src/ResponsiveImageMappingForm.php b/core/modules/responsive_image/src/ResponsiveImageMappingForm.php
index 57779fd..7a38d12 100644
--- a/core/modules/responsive_image/src/ResponsiveImageMappingForm.php
+++ b/core/modules/responsive_image/src/ResponsiveImageMappingForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityForm;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form controller for the responsive image edit/add forms.
@@ -20,15 +21,15 @@ class ResponsiveImageMappingForm extends EntityForm {
    *
    * @param array $form
    *   A nested array form elements comprising the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    * @param \Drupal\responsive_image\ResponsiveImageMappingInterface $responsive_image_mapping
    *   The entity being edited.
    *
    * @return array
    *   The array containing the complete form.
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     if ($this->operation == 'duplicate') {
       $form['#title'] = $this->t('<em>Duplicate responsive image mapping</em> @label', array('@label' => $this->entity->label()));
       $this->entity = $this->entity->createDuplicate();
@@ -96,7 +97,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     /** @var \Drupal\responsive_image\ResponsiveImageMappingInterface $responsive_image_mapping */
     $responsive_image_mapping = $this->entity;
 
@@ -119,7 +120,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * Overrides Drupal\Core\Entity\EntityForm::save().
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     /** @var \Drupal\responsive_image\ResponsiveImageMappingInterface $responsive_image_mapping */
     $responsive_image_mapping = $this->entity;
     $responsive_image_mapping->save();
diff --git a/core/modules/search/src/Form/ReindexConfirm.php b/core/modules/search/src/Form/ReindexConfirm.php
index 33d3b89..3a721ab 100644
--- a/core/modules/search/src/Form/ReindexConfirm.php
+++ b/core/modules/search/src/Form/ReindexConfirm.php
@@ -8,6 +8,7 @@
 namespace Drupal\search\Form;
 
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -58,9 +59,9 @@ public function getCancelRoute() {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::submitForm().
+   * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     if ($form['confirm']) {
       search_reindex();
       drupal_set_message($this->t('The index will be rebuilt.'));
diff --git a/core/modules/search/src/Form/SearchBlockForm.php b/core/modules/search/src/Form/SearchBlockForm.php
index dafe312..e154863 100644
--- a/core/modules/search/src/Form/SearchBlockForm.php
+++ b/core/modules/search/src/Form/SearchBlockForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\search\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\search\SearchPageRepositoryInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -52,7 +53,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // Set up the form to submit using GET to the correct search page.
     $entity_id = $this->searchPageRepository->getDefaultSearchPage();
     if (!$entity_id) {
@@ -90,7 +91,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // This form submits to the search page, so processing happens there.
   }
 }
diff --git a/core/modules/search/src/Form/SearchPageAddForm.php b/core/modules/search/src/Form/SearchPageAddForm.php
index c8f3f68..0550f74 100644
--- a/core/modules/search/src/Form/SearchPageAddForm.php
+++ b/core/modules/search/src/Form/SearchPageAddForm.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\search\Form;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Provides a form for adding a search page.
  */
@@ -15,7 +17,7 @@ class SearchPageAddForm extends SearchPageFormBase {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $search_plugin_id = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $search_plugin_id = NULL) {
     $this->entity->setPlugin($search_plugin_id);
     $definition = $this->entity->getPlugin()->getPluginDefinition();
     $this->entity->set('label', $definition['title']);
@@ -25,7 +27,7 @@ public function buildForm(array $form, array &$form_state, $search_plugin_id = N
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->t('Add search page');
     return $actions;
@@ -34,7 +36,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     // If there is no default search page, make the added search the default.
     if (!$this->searchPageRepository->getDefaultSearchPage()) {
       $this->searchPageRepository->setDefaultSearchPage($this->entity);
diff --git a/core/modules/search/src/Form/SearchPageDeleteForm.php b/core/modules/search/src/Form/SearchPageDeleteForm.php
index e66ecb8..f75bdcb 100644
--- a/core/modules/search/src/Form/SearchPageDeleteForm.php
+++ b/core/modules/search/src/Form/SearchPageDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\search\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -39,7 +40,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     $form_state['redirect_route'] = $this->getCancelRoute();
     drupal_set_message($this->t('The %label search page has been deleted.', array('%label' => $this->entity->label())));
diff --git a/core/modules/search/src/Form/SearchPageEditForm.php b/core/modules/search/src/Form/SearchPageEditForm.php
index dc3de86..7ff9260 100644
--- a/core/modules/search/src/Form/SearchPageEditForm.php
+++ b/core/modules/search/src/Form/SearchPageEditForm.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\search\Form;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Provides a form for editing a search page.
  */
@@ -15,7 +17,7 @@ class SearchPageEditForm extends SearchPageFormBase {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->t('Save search page');
     return $actions;
@@ -24,7 +26,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     parent::save($form, $form_state);
 
     drupal_set_message($this->t('The %label search page has been updated.', array('%label' => $this->entity->label())));
diff --git a/core/modules/search/src/Form/SearchPageForm.php b/core/modules/search/src/Form/SearchPageForm.php
index 1dac382..8e585db 100644
--- a/core/modules/search/src/Form/SearchPageForm.php
+++ b/core/modules/search/src/Form/SearchPageForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\search\Form;
 
 use Drupal\Core\Entity\EntityForm;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides a search form for site wide search.
@@ -37,7 +38,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $plugin = $this->entity->getPlugin();
     $form_state['search_page_id'] = $this->entity->id();
 
@@ -74,7 +75,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     // The submit button is added in the form directly.
     return array();
   }
@@ -82,7 +83,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Redirect to the search page with keywords in the GET parameters.
     // Plugins with additional search parameters will need to provide their
     // own form submit handler to replace this, so they can put their values
diff --git a/core/modules/search/src/Form/SearchPageFormBase.php b/core/modules/search/src/Form/SearchPageFormBase.php
index 45e5cd4..97cd2fc 100644
--- a/core/modules/search/src/Form/SearchPageFormBase.php
+++ b/core/modules/search/src/Form/SearchPageFormBase.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\Query\QueryFactory;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\PluginFormInterface;
 use Drupal\search\SearchPageRepositoryInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -79,7 +80,7 @@ public function getBaseFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $this->plugin = $this->entity->getPlugin();
     return parent::buildForm($form, $form_state);
   }
@@ -87,7 +88,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form['label'] = array(
       '#type' => 'textfield',
       '#title' => $this->t('Label'),
@@ -143,7 +144,7 @@ public function exists($id) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     parent::validate($form, $form_state);
 
     // Ensure each path is unique.
@@ -163,7 +164,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     parent::submit($form, $form_state);
 
     if ($this->plugin instanceof PluginFormInterface) {
@@ -175,7 +176,7 @@ public function submit(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $this->entity->save();
 
     $form_state['redirect_route']['route_name'] = 'search.settings';
diff --git a/core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php b/core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php
index 8dcc9a4..d5de0c4 100644
--- a/core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php
+++ b/core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\search\Plugin;
 
 use Drupal\Component\Utility\NestedArray;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides a base implementation for a configurable Search plugin.
@@ -54,7 +55,7 @@ public function setConfiguration(array $configuration) {
   /**
    * {@inheritdoc}
    */
-  public function validateConfigurationForm(array &$form, array &$form_state) {
+  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
   }
 
   /**
diff --git a/core/modules/search/src/Plugin/SearchInterface.php b/core/modules/search/src/Plugin/SearchInterface.php
index 144c0ab..82ddd64 100644
--- a/core/modules/search/src/Plugin/SearchInterface.php
+++ b/core/modules/search/src/Plugin/SearchInterface.php
@@ -8,6 +8,7 @@
 namespace Drupal\search\Plugin;
 
 use Drupal\Component\Plugin\PluginInspectionInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Defines a common interface for all SearchPlugin objects.
@@ -91,14 +92,14 @@ public function buildResults();
    *
    * @param array $form
    *   Nested array of form elements that comprise the form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A keyed array containing the current state of the form. The arguments
    *   that \Drupal::formBuilder()->getForm() was originally called with are
    *   available in the array $form_state['build_info']['args'].
    *
    * @see SearchInterface::buildSearchUrlQuery()
    */
-  public function searchFormAlter(array &$form, array &$form_state);
+  public function searchFormAlter(array &$form, FormStateInterface $form_state);
 
   /**
    * Builds the URL GET query parameters array for search.
@@ -108,7 +109,7 @@ public function searchFormAlter(array &$form, array &$form_state);
    * method to add form elements to the search form will need to override this
    * method to gather the form input and add it to the GET query parameters.
    *
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state, with submitted form information.
    *
    * @return array
diff --git a/core/modules/search/src/Plugin/SearchPluginBase.php b/core/modules/search/src/Plugin/SearchPluginBase.php
index e13a307..9a553cc 100644
--- a/core/modules/search/src/Plugin/SearchPluginBase.php
+++ b/core/modules/search/src/Plugin/SearchPluginBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\search\Plugin;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\PluginBase;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -104,7 +105,7 @@ public function buildResults() {
   /**
    * {@inheritdoc}
    */
-  public function searchFormAlter(array &$form, array &$form_state) {
+  public function searchFormAlter(array &$form, FormStateInterface $form_state) {
     // Empty default implementation.
   }
 
diff --git a/core/modules/search/src/SearchPageListBuilder.php b/core/modules/search/src/SearchPageListBuilder.php
index 701a605..434d125 100644
--- a/core/modules/search/src/SearchPageListBuilder.php
+++ b/core/modules/search/src/SearchPageListBuilder.php
@@ -13,6 +13,7 @@
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Form\FormInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -152,7 +153,7 @@ public function buildRow(EntityInterface $entity) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form = parent::buildForm($form, $form_state);
     $old_state = $this->configFactory->getOverrideState();
     $search_settings = $this->configFactory->setOverrideState(FALSE)->get('search.settings');
@@ -300,13 +301,13 @@ public function getDefaultOperations(EntityInterface $entity) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     parent::submitForm($form, $form_state);
 
     $search_settings = $this->configFactory->get('search.settings');
@@ -329,7 +330,7 @@ public function submitForm(array &$form, array &$form_state) {
    * Form submission handler for the reindex button on the search admin settings
    * form.
    */
-  public function searchAdminReindexSubmit(array &$form, array &$form_state) {
+  public function searchAdminReindexSubmit(array &$form, &$form_state) {
     // Send the user to the confirmation page.
     $form_state['redirect_route']['route_name'] = 'search.reindex_confirm';
   }
@@ -337,7 +338,7 @@ public function searchAdminReindexSubmit(array &$form, array &$form_state) {
   /**
    * Form validation handler for adding a new search page.
    */
-  public function validateAddSearchPage(array &$form, array &$form_state) {
+  public function validateAddSearchPage(array &$form, &$form_state) {
     if (empty($form_state['values']['search_type'])) {
       $this->formBuilder()->setErrorByName('search_type', $form_state, $this->t('You must select the new search page type.'));
     }
@@ -346,7 +347,7 @@ public function validateAddSearchPage(array &$form, array &$form_state) {
   /**
    * Form submission handler for adding a new search page.
    */
-  public function submitAddSearchPage(array &$form, array &$form_state) {
+  public function submitAddSearchPage(array &$form, &$form_state) {
     $form_state['redirect_route'] = array(
       'route_name' => 'search.add_type',
       'route_parameters' => array(
diff --git a/core/modules/search/tests/modules/search_embedded_form/src/Form/SearchEmbeddedForm.php b/core/modules/search/tests/modules/search_embedded_form/src/Form/SearchEmbeddedForm.php
index d0d690d..3bb04e0 100644
--- a/core/modules/search/tests/modules/search_embedded_form/src/Form/SearchEmbeddedForm.php
+++ b/core/modules/search/tests/modules/search_embedded_form/src/Form/SearchEmbeddedForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\search_embedded_form\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form controller for search_embedded_form form.
@@ -24,7 +25,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $count = \Drupal::state()->get('search_embedded_form.submit_count');
 
     $form['name'] = array(
@@ -48,7 +49,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $state = \Drupal::state();
     $submit_count = (int) $state->get('search_embedded_form.submit_count');
     $state->set('search_embedded_form.submit_count', $submit_count + 1);
diff --git a/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php b/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php
index 5caea64..44ecf77 100644
--- a/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php
+++ b/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\search_extra_type\Plugin\Search;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\search\Plugin\ConfigurableSearchPluginBase;
 
 /**
@@ -88,7 +89,7 @@ public function buildResults() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     // Output form for defining rank factor weights.
     $form['extra_type_settings'] = array(
       '#type' => 'fieldset',
@@ -111,7 +112,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['boost'] = $form_state['values']['extra_type_settings']['boost'];
   }
 
diff --git a/core/modules/shortcut/src/Form/SetCustomize.php b/core/modules/shortcut/src/Form/SetCustomize.php
index a306f50..d6afd90 100644
--- a/core/modules/shortcut/src/Form/SetCustomize.php
+++ b/core/modules/shortcut/src/Form/SetCustomize.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -27,7 +28,7 @@ class SetCustomize extends EntityForm {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form = parent::form($form, $form_state);
     $form['shortcuts'] = array(
       '#tree' => TRUE,
@@ -82,7 +83,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     // Only includes a Save action for the entity, no direct Delete button.
     return array(
       'submit' => array(
@@ -99,7 +100,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     foreach ($this->entity->getShortcuts() as $shortcut) {
       $shortcut->setWeight($form_state['values']['shortcuts']['links'][$shortcut->id()]['weight']);
       $shortcut->save();
diff --git a/core/modules/shortcut/src/Form/ShortcutDeleteForm.php b/core/modules/shortcut/src/Form/ShortcutDeleteForm.php
index 8802da7..96701ef 100644
--- a/core/modules/shortcut/src/Form/ShortcutDeleteForm.php
+++ b/core/modules/shortcut/src/Form/ShortcutDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\shortcut\Form;
 
 use Drupal\Core\Entity\ContentEntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -48,7 +49,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     $form_state['redirect_route'] = $this->getCancelRoute();
     drupal_set_message($this->t('The shortcut %title has been deleted.', array('%title' => $this->entity->title->value)));
diff --git a/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php b/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php
index e1b8c9f..3506eac 100644
--- a/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php
+++ b/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\shortcut\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Drupal\shortcut\ShortcutSetStorageInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -74,7 +75,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // Find out how many users are directly assigned to this shortcut set, and
     // make a message.
     $number = $this->storage->countAssignedUsers($this->entity);
@@ -101,7 +102,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     $form_state['redirect_route'] = new Url('shortcut.set_admin');
     drupal_set_message(t('The shortcut set %title has been deleted.', array('%title' => $this->entity->label())));
diff --git a/core/modules/shortcut/src/Form/SwitchShortcutSet.php b/core/modules/shortcut/src/Form/SwitchShortcutSet.php
index ec3180c..a66a890 100644
--- a/core/modules/shortcut/src/Form/SwitchShortcutSet.php
+++ b/core/modules/shortcut/src/Form/SwitchShortcutSet.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Core\Access\AccessInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\shortcut\Entity\ShortcutSet;
 use Drupal\shortcut\ShortcutSetStorageInterface;
@@ -75,7 +76,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, UserInterface $user = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, UserInterface $user = NULL) {
     $account = $this->currentUser();
 
     $this->user = $user;
@@ -169,7 +170,7 @@ public function exists($id) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     if ($form_state['values']['set'] == 'new') {
       // Check to prevent creating a shortcut set with an empty title.
       if (trim($form_state['values']['label']) == '') {
@@ -185,7 +186,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $account = $this->currentUser();
 
     $account_is_user = $this->user->id() == $account->id();
diff --git a/core/modules/shortcut/src/ShortcutForm.php b/core/modules/shortcut/src/ShortcutForm.php
index 33c169a..e36fd79 100644
--- a/core/modules/shortcut/src/ShortcutForm.php
+++ b/core/modules/shortcut/src/ShortcutForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\shortcut;
 
 use Drupal\Core\Entity\ContentEntityForm;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 
 /**
@@ -25,7 +26,7 @@ class ShortcutForm extends ContentEntityForm {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form = parent::form($form, $form_state);
 
     $form['path'] = array(
@@ -50,7 +51,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function buildEntity(array $form, array &$form_state) {
+  public function buildEntity(array $form, FormStateInterface $form_state) {
     $entity = parent::buildEntity($form, $form_state);
 
     // Set the computed 'path' value so it can used in the preSave() method to
@@ -63,7 +64,7 @@ public function buildEntity(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     if (!shortcut_valid_link($form_state['values']['path'])) {
       $this->setFormError('path', $form_state, $this->t('The shortcut must correspond to a valid path on the site.'));
     }
@@ -74,7 +75,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $entity = $this->entity;
     $entity->save();
 
diff --git a/core/modules/shortcut/src/ShortcutSetForm.php b/core/modules/shortcut/src/ShortcutSetForm.php
index 2b50ed2..be48569 100644
--- a/core/modules/shortcut/src/ShortcutSetForm.php
+++ b/core/modules/shortcut/src/ShortcutSetForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\shortcut;
 
 use Drupal\Core\Entity\EntityForm;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form controller for the shortcut set entity edit forms.
@@ -17,7 +18,7 @@ class ShortcutSetForm extends EntityForm {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form = parent::form($form, $form_state);
 
     $entity = $this->entity;
@@ -50,7 +51,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     parent::validate($form, $form_state);
     $entity = $this->entity;
     // Check to prevent a duplicate title.
@@ -62,7 +63,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $entity = $this->entity;
     $is_new = !$entity->getOriginalId();
     $entity->save();
diff --git a/core/modules/simpletest/src/Form/SimpletestResultsForm.php b/core/modules/simpletest/src/Form/SimpletestResultsForm.php
index 3889ee1..0476a6e 100644
--- a/core/modules/simpletest/src/Form/SimpletestResultsForm.php
+++ b/core/modules/simpletest/src/Form/SimpletestResultsForm.php
@@ -9,6 +9,8 @@
 
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormState;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\simpletest\TestDiscovery;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\RedirectResponse;
@@ -102,7 +104,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $test_id = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $test_id = NULL) {
     $this->buildStatusImageMap();
     // Make sure there are test results to display and a re-run is not being
     // performed.
@@ -247,7 +249,7 @@ public function buildForm(array $form, array &$form_state, $test_id = NULL) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $pass = $form_state['values']['filter_pass'] ? explode(',', $form_state['values']['filter_pass']) : array();
     $fail = $form_state['values']['filter_fail'] ? explode(',', $form_state['values']['filter_fail']) : array();
 
@@ -267,7 +269,7 @@ public function submitForm(array &$form, array &$form_state) {
     }
 
     $form_execute = array();
-    $form_state_execute = array('values' => array());
+    $form_state_execute = new FormState(array('values' => array()));
     foreach ($classes as $class) {
       $form_state_execute['values']['tests'][$class] = $class;
     }
diff --git a/core/modules/simpletest/src/Form/SimpletestSettingsForm.php b/core/modules/simpletest/src/Form/SimpletestSettingsForm.php
index 563b05d..2b1e71d 100644
--- a/core/modules/simpletest/src/Form/SimpletestSettingsForm.php
+++ b/core/modules/simpletest/src/Form/SimpletestSettingsForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\simpletest\Form;
 
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Configure simpletest settings for this site.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('simpletest.settings');
     $form['general'] = array(
       '#type' => 'details',
@@ -86,7 +87,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $config = $this->config('simpletest.settings');
     // If a username was provided but a password wasn't, preserve the existing
     // password.
@@ -106,7 +107,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('simpletest.settings')
       ->set('clear_results', $form_state['values']['simpletest_clear_results'])
       ->set('verbose', $form_state['values']['simpletest_verbose'])
diff --git a/core/modules/simpletest/src/Form/SimpletestTestForm.php b/core/modules/simpletest/src/Form/SimpletestTestForm.php
index ab9b55e..bb56b69 100644
--- a/core/modules/simpletest/src/Form/SimpletestTestForm.php
+++ b/core/modules/simpletest/src/Form/SimpletestTestForm.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\SortArray;
 use Drupal\Component\Utility\String;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * List tests arranged in groups that can be selected and run.
@@ -26,7 +27,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['actions'] = array('#type' => 'actions');
     $form['actions']['submit'] = array(
       '#type' => 'submit',
@@ -183,7 +184,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Test discovery does not run upon form submission.
     simpletest_classloader_register();
 
diff --git a/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php b/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php
index 3bdacac..62745b7 100644
--- a/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php
+++ b/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php
@@ -8,6 +8,7 @@
 namespace Drupal\statistics\Plugin\Block;
 
 use Drupal\block\BlockBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 
 /**
@@ -75,9 +76,9 @@ protected function blockAccess(AccountInterface $account) {
   }
 
   /**
-   * Overrides \Drupal\block\BlockBase::blockForm().
+   * {@inheritdoc}
    */
-  public function blockForm($form, &$form_state) {
+  public function blockForm($form, FormStateInterface $form_state) {
     // Popular content block settings.
     $numbers = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 40);
     $numbers = array('0' => t('Disabled')) + array_combine($numbers, $numbers);
@@ -106,9 +107,9 @@ public function blockForm($form, &$form_state) {
   }
 
   /**
-   * Overrides \Drupal\block\BlockBase::blockSubmit().
+   * {@inheritdoc}
    */
-  public function blockSubmit($form, &$form_state) {
+  public function blockSubmit($form, FormStateInterface $form_state) {
     $this->configuration['top_day_num'] = $form_state['values']['statistics_block_top_day_num'];
     $this->configuration['top_all_num'] = $form_state['values']['statistics_block_top_all_num'];
     $this->configuration['top_last_num'] = $form_state['values']['statistics_block_top_last_num'];
diff --git a/core/modules/statistics/src/StatisticsSettingsForm.php b/core/modules/statistics/src/StatisticsSettingsForm.php
index c002590..cac15a1 100644
--- a/core/modules/statistics/src/StatisticsSettingsForm.php
+++ b/core/modules/statistics/src/StatisticsSettingsForm.php
@@ -9,6 +9,7 @@
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -55,9 +56,9 @@ public function getFormId() {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::buildForm().
+   * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('statistics.settings');
 
     // Content counter settings.
@@ -77,9 +78,9 @@ public function buildForm(array $form, array &$form_state) {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::submitForm().
+   * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('statistics.settings')
       ->set('count_content_views', $form_state['values']['statistics_count_content_views'])
       ->save();
diff --git a/core/modules/system/entity.api.php b/core/modules/system/entity.api.php
index 5388dab..54fd3a1 100644
--- a/core/modules/system/entity.api.php
+++ b/core/modules/system/entity.api.php
@@ -1241,15 +1241,15 @@ function hook_entity_display_build_alter(&$build, $context) {
  *   The entity that is about to be shown on the form.
  * @param $operation
  *   The current operation.
- * @param array $form_state
- *   An associative array containing the current state of the form.
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
+ *   The current state of the form.
  *
  * @see \Drupal\Core\Entity\EntityForm::prepareEntity()
  * @see hook_ENTITY_TYPE_prepare_form()
  *
  * @ingroup entity_crud
  */
-function hook_entity_prepare_form(\Drupal\Core\Entity\EntityInterface $entity, $operation, array &$form_state) {
+function hook_entity_prepare_form(\Drupal\Core\Entity\EntityInterface $entity, $operation, &$form_state) {
   if ($operation == 'edit') {
     $entity->label->value = 'Altered label';
     $form_state['mymodule']['label_altered'] = TRUE;
@@ -1267,15 +1267,15 @@ function hook_entity_prepare_form(\Drupal\Core\Entity\EntityInterface $entity, $
  *   The entity that is about to be shown on the form.
  * @param $operation
  *   The current operation.
- * @param array $form_state
- *   An associative array containing the current state of the form.
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
+ *   The current state of the form.
  *
  * @see \Drupal\Core\Entity\EntityForm::prepareEntity()
  * @see hook_entity_prepare_form()
  *
  * @ingroup entity_crud
  */
-function hook_ENTITY_TYPE_prepare_form(\Drupal\Core\Entity\EntityInterface $entity, $operation, array &$form_state) {
+function hook_ENTITY_TYPE_prepare_form(\Drupal\Core\Entity\EntityInterface $entity, $operation, &$form_state) {
   if ($operation == 'edit') {
     $entity->label->value = 'Altered label';
     $form_state['mymodule']['label_altered'] = TRUE;
diff --git a/core/modules/system/src/Controller/FormAjaxController.php b/core/modules/system/src/Controller/FormAjaxController.php
index bc43c49..8c54517 100644
--- a/core/modules/system/src/Controller/FormAjaxController.php
+++ b/core/modules/system/src/Controller/FormAjaxController.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Controller;
 
+use Drupal\Core\Form\FormState;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
 use Symfony\Component\HttpKernel\Exception\HttpException;
@@ -70,7 +71,8 @@ public function content(Request $request) {
    * @throws Symfony\Component\HttpKernel\Exception\HttpExceptionInterface
    */
   protected function getForm(Request $request) {
-    $form_state = \Drupal::formBuilder()->getFormStateDefaults();
+    $form_state = new FormState();
+    $form_state->addFormStateDefaults();
     $form_build_id = $request->request->get('form_build_id');
 
     // Get the form from the cache.
diff --git a/core/modules/system/src/Form/CronForm.php b/core/modules/system/src/Form/CronForm.php
index 43a3013..6eee8dd 100644
--- a/core/modules/system/src/Form/CronForm.php
+++ b/core/modules/system/src/Form/CronForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\CronInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\State\StateInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -70,7 +71,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('system.cron');
 
     $form['description'] = array(
@@ -111,7 +112,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('system.cron')
       ->set('threshold.autorun', $form_state['values']['cron_safe_threshold'])
       ->save();
@@ -122,7 +123,7 @@ public function submitForm(array &$form, array &$form_state) {
   /**
    * Runs cron and reloads the page.
    */
-  public function submitCron(array &$form, array &$form_state) {
+  public function submitCron(array &$form, &$form_state) {
     // Run cron manually from Cron form.
     if ($this->cron->run()) {
       drupal_set_message(t('Cron run successfully.'));
diff --git a/core/modules/system/src/Form/DateFormatAddForm.php b/core/modules/system/src/Form/DateFormatAddForm.php
index b9289a2..89659e8 100644
--- a/core/modules/system/src/Form/DateFormatAddForm.php
+++ b/core/modules/system/src/Form/DateFormatAddForm.php
@@ -15,7 +15,7 @@ class DateFormatAddForm extends DateFormatFormBase {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, &$form_state) {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = t('Add format');
     return $actions;
@@ -24,7 +24,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, &$form_state) {
     parent::submit($form, $form_state);
     drupal_set_message(t('Custom date format added.'));
   }
diff --git a/core/modules/system/src/Form/DateFormatDeleteForm.php b/core/modules/system/src/Form/DateFormatDeleteForm.php
index d4f81ed..2c1baad 100644
--- a/core/modules/system/src/Form/DateFormatDeleteForm.php
+++ b/core/modules/system/src/Form/DateFormatDeleteForm.php
@@ -70,7 +70,7 @@ public function getCancelRoute() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, &$form_state) {
     $this->entity->delete();
     drupal_set_message(t('Removed date format %format.', array('%format' => $this->entity->label())));
 
diff --git a/core/modules/system/src/Form/DateFormatEditForm.php b/core/modules/system/src/Form/DateFormatEditForm.php
index 500f5ba..e3df858 100644
--- a/core/modules/system/src/Form/DateFormatEditForm.php
+++ b/core/modules/system/src/Form/DateFormatEditForm.php
@@ -15,7 +15,7 @@ class DateFormatEditForm extends DateFormatFormBase {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, &$form_state) {
     $form = parent::form($form, $form_state);
 
     $now = t('Displayed as %date', array('%date' => $this->dateService->format(REQUEST_TIME, $this->entity->id())));
@@ -28,7 +28,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, &$form_state) {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = t('Save format');
     unset($actions['delete']);
@@ -38,7 +38,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, &$form_state) {
     parent::submit($form, $form_state);
     drupal_set_message(t('Custom date format updated.'));
   }
diff --git a/core/modules/system/src/Form/DateFormatFormBase.php b/core/modules/system/src/Form/DateFormatFormBase.php
index 5ae6134..34dfb91 100644
--- a/core/modules/system/src/Form/DateFormatFormBase.php
+++ b/core/modules/system/src/Form/DateFormatFormBase.php
@@ -67,13 +67,13 @@ public static function create(ContainerInterface $container) {
    *   The entity ID.
    * @param array $element
    *   The form element.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state.
    *
    * @return bool
    *   TRUE if this format already exists, FALSE otherwise.
    */
-  public function exists($entity_id, array $element,  array $form_state) {
+  public function exists($entity_id, array $element, $form_state) {
     return (bool) $this->dateFormatStorage
       ->getQuery()
       ->condition('id', $element['#field_prefix'] . $entity_id)
@@ -85,13 +85,13 @@ public function exists($entity_id, array $element,  array $form_state) {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    *
    * @return \Drupal\Core\Ajax\AjaxResponse
    *   An AJAX Response to update the date-time value of the date format.
    */
-  public static function dateTimeLookup(array $form, array $form_state) {
+  public static function dateTimeLookup(array $form, $form_state) {
     $format = '';
     if (!empty($form_state['values']['date_format_pattern'])) {
       $format = t('Displayed as %date_format', array('%date_format' => \Drupal::service('date')->format(REQUEST_TIME, 'custom', $form_state['values']['date_format_pattern'])));
@@ -107,7 +107,7 @@ public static function dateTimeLookup(array $form, array $form_state) {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, &$form_state) {
     $form['label'] = array(
       '#type' => 'textfield',
       '#title' => 'Name',
@@ -156,7 +156,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, &$form_state) {
     parent::validate($form, $form_state);
 
     // The machine name field should already check to see if the requested
@@ -174,7 +174,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, &$form_state) {
     $form_state['redirect_route']['route_name'] = 'system.date_format_list';
     $form_state['values']['pattern'] = trim($form_state['values']['date_format_pattern']);
 
diff --git a/core/modules/system/src/Form/FileSystemForm.php b/core/modules/system/src/Form/FileSystemForm.php
index e3c33f9..135f869 100644
--- a/core/modules/system/src/Form/FileSystemForm.php
+++ b/core/modules/system/src/Form/FileSystemForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Form;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\StreamWrapper\PublicStream;
 use Drupal\Core\Form\ConfigFormBase;
 
@@ -26,7 +27,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('system.file');
     $form['file_public_path'] = array(
       '#type' => 'item',
@@ -86,7 +87,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $config = $this->config('system.file')
       ->set('path.private', $form_state['values']['file_private_path'])
       ->set('path.temporary', $form_state['values']['file_temporary_path'])
diff --git a/core/modules/system/src/Form/ImageToolkitForm.php b/core/modules/system/src/Form/ImageToolkitForm.php
index be00cd8..15378db 100644
--- a/core/modules/system/src/Form/ImageToolkitForm.php
+++ b/core/modules/system/src/Form/ImageToolkitForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\ImageToolkit\ImageToolkitManager;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -60,7 +61,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $current_toolkit = $this->config('system.image')->get('toolkit');
 
     $form['image_toolkit'] = array(
@@ -95,7 +96,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('system.image')
       ->set('toolkit', $form_state['values']['image_toolkit'])
       ->save();
diff --git a/core/modules/system/src/Form/LoggingForm.php b/core/modules/system/src/Form/LoggingForm.php
index f52fc6a..ddb7e3c 100644
--- a/core/modules/system/src/Form/LoggingForm.php
+++ b/core/modules/system/src/Form/LoggingForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Form;
 
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Configure logging settings for this site.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('system.logging');
     $form['error_level'] = array(
       '#type' => 'radios',
@@ -45,7 +46,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('system.logging')
       ->set('error_level', $form_state['values']['error_level'])
       ->save();
diff --git a/core/modules/system/src/Form/ModulesListConfirmForm.php b/core/modules/system/src/Form/ModulesListConfirmForm.php
index ceb78cb..d8f3e10 100644
--- a/core/modules/system/src/Form/ModulesListConfirmForm.php
+++ b/core/modules/system/src/Form/ModulesListConfirmForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface;
 use Drupal\Core\Url;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -101,7 +102,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $account = $this->currentUser()->id();
     $this->modules = $this->keyValueExpirable->get($account);
 
@@ -131,7 +132,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Remove the key value store entry.
     $account = $this->currentUser()->id();
     $this->keyValueExpirable->delete($account);
diff --git a/core/modules/system/src/Form/ModulesListForm.php b/core/modules/system/src/Form/ModulesListForm.php
index da1ecd0..b7f20ea 100644
--- a/core/modules/system/src/Form/ModulesListForm.php
+++ b/core/modules/system/src/Form/ModulesListForm.php
@@ -15,6 +15,7 @@
 use Drupal\Core\Extension\Extension;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Routing\RouteMatchInterface;
@@ -127,7 +128,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     require_once DRUPAL_ROOT . '/core/includes/install.inc';
     $distribution = String::checkPlain(drupal_install_profile_distribution_name());
 
@@ -372,13 +373,13 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
   /**
    * Helper function for building a list of modules to install.
    *
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state array.
    *
    * @return array
    *   An array of modules to install and their dependencies.
    */
-  protected function buildModuleList(array $form_state) {
+  protected function buildModuleList($form_state) {
     $packages = $form_state['values']['modules'];
 
     // Build a list of modules to install.
@@ -436,7 +437,7 @@ protected function buildModuleList(array $form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Retrieve a list of modules to install and their dependencies.
     $modules = $this->buildModuleList($form_state);
 
diff --git a/core/modules/system/src/Form/ModulesUninstallConfirmForm.php b/core/modules/system/src/Form/ModulesUninstallConfirmForm.php
index dc30db9..61d4186 100644
--- a/core/modules/system/src/Form/ModulesUninstallConfirmForm.php
+++ b/core/modules/system/src/Form/ModulesUninstallConfirmForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Config\ConfigManagerInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -125,7 +126,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // Retrieve the list of modules from the key value store.
     $account = $this->currentUser()->id();
     $this->modules = $this->keyValueExpirable->get($account);
@@ -191,7 +192,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Clear the key value store entry.
     $account = $this->currentUser()->id();
     $this->keyValueExpirable->delete($account);
diff --git a/core/modules/system/src/Form/ModulesUninstallForm.php b/core/modules/system/src/Form/ModulesUninstallForm.php
index 7438e48..b1ec48c 100644
--- a/core/modules/system/src/Form/ModulesUninstallForm.php
+++ b/core/modules/system/src/Form/ModulesUninstallForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -64,7 +65,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // Make sure the install API is available.
     include_once DRUPAL_ROOT . '/core/includes/install.inc';
 
@@ -148,7 +149,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     // Form submitted, but no modules selected.
     if (!array_filter($form_state['values']['uninstall'])) {
       drupal_set_message($this->t('No modules selected.'), 'error');
@@ -159,7 +160,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Save all the values in an expirable key value store.
     $modules = $form_state['values']['uninstall'];
     $uninstall = array_keys(array_filter($modules));
diff --git a/core/modules/system/src/Form/PerformanceForm.php b/core/modules/system/src/Form/PerformanceForm.php
index 7ab0ec1..0c5e731 100644
--- a/core/modules/system/src/Form/PerformanceForm.php
+++ b/core/modules/system/src/Form/PerformanceForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -57,7 +58,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['#attached']['library'][] = 'system/drupal.system';
 
     $config = $this->config('system.performance');
@@ -143,7 +144,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_clear_css_cache();
     drupal_clear_js_cache();
     // This form allows page compression settings to be changed, which can
@@ -165,7 +166,7 @@ public function submitForm(array &$form, array &$form_state) {
   /**
    * Clears the caches.
    */
-  public function submitCacheClear(array &$form, array &$form_state) {
+  public function submitCacheClear(array &$form, &$form_state) {
     drupal_flush_all_caches();
     drupal_set_message(t('Caches cleared.'));
   }
diff --git a/core/modules/system/src/Form/RegionalForm.php b/core/modules/system/src/Form/RegionalForm.php
index d361859..7ac2159 100644
--- a/core/modules/system/src/Form/RegionalForm.php
+++ b/core/modules/system/src/Form/RegionalForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Form;
 
 use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Locale\CountryManagerInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -57,7 +58,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $countries = $this->countryManager->getList();
     $system_date = $this->config('system.date');
 
@@ -141,7 +142,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('system.date')
       ->set('country.default', $form_state['values']['site_default_country'])
       ->set('first_day', $form_state['values']['date_first_day'])
diff --git a/core/modules/system/src/Form/RssFeedsForm.php b/core/modules/system/src/Form/RssFeedsForm.php
index e487fce..5ba8e6d 100644
--- a/core/modules/system/src/Form/RssFeedsForm.php
+++ b/core/modules/system/src/Form/RssFeedsForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Form;
 
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Configure RSS settings for this site.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $rss_config = $this->config('system.rss');
     $form['feed_description'] = array(
       '#type' => 'textarea',
@@ -58,7 +59,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('system.rss')
       ->set('channel.description', $form_state['values']['feed_description'])
       ->set('items.limit', $form_state['values']['feed_default_items'])
diff --git a/core/modules/system/src/Form/SiteInformationForm.php b/core/modules/system/src/Form/SiteInformationForm.php
index c2b9c67..46b9013 100644
--- a/core/modules/system/src/Form/SiteInformationForm.php
+++ b/core/modules/system/src/Form/SiteInformationForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Form;
 
 use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Path\AliasManagerInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -58,7 +59,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $site_config = $this->config('system.site');
     $site_mail = $site_config->get('mail');
     if (empty($site_mail)) {
@@ -131,7 +132,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     // Check for empty front page path.
     if (empty($form_state['values']['site_frontpage'])) {
       // Set to default "user".
@@ -167,7 +168,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('system.site')
       ->set('name', $form_state['values']['site_name'])
       ->set('mail', $form_state['values']['site_mail'])
diff --git a/core/modules/system/src/Form/SiteMaintenanceModeForm.php b/core/modules/system/src/Form/SiteMaintenanceModeForm.php
index 7de4e61..1ee0aa6 100644
--- a/core/modules/system/src/Form/SiteMaintenanceModeForm.php
+++ b/core/modules/system/src/Form/SiteMaintenanceModeForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Form;
 
 use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\State\StateInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -56,7 +57,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('system.maintenance');
     $form['maintenance_mode'] = array(
       '#type' => 'checkbox',
@@ -76,7 +77,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('system.maintenance')
       ->set('message', $form_state['values']['maintenance_mode_message'])
       ->save();
diff --git a/core/modules/system/src/Form/ThemeAdminForm.php b/core/modules/system/src/Form/ThemeAdminForm.php
index d836047..627c2b3 100644
--- a/core/modules/system/src/Form/ThemeAdminForm.php
+++ b/core/modules/system/src/Form/ThemeAdminForm.php
@@ -7,6 +7,7 @@
 namespace Drupal\system\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form to select the administration theme.
@@ -23,7 +24,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, array $theme_options = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, array $theme_options = NULL) {
     // Administration theme settings.
     $form['admin_theme'] = array(
       '#type' => 'details',
@@ -48,7 +49,7 @@ public function buildForm(array $form, array &$form_state, array $theme_options
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message($this->t('The configuration options have been saved.'));
     $this->config('system.theme')->set('admin', $form_state['values']['admin_theme'])->save();
   }
diff --git a/core/modules/system/src/Form/ThemeSettingsForm.php b/core/modules/system/src/Form/ThemeSettingsForm.php
index 7752960..9d398d9 100644
--- a/core/modules/system/src/Form/ThemeSettingsForm.php
+++ b/core/modules/system/src/Form/ThemeSettingsForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Form;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\StreamWrapper\PublicStream;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -65,7 +66,7 @@ public function getFormId() {
    * @param string $theme
    *   The theme name.
    */
-  public function buildForm(array $form, array &$form_state, $theme = '') {
+  public function buildForm(array $form, FormStateInterface $form_state, $theme = '') {
     $form = parent::buildForm($form, $form_state);
 
     $themes = list_themes();
@@ -316,7 +317,7 @@ public function buildForm(array $form, array &$form_state, $theme = '') {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     parent::validateForm($form, $form_state);
 
     if ($this->moduleHandler->moduleExists('file')) {
@@ -373,7 +374,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     parent::submitForm($form, $form_state);
 
     $config = $this->config($form_state['values']['config_key']);
diff --git a/core/modules/system/src/Plugin/Block/SystemBrandingBlock.php b/core/modules/system/src/Plugin/Block/SystemBrandingBlock.php
index 13e1b7f..0cecf2b 100644
--- a/core/modules/system/src/Plugin/Block/SystemBrandingBlock.php
+++ b/core/modules/system/src/Plugin/Block/SystemBrandingBlock.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\NestedArray;
 use Drupal\block\BlockBase;
 use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Routing\UrlGeneratorInterface;
 use Drupal\Core\Session\AccountInterface;
@@ -105,7 +106,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function blockForm($form, &$form_state) {
+  public function blockForm($form, FormStateInterface $form_state) {
     // Get the theme.
     $theme = $form_state['block_theme'];
 
@@ -173,7 +174,7 @@ public function blockForm($form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function blockSubmit($form, &$form_state) {
+  public function blockSubmit($form, FormStateInterface $form_state) {
     $this->configuration['use_site_logo'] = $form_state['values']['block_branding']['use_site_logo'];
     $this->configuration['use_site_name'] = $form_state['values']['block_branding']['use_site_name'];
     $this->configuration['use_site_slogan'] = $form_state['values']['block_branding']['use_site_slogan'];
diff --git a/core/modules/system/src/Plugin/Block/SystemMainBlock.php b/core/modules/system/src/Plugin/Block/SystemMainBlock.php
index 666b515..e251cad 100644
--- a/core/modules/system/src/Plugin/Block/SystemMainBlock.php
+++ b/core/modules/system/src/Plugin/Block/SystemMainBlock.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Plugin\Block;
 
 use Drupal\block\BlockBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides a 'Main page content' block.
@@ -31,7 +32,7 @@ public function build() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form = parent::buildConfigurationForm($form, $form_state);
 
     // The main content block is never cacheable, because it may be dynamic.
diff --git a/core/modules/system/src/Plugin/Block/SystemPoweredByBlock.php b/core/modules/system/src/Plugin/Block/SystemPoweredByBlock.php
index 2b4ffaa..980d5b3 100644
--- a/core/modules/system/src/Plugin/Block/SystemPoweredByBlock.php
+++ b/core/modules/system/src/Plugin/Block/SystemPoweredByBlock.php
@@ -9,6 +9,7 @@
 
 use Drupal\block\BlockBase;
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides a 'Powered by Drupal' block.
@@ -27,11 +28,10 @@ public function build() {
     return array('#markup' => '<span>' . t('Powered by <a href="@poweredby">Drupal</a>', array('@poweredby' => 'https://drupal.org')) . '</span>');
   }
 
-
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form = parent::buildConfigurationForm($form, $form_state);
 
     // The 'Powered by Drupal' block is permanently cacheable, because its
diff --git a/core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php b/core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php
index 874bcd6..1ccd1f9 100644
--- a/core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php
+++ b/core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Condition\ConditionPluginBase;
 use Drupal\Core\Extension\ThemeHandlerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Theme\ThemeNegotiatorInterface;
@@ -92,7 +93,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form['theme'] = array(
       '#type' => 'select',
       '#title' => $this->t('Theme'),
@@ -107,7 +108,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['theme'] = $form_state['values']['theme'];
     parent::submitConfigurationForm($form, $form_state);
   }
diff --git a/core/modules/system/src/Plugin/Condition/RequestPath.php b/core/modules/system/src/Plugin/Condition/RequestPath.php
index 1dab54f..c6314d5 100644
--- a/core/modules/system/src/Plugin/Condition/RequestPath.php
+++ b/core/modules/system/src/Plugin/Condition/RequestPath.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Condition\ConditionPluginBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Path\AliasManagerInterface;
 use Drupal\Core\Path\PathMatcherInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
@@ -93,7 +94,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form['pages'] = array(
       '#type' => 'textarea',
       '#title' => $this->t('Pages'),
@@ -110,7 +111,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['pages'] = $form_state['values']['pages'];
     parent::submitConfigurationForm($form, $form_state);
   }
diff --git a/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
index 969eaa5..55b8a48 100644
--- a/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
+++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Plugin\ImageToolkit;
 
 use Drupal\Component\Utility\Unicode;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\ImageToolkit\ImageToolkitBase;
 use Drupal\Component\Utility\Image as ImageUtility;
 
@@ -77,7 +78,7 @@ public function settingsForm() {
   /**
    * {@inheritdoc}
    */
-  public function settingsFormSubmit($form, &$form_state) {
+  public function settingsFormSubmit($form, FormStateInterface $form_state) {
     \Drupal::config('system.image.gd')
       ->set('jpeg_quality', $form_state['values']['gd']['image_jpeg_quality'])
       ->save();
diff --git a/core/modules/system/src/Plugin/views/field/BulkForm.php b/core/modules/system/src/Plugin/views/field/BulkForm.php
index fc9898d..2dea41c 100644
--- a/core/modules/system/src/Plugin/views/field/BulkForm.php
+++ b/core/modules/system/src/Plugin/views/field/BulkForm.php
@@ -157,8 +157,8 @@ public function preRender(&$values) {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    */
   public function viewsForm(&$form, &$form_state) {
     // Add the tableselect javascript.
@@ -245,8 +245,8 @@ protected function getBulkOptions($filtered = TRUE) {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    */
   public function viewsFormSubmit(&$form, &$form_state) {
     if ($form_state['step'] == 'views_form_views_form') {
diff --git a/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php b/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php
index b0ce2f8..b81c56b 100644
--- a/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php
+++ b/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Core\Form\FormState;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -207,7 +208,8 @@ function testMultipleFalseOptionchecker() {
    */
   private function formSubmitHelper($form, $edit) {
     $form_id = $this->randomName();
-    $form_state = \Drupal::formBuilder()->getFormStateDefaults();
+    $form_state = new FormState();
+    $form_state->addFormStateDefaults();
 
     $form['op'] = array('#type' => 'submit', '#value' => t('Submit'));
     // The form token CSRF protection should not interfere with this test, so we
diff --git a/core/modules/system/src/Tests/Form/FormCacheTest.php b/core/modules/system/src/Tests/Form/FormCacheTest.php
index b33c749..398920d 100644
--- a/core/modules/system/src/Tests/Form/FormCacheTest.php
+++ b/core/modules/system/src/Tests/Form/FormCacheTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Core\Form\FormState;
 use Drupal\Core\Session\UserSession;
 use Drupal\simpletest\DrupalUnitTestBase;
 
@@ -32,7 +33,8 @@ public function setUp() {
     $this->form = array(
       '#property' => $this->randomName(),
     );
-    $this->form_state = \Drupal::formBuilder()->getFormStateDefaults();
+    $this->form_state = new FormState();
+    $this->form_state->addFormStateDefaults();
     $this->form_state['example'] = $this->randomName();
   }
 
@@ -43,7 +45,8 @@ function testCacheToken() {
     \Drupal::currentUser()->setAccount(new UserSession(array('uid' => 1)));
     form_set_cache($this->form_build_id, $this->form, $this->form_state);
 
-    $cached_form_state = \Drupal::formBuilder()->getFormStateDefaults();
+    $cached_form_state = new FormState();
+    $cached_form_state->addFormStateDefaults();
     $cached_form = form_get_cache($this->form_build_id, $cached_form_state);
     $this->assertEqual($this->form['#property'], $cached_form['#property']);
     $this->assertTrue(!empty($cached_form['#cache_token']), 'Form has a cache token');
@@ -53,14 +56,16 @@ function testCacheToken() {
     // Change the private key. (We cannot change the session ID because this
     // will break the parent site test runner batch.)
     \Drupal::state()->set('system.private_key', 'invalid');
-    $cached_form_state = \Drupal::formBuilder()->getFormStateDefaults();
+    $cached_form_state = new FormState();
+    $cached_form_state->addFormStateDefaults();
     $cached_form = form_get_cache($this->form_build_id, $cached_form_state);
     $this->assertFalse($cached_form, 'No form returned from cache');
     $this->assertTrue(empty($cached_form_state['example']));
 
     // Test that loading the cache with a different form_id fails.
     $wrong_form_build_id = $this->randomName(9);
-    $cached_form_state = \Drupal::formBuilder()->getFormStateDefaults();
+    $cached_form_state = new FormState();
+    $cached_form_state->addFormStateDefaults();
     $this->assertFalse(form_get_cache($wrong_form_build_id, $cached_form_state), 'No form returned from cache');
     $this->assertTrue(empty($cached_form_state['example']), 'Cached form state was not loaded');
   }
@@ -74,7 +79,8 @@ function testNoCacheToken() {
     $this->form_state['example'] = $this->randomName();
     form_set_cache($this->form_build_id, $this->form, $this->form_state);
 
-    $cached_form_state = \Drupal::formBuilder()->getFormStateDefaults();
+    $cached_form_state = new FormState();
+    $cached_form_state->addFormStateDefaults();
     $cached_form = form_get_cache($this->form_build_id, $cached_form_state);
     $this->assertEqual($this->form['#property'], $cached_form['#property']);
     $this->assertTrue(empty($cached_form['#cache_token']), 'Form has no cache token');
diff --git a/core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php b/core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php
index 9c980a6..ffcd3a5 100644
--- a/core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php
+++ b/core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Tests\Form;
 
 use Drupal\Core\Form\FormInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\simpletest\KernelTestBase;
 
 /**
@@ -34,7 +35,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['#validate'][] = array($this, 'customValidateForm');
     $form['#submit'][] = array($this, 'customSubmitForm');
     $form['submit'] = array('#type' => 'submit', '#value' => 'Save');
@@ -44,28 +45,28 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function customValidateForm(array &$form, array &$form_state) {
+  public function customValidateForm(array &$form, FormStateInterface $form_state) {
     $form_state['test_handlers']['validate'][] = __FUNCTION__;
   }
 
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $form_state['test_handlers']['validate'][] = __FUNCTION__;
   }
 
   /**
    * {@inheritdoc}
    */
-  public function customSubmitForm(array &$form, array &$form_state) {
+  public function customSubmitForm(array &$form, FormStateInterface $form_state) {
     $form_state['test_handlers']['submit'][] = __FUNCTION__;
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['test_handlers']['submit'][] = __FUNCTION__;
   }
 
diff --git a/core/modules/system/src/Tests/Form/FormTest.php b/core/modules/system/src/Tests/Form/FormTest.php
index 2b4850e..bfbda57 100644
--- a/core/modules/system/src/Tests/Form/FormTest.php
+++ b/core/modules/system/src/Tests/Form/FormTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Serialization\Json;
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormState;
 use Drupal\Core\Render\Element;
 use Drupal\form_test\Form\FormTestDisabledElementsForm;
 use Drupal\simpletest\WebTestBase;
@@ -102,7 +103,8 @@ function testRequiredFields() {
         foreach (array(TRUE, FALSE) as $required) {
           $form_id = $this->randomName();
           $form = array();
-          $form_state = \Drupal::formBuilder()->getFormStateDefaults();
+          $form_state = new FormState();
+          $form_state->addFormStateDefaults();
           $form['op'] = array('#type' => 'submit', '#value' => t('Submit'));
           $element = $data['element']['#title'];
           $form[$element] = $data['element'];
@@ -482,7 +484,7 @@ function testColorValidation() {
    */
   function testDisabledElements() {
     // Get the raw form in its original state.
-    $form_state = array();
+    $form_state = new FormState();
     $form = (new FormTestDisabledElementsForm())->buildForm(array(), $form_state);
 
     // Build a submission that tries to hijack the form by submitting input for
diff --git a/core/modules/system/src/Tests/Form/ProgrammaticTest.php b/core/modules/system/src/Tests/Form/ProgrammaticTest.php
index a5c4071..2eba5ea 100644
--- a/core/modules/system/src/Tests/Form/ProgrammaticTest.php
+++ b/core/modules/system/src/Tests/Form/ProgrammaticTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Core\Form\FormState;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -71,7 +72,7 @@ function testSubmissionWorkflow() {
    */
   private function submitForm($values, $valid_input) {
     // Programmatically submit the given values.
-    $form_state = array('values' => $values);
+    $form_state = new FormState(array('values' => $values));
     \Drupal::formBuilder()->submitForm('\Drupal\form_test\Form\FormTestProgrammaticForm', $form_state);
 
     // Check that the form returns an error when expected, and vice versa.
@@ -98,6 +99,7 @@ private function submitForm($values, $valid_input) {
    * Test the programmed_bypass_access_check flag.
    */
   public function testProgrammaticAccessBypass() {
+    $form_state = new FormState();
     $form_state['values'] = array(
       'textfield' => 'dummy value',
       'field_restricted' => 'dummy value'
diff --git a/core/modules/system/src/Tests/Form/StubForm.php b/core/modules/system/src/Tests/Form/StubForm.php
index 225371b..c3898df 100644
--- a/core/modules/system/src/Tests/Form/StubForm.php
+++ b/core/modules/system/src/Tests/Form/StubForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Tests\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides a stub form for testing purposes.
@@ -51,14 +52,14 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     return $this->form;
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/src/Tests/Form/TriggeringElementProgrammedUnitTest.php b/core/modules/system/src/Tests/Form/TriggeringElementProgrammedUnitTest.php
index 3e6f413..2d040de 100644
--- a/core/modules/system/src/Tests/Form/TriggeringElementProgrammedUnitTest.php
+++ b/core/modules/system/src/Tests/Form/TriggeringElementProgrammedUnitTest.php
@@ -9,6 +9,8 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Core\Form\FormInterface;
+use Drupal\Core\Form\FormState;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\simpletest\DrupalUnitTestBase;
 
 /**
@@ -30,7 +32,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['one'] = array(
       '#type' => 'textfield',
       '#title' => 'One',
@@ -57,7 +59,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     // Verify that the only submit button was recognized as triggering_element.
     $this->assertEqual($form['actions']['submit']['#array_parents'], $form_state['triggering_element']['#array_parents']);
   }
@@ -65,7 +67,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
   /**
@@ -73,6 +75,7 @@ public function submitForm(array &$form, array &$form_state) {
    */
   function testLimitValidationErrors() {
     // Programmatically submit the form.
+    $form_state = new FormState();
     $form_state['values'] = array();
     $form_state['values']['section'] = 'one';
     $form_builder = $this->container->get('form_builder');
diff --git a/core/modules/system/src/Tests/System/SystemConfigFormTestBase.php b/core/modules/system/src/Tests/System/SystemConfigFormTestBase.php
index b923daf..cabd863 100644
--- a/core/modules/system/src/Tests/System/SystemConfigFormTestBase.php
+++ b/core/modules/system/src/Tests/System/SystemConfigFormTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\System;
 
+use Drupal\Core\Form\FormState;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -47,11 +48,12 @@
    */
   public function testConfigForm() {
     // Programmatically submit the given values.
+    $values = array();
     foreach ($this->values as $form_key => $data) {
       $values[$form_key] = $data['#value'];
     }
-    $form_state = array('values' => $values);
-    drupal_form_submit($this->form, $form_state);
+    $form_state = new FormState(array('values' => $values));
+    \Drupal::formBuilder()->submitForm($this->form, $form_state);
 
     // Check that the form returns an error when expected, and vice versa.
     $errors = form_get_errors($form_state);
diff --git a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php
index 474b6ea..46525e7 100644
--- a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php
+++ b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\ajax_forms_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form constructor for the Ajax Command display form.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}.
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form = array();
 
     // Shows the 'after' command with a callback generating commands.
@@ -216,7 +217,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}.
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestLazyLoadForm.php b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestLazyLoadForm.php
index d5761fe..762c306 100644
--- a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestLazyLoadForm.php
+++ b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestLazyLoadForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\ajax_forms_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form builder: Builds a form that triggers a simple AJAX callback.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // We attach a JavaScript setting, so that one of the generated AJAX
     // commands will be a settings command. We can then check the settings
     // command to ensure that the 'currentPath' setting is not part
@@ -54,7 +55,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     if ($form_state['values']['add_files']) {
       $path = drupal_get_path('module', 'system');
       $attached = array(
diff --git a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php
index a2a4cf8..225664d 100644
--- a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php
+++ b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Form\FormBase;
 use Drupal\ajax_forms_test\Callbacks;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form builder: Builds a form that triggers a simple AJAX callback.
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $object = new Callbacks();
 
     $form = array();
@@ -77,7 +78,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestValidationForm.php b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestValidationForm.php
index 3532279..bf7064e 100644
--- a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestValidationForm.php
+++ b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestValidationForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\ajax_forms_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form builder: Builds a form that triggers a simple AJAX callback.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['drivertext'] = array(
       '#title' => $this->t('AJAX-enabled textfield.'),
       '#description' => $this->t("When this one AJAX-triggers and the spare required field is empty, you should not get an error."),
@@ -68,7 +69,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message($this->t("Validation form submitted"));
   }
 
diff --git a/core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestDialogForm.php b/core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestDialogForm.php
index 9d598d8..b4a5205 100644
--- a/core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestDialogForm.php
+++ b/core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestDialogForm.php
@@ -13,6 +13,7 @@
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\OpenModalDialogCommand;
 use Drupal\Core\Ajax\OpenDialogCommand;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Dummy form for testing DialogController with _form routes.
@@ -29,7 +30,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // In order to use WebTestBase::drupalPostAjaxForm() to POST from a link, we need
     // to have a dummy field we can set in WebTestBase::drupalPostForm() else it won't
     // submit anything.
@@ -59,14 +60,14 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
 
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['redirect'] = 'ajax-test/dialog-contents';
   }
 
diff --git a/core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestForm.php b/core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestForm.php
index 462f671..4237316 100644
--- a/core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestForm.php
+++ b/core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\ajax_test\Form;
 
 use Drupal\Core\Form\FormInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Dummy form for testing DialogController with _form routes.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
 
     $form['#action'] = url('ajax-test/dialog');
 
@@ -43,11 +44,11 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {}
+  public function submitForm(array &$form, FormStateInterface $form_state) {}
 
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {}
+  public function validateForm(array &$form, FormStateInterface $form_state) {}
 
 }
diff --git a/core/modules/system/tests/modules/batch_test/batch_test.module b/core/modules/system/tests/modules/batch_test/batch_test.module
index 5438acf..9290ef8 100644
--- a/core/modules/system/tests/modules/batch_test/batch_test.module
+++ b/core/modules/system/tests/modules/batch_test/batch_test.module
@@ -5,10 +5,13 @@
  * Helper module for the Batch API tests.
  */
 
+use Drupal\Core\Form\FormState;
+
 /**
  * Batch operation: Submits form_test_mock_form() using drupal_form_submit().
  */
 function _batch_test_nested_drupal_form_submit_callback($value) {
+  $state = new FormState();
   $state['values']['test_value'] = $value;
   \Drupal::formBuilder()->submitForm('Drupal\batch_test\Form\BatchTestMockForm', $state);
 }
diff --git a/core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php b/core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php
index 9afb0e9..fcd9b01 100644
--- a/core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php
+++ b/core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php
@@ -6,6 +6,7 @@
 
 namespace Drupal\batch_test\Controller;
 
+use Drupal\Core\Form\FormState;
 
 /**
  * Controller routines for batch tests.
@@ -84,9 +85,9 @@ public function testNoForm() {
    *   Render array containing markup.
    */
   function testProgrammatic($value = 1) {
-    $form_state = array(
+    $form_state = new FormState(array(
       'values' => array('value' => $value)
-    );
+    ));
     \Drupal::formBuilder()->submitForm('Drupal\batch_test\Form\BatchTestChainedForm', $form_state);
     return array(
       'success' => array(
diff --git a/core/modules/system/tests/modules/batch_test/src/Form/BatchTestChainedForm.php b/core/modules/system/tests/modules/batch_test/src/Form/BatchTestChainedForm.php
index c6603de..0bffcf8 100644
--- a/core/modules/system/tests/modules/batch_test/src/Form/BatchTestChainedForm.php
+++ b/core/modules/system/tests/modules/batch_test/src/Form/BatchTestChainedForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\batch_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // This value is used to test that $form_state persists through batched
     // submit handlers.
     $form['value'] = array(
@@ -49,7 +50,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
   /**
diff --git a/core/modules/system/tests/modules/batch_test/src/Form/BatchTestMockForm.php b/core/modules/system/tests/modules/batch_test/src/Form/BatchTestMockForm.php
index 6372c20..f72fc29 100644
--- a/core/modules/system/tests/modules/batch_test/src/Form/BatchTestMockForm.php
+++ b/core/modules/system/tests/modules/batch_test/src/Form/BatchTestMockForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\batch_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Generate form of id batch_test_mock_form.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['test_value'] = array(
       '#title' => t('Test value'),
       '#type' => 'textfield',
@@ -40,7 +41,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     batch_test_stack('mock form submitted with value = ' . $form_state['values']['test_value']);
   }
 
diff --git a/core/modules/system/tests/modules/batch_test/src/Form/BatchTestMultiStepForm.php b/core/modules/system/tests/modules/batch_test/src/Form/BatchTestMultiStepForm.php
index 4ce90a4..3743cac 100644
--- a/core/modules/system/tests/modules/batch_test/src/Form/BatchTestMultiStepForm.php
+++ b/core/modules/system/tests/modules/batch_test/src/Form/BatchTestMultiStepForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\batch_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     if (empty($form_state['storage']['step'])) {
       $form_state['storage']['step'] = 1;
     }
@@ -44,7 +45,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     batch_test_stack(NULL, TRUE);
 
     switch ($form_state['storage']['step']) {
diff --git a/core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php b/core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php
index 3c39339..6bfa1c9 100644
--- a/core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php
+++ b/core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\batch_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['batch'] = array(
       '#type' => 'select',
       '#title' => 'Choose batch',
@@ -48,7 +49,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     batch_test_stack(NULL, TRUE);
 
     $function = '_batch_test_' . $form_state['values']['batch'];
diff --git a/core/modules/system/tests/modules/condition_test/src/FormController.php b/core/modules/system/tests/modules/condition_test/src/FormController.php
index d713bb7..1f13755 100644
--- a/core/modules/system/tests/modules/condition_test/src/FormController.php
+++ b/core/modules/system/tests/modules/condition_test/src/FormController.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Form\FormInterface;
 use Drupal\Core\Condition\ConditionManager;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Routing controller class for condition_test testing of condition forms.
@@ -38,9 +39,9 @@ public function __construct() {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::buildForm().
+   * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form = $this->condition->buildConfigurationForm($form, $form_state);
     $form['actions']['submit'] = array(
       '#type' => 'submit',
@@ -51,15 +52,16 @@ public function buildForm(array $form, array &$form_state) {
 
   /**
    * Implements \Drupal\Core\Form\FormInterface::validateForm().
+   *
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $this->condition->validateConfigurationForm($form, $form_state);
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::submitForm().
+   * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->condition->submitConfigurationForm($form, $form_state);
     $config = $this->condition->getConfig();
     $bundles = implode(' and ', $config['bundles']);
diff --git a/core/modules/system/tests/modules/database_test/src/Form/DatabaseTestForm.php b/core/modules/system/tests/modules/database_test/src/Form/DatabaseTestForm.php
index 12e7311..712ac97 100644
--- a/core/modules/system/tests/modules/database_test/src/Form/DatabaseTestForm.php
+++ b/core/modules/system/tests/modules/database_test/src/Form/DatabaseTestForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form controller for database_test module.
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $header = array(
       'username' => array('data' => t('Username'), 'field' => 'u.name'),
       'status' => array('data' => t('Status'), 'field' => 'u.status'),
@@ -72,7 +73,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/entity_test/src/EntityTestDeleteForm.php b/core/modules/system/tests/modules/entity_test/src/EntityTestDeleteForm.php
index e24e654..d097294 100644
--- a/core/modules/system/tests/modules/entity_test/src/EntityTestDeleteForm.php
+++ b/core/modules/system/tests/modules/entity_test/src/EntityTestDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\entity_test;
 
 use Drupal\Core\Entity\ContentEntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -33,7 +34,7 @@ public function getQuestion() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     parent::submit($form, $form_state);
     $entity = $this->entity;
     $entity->delete();
diff --git a/core/modules/system/tests/modules/entity_test/src/EntityTestForm.php b/core/modules/system/tests/modules/entity_test/src/EntityTestForm.php
index 2ca9d0d..ed56b50 100644
--- a/core/modules/system/tests/modules/entity_test/src/EntityTestForm.php
+++ b/core/modules/system/tests/modules/entity_test/src/EntityTestForm.php
@@ -7,6 +7,7 @@
 namespace Drupal\entity_test;
 
 use Drupal\Core\Entity\ContentEntityForm;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 
 /**
@@ -15,9 +16,9 @@
 class EntityTestForm extends ContentEntityForm {
 
   /**
-   * Overrides Drupal\Core\Entity\EntityForm::form().
+   * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form = parent::form($form, $form_state);
     $entity = $this->entity;
 
@@ -61,9 +62,9 @@ public function form(array $form, array &$form_state) {
   }
 
   /**
-   * Overrides \Drupal\Core\Entity\EntityForm::submit().
+   * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     // Build the entity object from the submitted values.
     $entity = parent::submit($form, $form_state);
 
@@ -76,9 +77,9 @@ public function submit(array $form, array &$form_state) {
   }
 
   /**
-   * Overrides Drupal\Core\Entity\EntityForm::save().
+   * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $entity = $this->entity;
     $is_new = $entity->isNew();
     $entity->save();
diff --git a/core/modules/system/tests/modules/form_test/src/ConfirmFormTestForm.php b/core/modules/system/tests/modules/form_test/src/ConfirmFormTestForm.php
index ee6b03a..c7a3eb9 100644
--- a/core/modules/system/tests/modules/form_test/src/ConfirmFormTestForm.php
+++ b/core/modules/system/tests/modules/form_test/src/ConfirmFormTestForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test;
 
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -60,7 +61,7 @@ public function getCancelText() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['element'] = array('#markup' => '<p>The ConfirmFormTestForm::buildForm() method was used for this form.</p>');
 
     return parent::buildForm($form, $form_state);
@@ -69,7 +70,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message($this->t('The ConfirmFormTestForm::submitForm() method was used for this form.'));
     $form_state['redirect_route']['route_name'] = '<front>';
   }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestAlterForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestAlterForm.php
index 3052d76..170e92b 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestAlterForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestAlterForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form builder for testing hook_form_alter() and hook_form_FORM_ID_alter().
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // Elements can be added as needed for future testing needs, but for now,
     // we're only testing alter hooks that do not require any elements added by
     // this function.
@@ -34,7 +35,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestButtonClassForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestButtonClassForm.php
index 1110120..542a104 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestButtonClassForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestButtonClassForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Builds a simple form to test form button classes.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['button'] = array(
       '#type' => 'button',
       '#value' => 'test',
@@ -41,7 +42,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxForm.php
index 1ca9a16..6a23006 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 
 class FormTestCheckboxForm extends FormBase {
@@ -22,7 +23,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // A required checkbox.
     $form['required_checkbox'] = array(
       '#type' => 'checkbox',
@@ -90,7 +91,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['response'] = new JsonResponse($form_state['values']);
   }
 
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxTypeJugglingForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxTypeJugglingForm.php
index 64a2206..335c1d7 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxTypeJugglingForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxTypeJugglingForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Builds a form to test return values for checkboxes.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $default_value = NULL, $return_value = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $default_value = NULL, $return_value = NULL) {
     $form['checkbox'] = array(
       '#title' => t('Checkbox'),
       '#type' => 'checkbox',
@@ -37,7 +38,7 @@ public function buildForm(array $form, array &$form_state, $default_value = NULL
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxesRadiosForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxesRadiosForm.php
index 4b84cf1..721399e 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxesRadiosForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxesRadiosForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 
 /**
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $customize = FALSE) {
+  public function buildForm(array $form, FormStateInterface $form_state, $customize = FALSE) {
     // Expand #type checkboxes, setting custom element properties for some but not
     // all options.
     $form['checkboxes'] = array(
@@ -82,7 +83,7 @@ public function buildForm(array $form, array &$form_state, $customize = FALSE) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['response'] = new JsonResponse($form_state['values']);
   }
 
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxesZeroForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxesZeroForm.php
index 08356ad..709a76d 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxesZeroForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxesZeroForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 
 /**
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $json = TRUE) {
+  public function buildForm(array $form, FormStateInterface $form_state, $json = TRUE) {
     $form_state['json'] = $json;
     $form['checkbox_off'] = array(
       '#title' => t('Checkbox off'),
@@ -54,7 +55,7 @@ public function buildForm(array $form, array &$form_state, $json = TRUE) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     if (!empty($form_state['json'])) {
       $form_state['response'] = new JsonResponse($form_state['values']);
     }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestClickedButtonForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestClickedButtonForm.php
index c8464c1..b0c4957 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestClickedButtonForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestClickedButtonForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form builder to test button click detection.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $first = NULL, $second = NULL, $third = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $first = NULL, $second = NULL, $third = NULL) {
     // A single text field. In IE, when a form has only one non-button input field
     // and the ENTER key is pressed while that field has focus, the form is
     // submitted without any information identifying the button responsible for
@@ -83,7 +84,7 @@ public function buildForm(array $form, array &$form_state, $first = NULL, $secon
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     if (isset($form_state['triggering_element'])) {
       drupal_set_message(t('The clicked button is %name.', array('%name' => $form_state['triggering_element']['#name'])));
     }
@@ -95,7 +96,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message('Submit handler for form_test_clicked_button executed.');
   }
 
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestColorForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestColorForm.php
index 0856026..3603631 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestColorForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestColorForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 
 /**
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['color'] = array(
       '#type' => 'color',
       '#title' => 'Color',
@@ -40,7 +41,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['response'] = new JsonResponse($form_state['values']);
   }
 
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestDisabledElementsForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestDisabledElementsForm.php
index 9f4e168..3555ab6 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestDisabledElementsForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestDisabledElementsForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Datetime\DrupalDateTime;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 
 /**
@@ -26,7 +27,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // Elements that take a simple default value.
     foreach (array('textfield', 'textarea', 'search', 'tel', 'hidden') as $type) {
       $form[$type] = array(
@@ -223,7 +224,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['response'] = new JsonResponse($form_state['values']);
   }
 
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestEmailForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestEmailForm.php
index f46ec64..11bad32 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestEmailForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestEmailForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 
 /**
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['email'] = array(
       '#type' => 'email',
       '#title' => 'Email address',
@@ -47,7 +48,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['response'] = new JsonResponse($form_state['values']);
   }
 
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestEmptySelectForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestEmptySelectForm.php
index 1434370..76e05ad 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestEmptySelectForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestEmptySelectForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Builds a form to test select elements when #options is not an array.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['empty_select'] = array(
       '#type' => 'select',
       '#title' => t('Empty Select'),
@@ -37,7 +38,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestFormStateDatabaseForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestFormStateDatabaseForm.php
index f570e2b..a0dda13 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestFormStateDatabaseForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestFormStateDatabaseForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Database\Database;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Builds a form which gets the database connection stored in the form state.
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['text'] = array(
       '#type' => 'textfield',
       '#title' => t('Text field'),
@@ -50,7 +51,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['cache'] = TRUE;
     $form_state['rebuild'] = TRUE;
 
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 879d7b3..79d44d7 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
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form builder for form_state_values_clean() test.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // Build an example form containing a managed file and a submit form element.
     $form['image'] = array(
       '#type' => 'managed_file',
@@ -42,7 +43,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     form_state_values_clean($form_state);
     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 5c258d4..c8b39e3 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
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Serialization\Json;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form builder for form_state_values_clean() test.
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // Build an example form containing multiple submit and button elements; not
     // only on the top-level.
     $form = array('#tree' => TRUE);
@@ -41,7 +42,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     form_state_values_clean($form_state);
     // 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.
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupContainerForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupContainerForm.php
index 72c672e..26a04c4 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupContainerForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupContainerForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Builds a simple form to test the #group property on #type 'container'.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['container'] = array(
       '#type' => 'container',
     );
@@ -44,7 +45,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupDetailsForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupDetailsForm.php
index fe94c13..d8f5925 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupDetailsForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupDetailsForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Builds a simple form to test the #group property on #type 'details'.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['details'] = array(
       '#type' => 'details',
       '#title' => 'Root element',
@@ -46,7 +47,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupFieldsetForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupFieldsetForm.php
index 5d4a7a8..e55b1af 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupFieldsetForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupFieldsetForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Builds a simple form to test the #group property on #type 'fieldset'.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['fieldset'] = array(
       '#type' => 'fieldset',
       '#title' => 'Fieldset',
@@ -44,7 +45,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupVerticalTabsForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupVerticalTabsForm.php
index b92e22d..c4a11af 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupVerticalTabsForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestGroupVerticalTabsForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Builds a simple form to test the #group property on #type 'vertical_tabs'.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['vertical_tabs'] = array(
       '#type' => 'vertical_tabs',
     );
@@ -52,7 +53,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestInputForgeryForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestInputForgeryForm.php
index d4f2493..e3a31e9 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestInputForgeryForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestInputForgeryForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 
 class FormTestInputForgeryForm extends FormBase {
@@ -22,7 +23,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // For testing that a user can't submit a value not matching one of the
     // allowed options.
     $form['checkboxes'] = array(
@@ -44,7 +45,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     return new JsonResponse($form_state['values']);
   }
 
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestLabelForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestLabelForm.php
index 2e24091..75234b0 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestLabelForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestLabelForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * A form for testing form labels and required marks.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['form_checkboxes_test'] = array(
       '#type' => 'checkboxes',
       '#title' => t('Checkboxes test'),
@@ -114,7 +115,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestLanguageSelectForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestLanguageSelectForm.php
index 711b369..71d8311 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestLanguageSelectForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestLanguageSelectForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 
@@ -26,7 +27,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['languages_all'] = array(
       '#title' => t('Languages: All'),
       '#type' => 'language_select',
@@ -65,7 +66,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['response'] = new JsonResponse($form_state['values']);
   }
 
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestLimitValidationErrorsForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestLimitValidationErrorsForm.php
index 6fdbb25..5b26a73 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestLimitValidationErrorsForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestLimitValidationErrorsForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Builds a simple form with a button triggering partial validation.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['title'] = array(
       '#type' => 'textfield',
       '#title' => 'Title',
@@ -96,13 +97,13 @@ public function elementValidateLimitValidationErrors($element, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
   /**
    * {@inheritdoc}
    */
-  public function partialSubmitForm(array &$form, array &$form_state) {
+  public function partialSubmitForm(array &$form, &$form_state) {
     // The title has not been validated, thus its value - in case of the test case
     // an empty string - may not be set.
     if (!isset($form_state['values']['title']) && isset($form_state['values']['test'])) {
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestNumberForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestNumberForm.php
index 7c313fc..e48f405 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestNumberForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestNumberForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Builds a form to test #type 'number' and 'range' validation.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $element = 'number') {
+  public function buildForm(array $form, FormStateInterface $form_state, $element = 'number') {
     $base = array(
       '#type' => $element,
     );
@@ -139,7 +140,7 @@ public function buildForm(array $form, array &$form_state, $element = 'number')
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestPatternForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestPatternForm.php
index 7df5f7a..8a022b4 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestPatternForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestPatternForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Builds a simple form using the FAPI #pattern proterty.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['textfield'] = array(
       '#type' => 'textfield',
       '#title' => 'One digit followed by lowercase letters',
@@ -59,7 +60,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestPlaceholderForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestPlaceholderForm.php
index f11d9d4..fc6c4dc 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestPlaceholderForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestPlaceholderForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Builds a form to test the placeholder attribute.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     foreach (array('textfield', 'textarea', 'url', 'password', 'search', 'tel', 'email', 'number') as $type) {
       $form[$type] = array(
         '#type' => $type,
@@ -39,7 +40,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestProgrammaticForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestProgrammaticForm.php
index a44b8c4..68b4368 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestProgrammaticForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestProgrammaticForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form builder to test programmatic form submissions.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['textfield'] = array(
       '#title' => 'Textfield',
       '#type' => 'textfield',
@@ -87,7 +88,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     if (empty($form_state['values']['textfield'])) {
       form_set_error('textfield', $form_state, t('Textfield is required.'));
     }
@@ -96,7 +97,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['storage']['programmatic_form_submit'] = $form_state['values'];
   }
 
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestRangeForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestRangeForm.php
index fff5126..34f1e52 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestRangeForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestRangeForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 
 /**
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['with_default_value'] = array(
       '#type' => 'range',
       '#title' => 'Range with default value',
@@ -68,7 +69,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['response'] = new JsonResponse($form_state['values']);
   }
 
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestRangeInvalidForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestRangeInvalidForm.php
index 7b685a7..92b2365 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestRangeInvalidForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestRangeInvalidForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form constructor for testing invalid #type 'range' elements.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['minmax'] = array(
       '#type' => 'range',
       '#min' => 10,
@@ -42,7 +43,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestRebuildPreserveValuesForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestRebuildPreserveValuesForm.php
index e1ecced..ea5e71d 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestRebuildPreserveValuesForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestRebuildPreserveValuesForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form builder for testing preservation of values during a rebuild.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // Start the form with two checkboxes, to test different defaults, and a
     // textfield, to test more than one element type.
     $form = array(
@@ -85,7 +86,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function addMoreSubmitForm(array &$form, array &$form_state) {
+  public function addMoreSubmitForm(array &$form, &$form_state) {
     // Rebuild, to test preservation of input values.
     $form_state['storage']['add_more'] = TRUE;
     $form_state['rebuild'] = TRUE;
@@ -94,7 +95,7 @@ public function addMoreSubmitForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Finish the workflow. Do not rebuild.
     drupal_set_message(t('Form values: %values', array('%values' => var_export($form_state['values'], TRUE))));
   }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestRedirectForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestRedirectForm.php
index 98219d9..0adc985 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestRedirectForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestRedirectForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form builder to detect form redirect.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['redirection'] = array(
       '#type' => 'checkbox',
       '#title' => t('Use redirection'),
@@ -49,7 +50,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     if (!empty($form_state['values']['redirection'])) {
       $form_state['redirect'] = !empty($form_state['values']['destination']) ? $form_state['values']['destination'] : NULL;
     }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestRequiredAttributeForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestRequiredAttributeForm.php
index 380d1c9..5f7d5d0 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestRequiredAttributeForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestRequiredAttributeForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Builds a form to test the required attribute.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     foreach (array('textfield', 'textarea', 'password') as $type) {
       $form[$type] = array(
         '#type' => $type,
@@ -39,7 +40,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestSelectForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestSelectForm.php
index 5227ae4..eba498b 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestSelectForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestSelectForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 
 /**
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $base = array(
       '#type' => 'select',
       '#options' => array('one' => 'one', 'two' => 'two', 'three' => 'three'),
@@ -126,7 +127,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['response'] = new JsonResponse($form_state['values']);
   }
 
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestStatePersistForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestStatePersistForm.php
index 5d948b0..f34f926 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestStatePersistForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestStatePersistForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form constructor for testing form state persistence.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['title'] = array(
       '#type' => 'textfield',
       '#title' => 'title',
@@ -43,7 +44,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message($form_state['value']);
     $form_state['rebuild'] = TRUE;
   }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php
index dadee26..6719be7 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * A multistep form for testing the form storage.
@@ -30,7 +31,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     if ($form_state['rebuild']) {
       $form_state['input'] = array();
     }
@@ -105,7 +106,7 @@ public function elementValidateValueCached($element, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function continueSubmitForm(array &$form, array &$form_state) {
+  public function continueSubmitForm(array &$form, &$form_state) {
     $form_state['storage']['thing']['title'] = $form_state['values']['title'];
     $form_state['storage']['thing']['value'] = $form_state['values']['value'];
     $form_state['rebuild'] = TRUE;
@@ -114,7 +115,7 @@ public function continueSubmitForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message("Title: " . String::checkPlain($form_state['values']['title']));
     drupal_set_message("Form constructions: " . $_SESSION['constructions']);
     if (isset($form_state['storage']['thing']['changed'])) {
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectColspanForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectColspanForm.php
index 29c7e92..8c34d22 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectColspanForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectColspanForm.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\form_test\Form;
 
+use Drupal\Core\Form\FormStateInterface;
+
 class FormTestTableSelectColspanForm extends FormTestTableSelectFormBase {
 
   /**
@@ -19,7 +21,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     list($header, $options) = _form_test_tableselect_get_data();
 
     // Change the data so that the third column has colspan=2.
@@ -42,7 +44,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectEmptyForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectEmptyForm.php
index 2bc690e..5d7dade 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectEmptyForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectEmptyForm.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\form_test\Form;
 
+use Drupal\Core\Form\FormStateInterface;
+
 class FormTestTableSelectEmptyForm extends FormTestTableSelectFormBase {
 
   /**
@@ -19,14 +21,14 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     return $this->tableselectFormBuilder($form, $form_state, array('#options' => array()));
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectFormBase.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectFormBase.php
index 863fe9b..c5186e2 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectFormBase.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectFormBase.php
@@ -19,8 +19,8 @@
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    * @param $element_properties
    *   An array of element properties for the tableselect element.
    *
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectJsSelectForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectJsSelectForm.php
index c33ec77..c099163 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectJsSelectForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectJsSelectForm.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\form_test\Form;
 
+use Drupal\Core\Form\FormStateInterface;
+
 class FormTestTableSelectJsSelectForm extends FormTestTableSelectFormBase {
 
   /**
@@ -19,7 +21,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $test_action = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $test_action = NULL) {
     switch ($test_action) {
       case 'multiple-true-default':
         $options = array('#multiple' => TRUE);
@@ -44,7 +46,7 @@ public function buildForm(array $form, array &$form_state, $test_action = NULL)
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectMultipleFalseForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectMultipleFalseForm.php
index c7545de..5f0b457 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectMultipleFalseForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectMultipleFalseForm.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\form_test\Form;
 
+use Drupal\Core\Form\FormStateInterface;
+
 class FormTestTableSelectMultipleFalseForm extends FormTestTableSelectFormBase {
 
   /**
@@ -19,14 +21,14 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     return $this->tableselectFormBuilder($form, $form_state, array('#multiple' => FALSE));
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message(t('Submitted: @value', array('@value' => $form_state['values']['tableselect'])));
   }
 
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectMultipleTrueForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectMultipleTrueForm.php
index 28ea3bb..4d9a0e6 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectMultipleTrueForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectMultipleTrueForm.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\form_test\Form;
 
+use Drupal\Core\Form\FormStateInterface;
+
 class FormTestTableSelectMultipleTrueForm extends FormTestTableSelectFormBase {
 
   /**
@@ -19,14 +21,14 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     return $this->tableselectFormBuilder($form, $form_state, array('#multiple' => TRUE));
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $selected = $form_state['values']['tableselect'];
     foreach ($selected as $key => $value) {
       drupal_set_message(t('Submitted: @key = @value', array('@key' => $key, '@value' => $value)));
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestUrlForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestUrlForm.php
index 8e2c5a0..297b604 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestUrlForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestUrlForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 
 /**
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['url'] = array(
       '#type' => 'url',
       '#title' => 'Optional URL',
@@ -47,7 +48,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['response'] = new JsonResponse($form_state['values']);
   }
 
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestValidateForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestValidateForm.php
index 2e59a75..6467520 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestValidateForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestValidateForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\form_test\Callbacks;
 
 /**
@@ -34,7 +35,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $object = new Callbacks();
 
     $form['name'] = array(
@@ -58,7 +59,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     if ($form_state['values']['name'] == 'validate') {
       // Alter the form element.
       $form['name']['#value'] = '#value changed by #validate';
@@ -75,7 +76,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestValidateRequiredForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestValidateRequiredForm.php
index 65cb030..f4d55bd 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestValidateRequiredForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestValidateRequiredForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form constructor to test the #required property.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $options = array('foo' => 'foo', 'bar' => 'bar');
     $validate = array(array($this, 'elementValidateRequired'));
 
@@ -85,7 +86,7 @@ public function elementValidateRequired($element, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message('The form_test_validate_required_form form was submitted successfully.');
   }
 
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestValidateRequiredNoTitleForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestValidateRequiredNoTitleForm.php
index 25e5076..9beb455 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestValidateRequiredNoTitleForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestValidateRequiredNoTitleForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form constructor to test the #required property without #title.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['textfield'] = array(
       '#type' => 'textfield',
       '#required' => TRUE,
@@ -37,7 +38,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message('The form_test_validate_required_form_no_title form was submitted successfully.');
   }
 
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestVerticalTabsForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestVerticalTabsForm.php
index 4b35fbb..4a69660 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestVerticalTabsForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestVerticalTabsForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 class FormTestVerticalTabsForm extends FormBase {
 
@@ -21,7 +22,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['vertical_tabs'] = array(
       '#type' => 'vertical_tabs',
     );
@@ -52,7 +53,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Form/RedirectBlockForm.php b/core/modules/system/tests/modules/form_test/src/Form/RedirectBlockForm.php
index 7d134d0..5f2fb52 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/RedirectBlockForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/RedirectBlockForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -27,7 +28,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['actions'] = array('#type' => 'actions');
     $form['actions']['submit'] = array('#type' => 'submit', '#value' => $this->t('Submit'));
 
@@ -37,7 +38,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['redirect_route'] = new Url('form_test.route1', array(), array('query' => array('test1' => 'test2')));
   }
 }
diff --git a/core/modules/system/tests/modules/form_test/src/FormTestArgumentsObject.php b/core/modules/system/tests/modules/form_test/src/FormTestArgumentsObject.php
index 3f6703d..dd58435 100644
--- a/core/modules/system/tests/modules/form_test/src/FormTestArgumentsObject.php
+++ b/core/modules/system/tests/modules/form_test/src/FormTestArgumentsObject.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides a test form object that needs arguments.
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $arg = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $arg = NULL) {
     $form['element'] = array('#markup' => 'The FormTestArgumentsObject::buildForm() method was used for this form.');
 
     $form['bananas'] = array(
@@ -45,14 +46,14 @@ public function buildForm(array $form, array &$form_state, $arg = NULL) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message($this->t('The FormTestArgumentsObject::validateForm() method was used for this form.'));
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message($this->t('The FormTestArgumentsObject::submitForm() method was used for this form.'));
     $this->config('form_test.object')
       ->set('bananas', $form_state['values']['bananas'])
diff --git a/core/modules/system/tests/modules/form_test/src/FormTestAutocompleteForm.php b/core/modules/system/tests/modules/form_test/src/FormTestAutocompleteForm.php
index 6cedc3a..43daa5c 100644
--- a/core/modules/system/tests/modules/form_test/src/FormTestAutocompleteForm.php
+++ b/core/modules/system/tests/modules/form_test/src/FormTestAutocompleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Defines a test form using autocomplete textfields.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['autocomplete_1'] = array(
       '#type' => 'textfield',
       '#title' => 'Autocomplete 1',
@@ -43,7 +44,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/system/tests/modules/form_test/src/FormTestControllerObject.php b/core/modules/system/tests/modules/form_test/src/FormTestControllerObject.php
index 6ddc7e0..4ccc8ad 100644
--- a/core/modules/system/tests/modules/form_test/src/FormTestControllerObject.php
+++ b/core/modules/system/tests/modules/form_test/src/FormTestControllerObject.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -33,7 +34,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $custom_attributes = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $custom_attributes = NULL) {
     $form['element'] = array('#markup' => 'The FormTestControllerObject::buildForm() method was used for this form.');
 
     $form['custom_attribute']['#markup'] = $custom_attributes;
@@ -55,14 +56,14 @@ public function buildForm(array $form, array &$form_state, $custom_attributes =
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message($this->t('The FormTestControllerObject::validateForm() method was used for this form.'));
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message($this->t('The FormTestControllerObject::submitForm() method was used for this form.'));
     $this->config('form_test.object')
       ->set('bananas', $form_state['values']['bananas'])
diff --git a/core/modules/system/tests/modules/form_test/src/FormTestObject.php b/core/modules/system/tests/modules/form_test/src/FormTestObject.php
index f6cb948..a6c6da3 100644
--- a/core/modules/system/tests/modules/form_test/src/FormTestObject.php
+++ b/core/modules/system/tests/modules/form_test/src/FormTestObject.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides a test form object.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['element'] = array('#markup' => 'The FormTestObject::buildForm() method was used for this form.');
 
     $form['bananas'] = array(
@@ -46,14 +47,14 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message($this->t('The FormTestObject::validateForm() method was used for this form.'));
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message($this->t('The FormTestObject::submitForm() method was used for this form.'));
     $this->config('form_test.object')
       ->set('bananas', $form_state['values']['bananas'])
diff --git a/core/modules/system/tests/modules/form_test/src/FormTestServiceObject.php b/core/modules/system/tests/modules/form_test/src/FormTestServiceObject.php
index 2861600..40682cb 100644
--- a/core/modules/system/tests/modules/form_test/src/FormTestServiceObject.php
+++ b/core/modules/system/tests/modules/form_test/src/FormTestServiceObject.php
@@ -8,6 +8,7 @@
 namespace Drupal\form_test;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides a test form object.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['element'] = array('#markup' => 'The FormTestServiceObject::buildForm() method was used for this form.');
 
     $form['bananas'] = array(
@@ -44,14 +45,14 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message($this->t('The FormTestServiceObject::validateForm() method was used for this form.'));
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message($this->t('The FormTestServiceObject::submitForm() method was used for this form.'));
     $this->config('form_test.object')
       ->set('bananas', $form_state['values']['bananas'])
diff --git a/core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/TestToolkit.php b/core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/TestToolkit.php
index ecbe0fe..a872b49 100644
--- a/core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/TestToolkit.php
+++ b/core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/TestToolkit.php
@@ -8,6 +8,7 @@
 namespace Drupal\image_test\Plugin\ImageToolkit;
 
 use Drupal\Component\Utility\Unicode;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\ImageToolkit\ImageToolkitBase;
 
 /**
@@ -60,7 +61,7 @@ public function settingsForm() {
   /**
    * {@inheritdoc}
    */
-  public function settingsFormSubmit($form, &$form_state) {
+  public function settingsFormSubmit($form, FormStateInterface $form_state) {
     \Drupal::config('system.image.test_toolkit')
       ->set('test_parameter', $form_state['values']['test']['test_parameter'])
       ->save();
diff --git a/core/modules/system/tests/modules/session_test/src/Form/SessionTestForm.php b/core/modules/system/tests/modules/session_test/src/Form/SessionTestForm.php
index 706c79c..3cf17f8 100644
--- a/core/modules/system/tests/modules/session_test/src/Form/SessionTestForm.php
+++ b/core/modules/system/tests/modules/session_test/src/Form/SessionTestForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form controller for the test config edit forms.
@@ -25,7 +26,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['input'] = array(
       '#type' => 'textfield',
       '#title' => 'Input',
@@ -44,7 +45,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message(String::format('Ok: @input', array('@input' => $form_state['values']['input'])));
   }
 
diff --git a/core/modules/taxonomy/src/Form/OverviewTerms.php b/core/modules/taxonomy/src/Form/OverviewTerms.php
index 4ff067a..17e1743 100644
--- a/core/modules/taxonomy/src/Form/OverviewTerms.php
+++ b/core/modules/taxonomy/src/Form/OverviewTerms.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\taxonomy\VocabularyInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -58,15 +59,15 @@ public function getFormId() {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    * @param \Drupal\taxonomy\VocabularyInterface $taxonomy_vocabulary
    *   The vocabulary to display the overview form for.
    *
    * @return array
    *   The form structure.
    */
-  public function buildForm(array $form, array &$form_state, VocabularyInterface $taxonomy_vocabulary = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, VocabularyInterface $taxonomy_vocabulary = NULL) {
     // @todo Remove global variables when http://drupal.org/node/2044435 is in.
     global $pager_page_array, $pager_total, $pager_total_items;
 
@@ -360,10 +361,10 @@ public function buildForm(array $form, array &$form_state, VocabularyInterface $
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Sort term order based on weight.
     uasort($form_state['values']['terms'], array('Drupal\Component\Utility\SortArray', 'sortByWeightElement'));
 
@@ -448,7 +449,7 @@ public function submitForm(array &$form, array &$form_state) {
   /**
    * Redirects to confirmation form for the reset action.
    */
-  public function submitReset(array &$form, array &$form_state) {
+  public function submitReset(array &$form, &$form_state) {
     /** @var $vocabulary \Drupal\taxonomy\VocabularyInterface */
     $vocabulary = $form_state['taxonomy']['vocabulary'];
     $form_state['redirect_route'] = $vocabulary->urlInfo('reset');
diff --git a/core/modules/taxonomy/src/Form/TermDeleteForm.php b/core/modules/taxonomy/src/Form/TermDeleteForm.php
index 3c2bf8b..5b90dd5 100644
--- a/core/modules/taxonomy/src/Form/TermDeleteForm.php
+++ b/core/modules/taxonomy/src/Form/TermDeleteForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\taxonomy\Form;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
@@ -55,7 +56,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     $storage = $this->entityManager->getStorage('taxonomy_vocabulary');
     $vocabulary = $storage->load($this->entity->bundle());
diff --git a/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php b/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php
index b568f67..1ea5890 100644
--- a/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php
+++ b/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\taxonomy\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -53,7 +54,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     drupal_set_message($this->t('Deleted vocabulary %name.', array('%name' => $this->entity->label())));
     watchdog('taxonomy', 'Deleted vocabulary %name.', array('%name' => $this->entity->label()), WATCHDOG_NOTICE);
diff --git a/core/modules/taxonomy/src/Form/VocabularyResetForm.php b/core/modules/taxonomy/src/Form/VocabularyResetForm.php
index bae776c..8d35e20 100644
--- a/core/modules/taxonomy/src/Form/VocabularyResetForm.php
+++ b/core/modules/taxonomy/src/Form/VocabularyResetForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\taxonomy\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\taxonomy\TermStorageInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -80,7 +81,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $this->termStorage->resetWeights($this->entity->id());
     drupal_set_message($this->t('Reset vocabulary %name to alphabetical order.', array('%name' => $this->entity->label())));
     watchdog('taxonomy', 'Reset vocabulary %name to alphabetical order.', array('%name' => $this->entity->label()), WATCHDOG_NOTICE);
diff --git a/core/modules/taxonomy/src/Plugin/Field/FieldType/TaxonomyTermReferenceFieldItemList.php b/core/modules/taxonomy/src/Plugin/Field/FieldType/TaxonomyTermReferenceFieldItemList.php
index bae89fd..1dd7943 100644
--- a/core/modules/taxonomy/src/Plugin/Field/FieldType/TaxonomyTermReferenceFieldItemList.php
+++ b/core/modules/taxonomy/src/Plugin/Field/FieldType/TaxonomyTermReferenceFieldItemList.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Field\EntityReferenceFieldItemList;
 use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Represents a configurable taxonomy_term_reference entity field item list.
@@ -19,7 +20,7 @@ class TaxonomyTermReferenceFieldItemList extends EntityReferenceFieldItemList {
   /**
    * {@inheritdoc}
    */
-  public function defaultValuesFormSubmit(array $element, array &$form, array &$form_state) {
+  public function defaultValuesFormSubmit(array $element, array &$form, FormStateInterface $form_state) {
     $default_value = parent::defaultValuesFormSubmit($element, $form, $form_state);
 
     // Convert numeric IDs to UUIDs to ensure config deployability.
diff --git a/core/modules/taxonomy/src/Plugin/Field/FieldType/TaxonomyTermReferenceItem.php b/core/modules/taxonomy/src/Plugin/Field/FieldType/TaxonomyTermReferenceItem.php
index fb6a93e..865a802 100644
--- a/core/modules/taxonomy/src/Plugin/Field/FieldType/TaxonomyTermReferenceItem.php
+++ b/core/modules/taxonomy/src/Plugin/Field/FieldType/TaxonomyTermReferenceItem.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Form\OptGroup;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\TypedData\AllowedValuesInterface;
@@ -119,7 +120,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array &$form, array &$form_state, $has_data) {
+  public function settingsForm(array &$form, FormStateInterface $form_state, $has_data) {
     $vocabularies = entity_load_multiple('taxonomy_vocabulary');
     $options = array();
     foreach ($vocabularies as $vocabulary) {
@@ -151,7 +152,7 @@ public function settingsForm(array &$form, array &$form_state, $has_data) {
   /**
    * {@inheritdoc}
    */
-  public function instanceSettingsForm(array $form, array &$form_state) {
+  public function instanceSettingsForm(array $form, FormStateInterface $form_state) {
     return array();
   }
 
diff --git a/core/modules/taxonomy/src/Plugin/Field/FieldWidget/TaxonomyAutocompleteWidget.php b/core/modules/taxonomy/src/Plugin/Field/FieldWidget/TaxonomyAutocompleteWidget.php
index ae156a4..b3500fa 100644
--- a/core/modules/taxonomy/src/Plugin/Field/FieldWidget/TaxonomyAutocompleteWidget.php
+++ b/core/modules/taxonomy/src/Plugin/Field/FieldWidget/TaxonomyAutocompleteWidget.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'taxonomy_autocomplete' widget.
@@ -38,7 +39,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['placeholder'] = array(
       '#type' => 'textfield',
       '#title' => t('Placeholder'),
@@ -69,7 +70,7 @@ public function settingsSummary() {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $tags = array();
     if (!$items->isEmpty()) {
       foreach ($items as $item) {
@@ -96,7 +97,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
   /**
    * {@inheritdoc}
    */
-  public function massageFormValues(array $values, array $form, array &$form_state) {
+  public function massageFormValues(array $values, array $form, FormStateInterface $form_state) {
     // Autocomplete widgets do not send their tids in the form, so we must detect
     // them here and process them independently.
     $items = array();
diff --git a/core/modules/taxonomy/src/TermForm.php b/core/modules/taxonomy/src/TermForm.php
index 851fa43..89aeac2 100644
--- a/core/modules/taxonomy/src/TermForm.php
+++ b/core/modules/taxonomy/src/TermForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\taxonomy;
 
 use Drupal\Core\Entity\ContentEntityForm;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 
 /**
@@ -18,7 +19,7 @@ class TermForm extends ContentEntityForm {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $term = $this->entity;
     $vocab_storage = $this->entityManager->getStorage('taxonomy_vocabulary');
     $vocabulary = $vocab_storage->load($term->bundle());
@@ -107,7 +108,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     parent::validate($form, $form_state);
 
     // Ensure numeric values.
@@ -119,7 +120,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function buildEntity(array $form, array &$form_state) {
+  public function buildEntity(array $form, FormStateInterface $form_state) {
     $term = parent::buildEntity($form, $form_state);
 
     // Prevent leading and trailing spaces in term names.
@@ -134,7 +135,7 @@ public function buildEntity(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $term = $this->entity;
 
     switch ($term->save()) {
diff --git a/core/modules/taxonomy/src/TermTranslationHandler.php b/core/modules/taxonomy/src/TermTranslationHandler.php
index 58cf864..773318a 100644
--- a/core/modules/taxonomy/src/TermTranslationHandler.php
+++ b/core/modules/taxonomy/src/TermTranslationHandler.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\content_translation\ContentTranslationHandler;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Defines the translation handler for terms.
@@ -18,7 +19,7 @@ class TermTranslationHandler extends ContentTranslationHandler {
   /**
    * {@inheritdoc}
    */
-  public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) {
+  public function entityFormAlter(array &$form, FormStateInterface $form_state, EntityInterface $entity) {
     parent::entityFormAlter($form, $form_state, $entity);
     $form['actions']['submit']['#submit'][] = array($this, 'entityFormSave');
   }
@@ -30,7 +31,7 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac
    *
    * @see \Drupal\Core\Entity\EntityForm::build().
    */
-  function entityFormSave(array $form, array &$form_state) {
+  function entityFormSave(array $form, &$form_state) {
     if ($this->getSourceLangcode($form_state)) {
       $entity = content_translation_form_controller($form_state)->getEntity();
       // We need a redirect here, otherwise we would get an access denied page,
diff --git a/core/modules/taxonomy/src/VocabularyForm.php b/core/modules/taxonomy/src/VocabularyForm.php
index 95a986a..ed8fe99 100644
--- a/core/modules/taxonomy/src/VocabularyForm.php
+++ b/core/modules/taxonomy/src/VocabularyForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 
 /**
@@ -19,7 +20,7 @@ class VocabularyForm extends EntityForm {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $vocabulary = $this->entity;
     if ($vocabulary->isNew()) {
       $form['#title'] = $this->t('Add vocabulary');
@@ -88,7 +89,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     // If we are displaying the delete confirmation skip the regular actions.
     if (empty($form_state['confirm_delete'])) {
       $actions = parent::actions($form, $form_state);
@@ -114,7 +115,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * Submit handler to update the bundle for the default language configuration.
    */
-  public function languageConfigurationSubmit(array &$form, array &$form_state) {
+  public function languageConfigurationSubmit(array &$form, &$form_state) {
     $vocabulary = $this->entity;
     // Delete the old language settings for the vocabulary, if the machine name
     // is changed.
@@ -130,7 +131,7 @@ public function languageConfigurationSubmit(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $vocabulary = $this->entity;
 
     // Prevent leading and trailing spaces in vocabulary names.
diff --git a/core/modules/taxonomy/src/VocabularyListBuilder.php b/core/modules/taxonomy/src/VocabularyListBuilder.php
index c4fc1ad..056c073 100644
--- a/core/modules/taxonomy/src/VocabularyListBuilder.php
+++ b/core/modules/taxonomy/src/VocabularyListBuilder.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Config\Entity\DraggableListBuilder;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Defines a class to build a listing of taxonomy vocabulary entities.
@@ -86,7 +87,7 @@ public function render() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form = parent::buildForm($form, $form_state);
     $form['vocabularies']['#attributes'] = array('id' => 'taxonomy');
     $form['actions']['submit']['#value'] = t('Save');
@@ -97,7 +98,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     parent::submitForm($form, $form_state);
 
     drupal_set_message(t('The configuration options have been saved.'));
diff --git a/core/modules/telephone/src/Plugin/Field/FieldFormatter/TelephoneLinkFormatter.php b/core/modules/telephone/src/Plugin/Field/FieldFormatter/TelephoneLinkFormatter.php
index 7dd4dee..5c65cf6 100644
--- a/core/modules/telephone/src/Plugin/Field/FieldFormatter/TelephoneLinkFormatter.php
+++ b/core/modules/telephone/src/Plugin/Field/FieldFormatter/TelephoneLinkFormatter.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FormatterBase;
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'telephone_link' formatter.
@@ -35,7 +36,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $elements['title'] = array(
       '#type' => 'textfield',
       '#title' => t('Title to replace basic numeric telephone number display.'),
diff --git a/core/modules/telephone/src/Plugin/Field/FieldWidget/TelephoneDefaultWidget.php b/core/modules/telephone/src/Plugin/Field/FieldWidget/TelephoneDefaultWidget.php
index 0bdd1c8..2be36da 100644
--- a/core/modules/telephone/src/Plugin/Field/FieldWidget/TelephoneDefaultWidget.php
+++ b/core/modules/telephone/src/Plugin/Field/FieldWidget/TelephoneDefaultWidget.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'telephone_default' widget.
@@ -35,7 +36,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['placeholder'] = array(
       '#type' => 'textfield',
       '#title' => t('Placeholder'),
@@ -65,7 +66,7 @@ public function settingsSummary() {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $element['value'] = $element + array(
       '#type' => 'tel',
       '#default_value' => isset($items[$delta]->value) ? $items[$delta]->value : NULL,
diff --git a/core/modules/text/src/Plugin/Field/FieldFormatter/TextTrimmedFormatter.php b/core/modules/text/src/Plugin/Field/FieldFormatter/TextTrimmedFormatter.php
index 40c8dd0..8cd66c0 100644
--- a/core/modules/text/src/Plugin/Field/FieldFormatter/TextTrimmedFormatter.php
+++ b/core/modules/text/src/Plugin/Field/FieldFormatter/TextTrimmedFormatter.php
@@ -8,6 +8,7 @@
 
 use Drupal\Core\Field\FormatterBase;
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'text_trimmed' formatter.
@@ -44,7 +45,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element['trim_length'] = array(
       '#title' => t('Trim length'),
       '#type' => 'number',
diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextItem.php b/core/modules/text/src/Plugin/Field/FieldType/TextItem.php
index 6bacea6..3b7285d 100644
--- a/core/modules/text/src/Plugin/Field/FieldType/TextItem.php
+++ b/core/modules/text/src/Plugin/Field/FieldType/TextItem.php
@@ -8,6 +8,7 @@
 namespace Drupal\text\Plugin\Field\FieldType;
 
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'text' field type.
@@ -78,7 +79,7 @@ public function getConstraints() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array &$form, array &$form_state, $has_data) {
+  public function settingsForm(array &$form, FormStateInterface $form_state, $has_data) {
     $element = array();
 
     $element['max_length'] = array(
@@ -97,7 +98,7 @@ public function settingsForm(array &$form, array &$form_state, $has_data) {
   /**
    * {@inheritdoc}
    */
-  public function instanceSettingsForm(array $form, array &$form_state) {
+  public function instanceSettingsForm(array $form, FormStateInterface $form_state) {
     $element = array();
 
     $element['text_processing'] = array(
diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextLongItem.php b/core/modules/text/src/Plugin/Field/FieldType/TextLongItem.php
index 367ae19..1c74a41 100644
--- a/core/modules/text/src/Plugin/Field/FieldType/TextLongItem.php
+++ b/core/modules/text/src/Plugin/Field/FieldType/TextLongItem.php
@@ -8,6 +8,7 @@
 namespace Drupal\text\Plugin\Field\FieldType;
 
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'text_long' field type.
@@ -48,7 +49,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
   /**
    * {@inheritdoc}
    */
-  public function instanceSettingsForm(array $form, array &$form_state) {
+  public function instanceSettingsForm(array $form, FormStateInterface $form_state) {
     $element = array();
 
     $element['text_processing'] = array(
diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php b/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php
index 0d686e0..7ffcd64 100644
--- a/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php
+++ b/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php
@@ -8,6 +8,7 @@
 namespace Drupal\text\Plugin\Field\FieldType;
 
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\TypedData\DataDefinition;
 
 /**
@@ -91,7 +92,7 @@ public function isEmpty() {
   /**
    * {@inheritdoc}
    */
-  public function instanceSettingsForm(array $form, array &$form_state) {
+  public function instanceSettingsForm(array $form, FormStateInterface $form_state) {
     $element = array();
     $settings = $this->getSettings();
 
diff --git a/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php
index a8afeb3..ef6a5db 100644
--- a/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php
+++ b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\Plugin\Field\FieldWidget\StringTextareaWidget;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\Validator\ConstraintViolationInterface;
 
 /**
@@ -27,7 +28,7 @@ class TextareaWidget extends StringTextareaWidget {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $main_widget = parent::formElement($items, $delta, $element, $form, $form_state);
 
     if ($this->getFieldSetting('text_processing')) {
@@ -44,7 +45,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
   /**
    * {@inheritdoc}
    */
-  public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, array &$form_state) {
+  public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state) {
     if ($violation->arrayPropertyPath == array('format') && isset($element['format']['#access']) && !$element['format']['#access']) {
       // Ignore validation errors for formats if formats may not be changed,
       // i.e. when existing formats become invalid. See filter_process_format().
diff --git a/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php
index e23e794..ba8c875 100644
--- a/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php
+++ b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\text\Plugin\Field\FieldWidget;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\text\Plugin\Field\FieldWidget\TextareaWidget;
 use Symfony\Component\Validator\ConstraintViolationInterface;
 use Drupal\Core\Field\FieldItemListInterface;
@@ -38,7 +39,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function settingsForm(array $form, array &$form_state) {
+  public function settingsForm(array $form, FormStateInterface $form_state) {
     $element = parent::settingsForm($form, $form_state);
     $element['summary_rows'] = array(
       '#type' => 'number',
@@ -64,7 +65,7 @@ public function settingsSummary() {
   /**
    * {@inheritdoc}
    */
-  function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $element = parent::formElement($items, $delta, $element, $form, $form_state);
 
     $display_summary = $items[$delta]->summary || $this->getFieldSetting('display_summary');
@@ -89,7 +90,7 @@ function formElement(FieldItemListInterface $items, $delta, array $element, arra
   /**
    * {@inheritdoc}
    */
-  public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, array &$form_state) {
+  public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state) {
     $element = parent::errorElement($element, $violation, $form, $form_state);
     return ($element === FALSE) ? FALSE : $element[$violation->arrayPropertyPath[0]];
   }
diff --git a/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php b/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php
index 989bcb8..c9b5dcd 100644
--- a/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php
+++ b/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\Plugin\Field\FieldWidget\StringWidget;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\Validator\ConstraintViolationInterface;
 
 /**
@@ -28,7 +29,7 @@ class TextfieldWidget extends StringWidget {
   /**
    * {@inheritdoc}
    */
-  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $main_widget = parent::formElement($items, $delta, $element, $form, $form_state);
 
     if ($this->getFieldSetting('text_processing')) {
@@ -44,7 +45,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
   /**
    * {@inheritdoc}
    */
-  public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, array &$form_state) {
+  public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state) {
     if ($violation->arrayPropertyPath == array('format') && isset($element['format']['#access']) && !$element['format']['#access']) {
       // Ignore validation errors for formats if formats may not be changed,
       // i.e. when existing formats become invalid. See filter_process_format().
diff --git a/core/modules/update/src/Form/UpdateManagerInstall.php b/core/modules/update/src/Form/UpdateManagerInstall.php
index e44cd0d..11b1ff6 100644
--- a/core/modules/update/src/Form/UpdateManagerInstall.php
+++ b/core/modules/update/src/Form/UpdateManagerInstall.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\FileTransfer\Local;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Updater\Updater;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -54,7 +55,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $this->moduleHandler->loadInclude('update', 'inc', 'update.manager');
     if (!_update_manager_check_backends($form, 'install')) {
       return $form;
@@ -101,7 +102,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $uploaded_file = $this->getRequest()->files->get('files[project_upload]', NULL, TRUE);
     if (!($form_state['values']['project_url'] XOR !empty($uploaded_file))) {
       $this->setFormError('project_url', $form_state, $this->t('You must either provide a URL or upload an archive file to install.'));
@@ -111,7 +112,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $local_cache = NULL;
     if ($form_state['values']['project_url']) {
       $local_cache = update_manager_file_get($form_state['values']['project_url']);
diff --git a/core/modules/update/src/Form/UpdateManagerUpdate.php b/core/modules/update/src/Form/UpdateManagerUpdate.php
index fd2cfb2..0f81361 100644
--- a/core/modules/update/src/Form/UpdateManagerUpdate.php
+++ b/core/modules/update/src/Form/UpdateManagerUpdate.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\State\StateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -65,7 +66,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $this->moduleHandler->loadInclude('update', 'inc', 'update.manager');
 
     $last_markup = array(
@@ -285,7 +286,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     if (!empty($form_state['values']['projects'])) {
       $enabled = array_filter($form_state['values']['projects']);
     }
@@ -300,7 +301,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->moduleHandler->loadInclude('update', 'inc', 'update.manager');
     $projects = array();
     foreach (array('projects', 'disabled_projects') as $type) {
diff --git a/core/modules/update/src/Form/UpdateReady.php b/core/modules/update/src/Form/UpdateReady.php
index 57155f0..942164a 100644
--- a/core/modules/update/src/Form/UpdateReady.php
+++ b/core/modules/update/src/Form/UpdateReady.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\FileTransfer\Local;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\State\StateInterface;
 use Drupal\Core\Updater\Updater;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -66,7 +67,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $this->moduleHandler->loadInclude('update', 'inc', 'update.manager');
     if (!_update_manager_check_backends($form, 'update')) {
       return $form;
@@ -96,7 +97,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Store maintenance_mode setting so we can restore it when done.
     $_SESSION['maintenance_mode'] = $this->state->get('system.maintenance_mode');
     if ($form_state['values']['maintenance_mode'] == TRUE) {
diff --git a/core/modules/update/src/UpdateSettingsForm.php b/core/modules/update/src/UpdateSettingsForm.php
index 600eaa2..7061081 100644
--- a/core/modules/update/src/UpdateSettingsForm.php
+++ b/core/modules/update/src/UpdateSettingsForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\update;
 
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Configure update settings for this site.
@@ -22,9 +23,9 @@ public function getFormId() {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::buildForm().
+   * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('update.settings');
 
     $form['update_check_frequency'] = array(
@@ -70,7 +71,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * Implements \Drupal\Core\Form\FormInterface::validateForm().
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $form_state['notify_emails'] = array();
     if (!empty($form_state['values']['update_notify_emails'])) {
       $valid = array();
@@ -101,9 +102,9 @@ public function validateForm(array &$form, array &$form_state) {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::submitForm().
+   * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $config = $this->config('update.settings');
      // See if the update_check_disabled setting is being changed, and if so,
     // invalidate all update status data.
diff --git a/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php
index f4f718b..a72c497 100644
--- a/core/modules/user/src/AccountForm.php
+++ b/core/modules/user/src/AccountForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Entity\ContentEntityForm;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\Query\QueryFactory;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\language\ConfigurableLanguageManagerInterface;
@@ -66,7 +67,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     /** @var \Drupal\user\UserInterface $account */
     $account = $this->entity;
     $user = $this->currentUser();
@@ -308,7 +309,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function buildEntity(array $form, array &$form_state) {
+  public function buildEntity(array $form, FormStateInterface $form_state) {
     // Change the roles array to a list of enabled roles.
     // @todo: Alter the form state as the form values are directly extracted and
     //   set on the field, which throws an exception as the list requires
@@ -324,7 +325,7 @@ public function buildEntity(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     parent::validate($form, $form_state);
 
     $account = $this->entity;
@@ -391,7 +392,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     parent::submit($form, $form_state);
 
     $user = $this->getEntity($form_state);
diff --git a/core/modules/user/src/AccountSettingsForm.php b/core/modules/user/src/AccountSettingsForm.php
index 94c4bae..7591c81 100644
--- a/core/modules/user/src/AccountSettingsForm.php
+++ b/core/modules/user/src/AccountSettingsForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Extension\ModuleHandler;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -56,9 +57,9 @@ public function getFormId() {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::buildForm().
+   * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('user.settings');
     $mail_config = $this->config('user.mail');
     $site_config = $this->config('system.site');
@@ -405,9 +406,9 @@ public function buildForm(array $form, array &$form_state) {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::submitForm().
+   * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     parent::submitForm($form, $form_state);
 
     $this->config('user.settings')
diff --git a/core/modules/user/src/Form/UserCancelForm.php b/core/modules/user/src/Form/UserCancelForm.php
index 16ba065..79b0a6c 100644
--- a/core/modules/user/src/Form/UserCancelForm.php
+++ b/core/modules/user/src/Form/UserCancelForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\user\Form;
 
 use Drupal\Core\Entity\ContentEntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Provides a confirmation form for cancelling user account.
@@ -71,7 +72,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $user = $this->currentUser();
     $this->cancelMethods = user_cancel_methods();
 
@@ -118,7 +119,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     // Cancel account immediately, if the current user has administrative
     // privileges, no confirmation mail shall be sent, and the user does not
     // attempt to cancel the own account.
diff --git a/core/modules/user/src/Form/UserLoginForm.php b/core/modules/user/src/Form/UserLoginForm.php
index 6300bfc..2fcdd99 100644
--- a/core/modules/user/src/Form/UserLoginForm.php
+++ b/core/modules/user/src/Form/UserLoginForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Flood\FloodInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\user\UserAuthInterface;
 use Drupal\user\UserStorageInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -76,7 +77,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // Display login form:
     $form['name'] = array(
       '#type' => 'textfield',
@@ -114,7 +115,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $account = $this->userStorage->load($form_state['uid']);
 
     // A destination was set, probably on an exception controller,
@@ -134,7 +135,7 @@ public function submitForm(array &$form, array &$form_state) {
   /**
    * Sets an error if supplied username has been blocked.
    */
-  public function validateName(array &$form, array &$form_state) {
+  public function validateName(array &$form, &$form_state) {
     if (!empty($form_state['values']['name']) && user_is_blocked($form_state['values']['name'])) {
       // Blocked in user administration.
       $this->setFormError('name', $form_state, $this->t('The username %name has not been activated or is blocked.', array('%name' => $form_state['values']['name'])));
@@ -146,7 +147,7 @@ public function validateName(array &$form, array &$form_state) {
    *
    * If successful, $form_state['uid'] is set to the matching user ID.
    */
-  public function validateAuthentication(array &$form, array &$form_state) {
+  public function validateAuthentication(array &$form, &$form_state) {
     $password = trim($form_state['values']['pass']);
     $flood_config = $this->config('user.flood');
     if (!empty($form_state['values']['name']) && !empty($password)) {
@@ -193,7 +194,7 @@ public function validateAuthentication(array &$form, array &$form_state) {
    *
    * This validation function should always be the last one.
    */
-  public function validateFinal(array &$form, array &$form_state) {
+  public function validateFinal(array &$form, &$form_state) {
     $flood_config = $this->config('user.flood');
     if (empty($form_state['uid'])) {
       // Always register an IP-based failed login event.
diff --git a/core/modules/user/src/Form/UserMultipleCancelConfirm.php b/core/modules/user/src/Form/UserMultipleCancelConfirm.php
index 7ed11bc..dd5636a 100644
--- a/core/modules/user/src/Form/UserMultipleCancelConfirm.php
+++ b/core/modules/user/src/Form/UserMultipleCancelConfirm.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Form\ConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\UrlGeneratorInterface;
 use Drupal\user\TempStoreFactory;
 use Drupal\user\UserStorageInterface;
@@ -99,7 +100,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // Retrieve the accounts to be canceled from the temp store.
     $accounts = $this->tempStoreFactory
       ->get('user_user_operations_cancel')
@@ -168,7 +169,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $current_user_id = $this->currentUser()->id();
 
     // Clear out the accounts from the temp store.
diff --git a/core/modules/user/src/Form/UserPasswordForm.php b/core/modules/user/src/Form/UserPasswordForm.php
index 672dc11..5905282 100644
--- a/core/modules/user/src/Form/UserPasswordForm.php
+++ b/core/modules/user/src/Form/UserPasswordForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\Plugin\Field\FieldType\EmailItem;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageManager;
 use Drupal\user\UserStorageInterface;
 use Symfony\Component\HttpFoundation\Request;
@@ -69,7 +70,7 @@ public function getFormId() {
    * @param \Symfony\Component\HttpFoundation\Request $request
    *   The request object.
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['name'] = array(
       '#type' => 'textfield',
       '#title' => $this->t('Username or email address'),
@@ -106,7 +107,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $name = trim($form_state['values']['name']);
     // Try to load by email.
     $users = $this->userStorage->loadByProperties(array('mail' => $name, 'status' => '1'));
@@ -126,7 +127,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $langcode = $this->languageManager->getCurrentLanguage()->id;
 
     $account = $form_state['values']['account'];
diff --git a/core/modules/user/src/Form/UserPasswordResetForm.php b/core/modules/user/src/Form/UserPasswordResetForm.php
index ba7c121..41c6e1a 100644
--- a/core/modules/user/src/Form/UserPasswordResetForm.php
+++ b/core/modules/user/src/Form/UserPasswordResetForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Form;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Component\Utility\Crypt;
 use Drupal\Core\Form\FormBase;
@@ -56,8 +57,8 @@ public function getFormID() {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    * @param \Drupal\Core\Session\AccountInterface $user
    *   User requesting reset.
    * @param string $expiration_date
@@ -68,7 +69,7 @@ public function getFormID() {
    * @param string $hash
    *   Login link hash.
    */
-  public function buildForm(array $form, array &$form_state, AccountInterface $user = NULL, $expiration_date = NULL, $timestamp = NULL, $hash = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, AccountInterface $user = NULL, $expiration_date = NULL, $timestamp = NULL, $hash = NULL) {
     if ($expiration_date) {
       $form['message'] = array('#markup' => $this->t('<p>This is a one-time login for %user_name and will expire on %expiration_date.</p><p>Click on this button to log in to the site and change your password.</p>', array('%user_name' => $user->getUsername(), '%expiration_date' => $expiration_date)));
     }
@@ -98,7 +99,7 @@ public function buildForm(array $form, array &$form_state, AccountInterface $use
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     /** @var $user \Drupal\user\UserInterface */
     $user = $form_state['values']['user'];
     user_login_finalize($user);
diff --git a/core/modules/user/src/Form/UserPermissionsForm.php b/core/modules/user/src/Form/UserPermissionsForm.php
index bd4e473..8e5ac1d 100644
--- a/core/modules/user/src/Form/UserPermissionsForm.php
+++ b/core/modules/user/src/Form/UserPermissionsForm.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\user\RoleStorageInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -75,7 +76,7 @@ protected function getRoles() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $role_names = array();
     $role_permissions = array();
     foreach ($this->getRoles() as $role_name => $role) {
@@ -184,7 +185,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  function submitForm(array &$form, array &$form_state) {
+  function submitForm(array &$form, FormStateInterface $form_state) {
     foreach ($form_state['values']['role_names'] as $role_name => $name) {
       user_role_change_permissions($role_name, $form_state['values'][$role_name]);
     }
diff --git a/core/modules/user/src/Form/UserPermissionsRoleSpecificForm.php b/core/modules/user/src/Form/UserPermissionsRoleSpecificForm.php
index 6345a06..3da670d 100644
--- a/core/modules/user/src/Form/UserPermissionsRoleSpecificForm.php
+++ b/core/modules/user/src/Form/UserPermissionsRoleSpecificForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Form;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\user\RoleInterface;
 
 /**
@@ -34,7 +35,7 @@ protected function getRoles() {
    * @param string $role_id
    *   The user role ID used for this form.
    */
-  public function buildForm(array $form, array &$form_state, RoleInterface $user_role = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, RoleInterface $user_role = NULL) {
     $this->userRole = $user_role;
     return parent::buildForm($form, $form_state);
   }
diff --git a/core/modules/user/src/Form/UserRoleDelete.php b/core/modules/user/src/Form/UserRoleDelete.php
index fa5d3c1..f9e7a75 100644
--- a/core/modules/user/src/Form/UserRoleDelete.php
+++ b/core/modules/user/src/Form/UserRoleDelete.php
@@ -8,6 +8,7 @@
 namespace Drupal\user\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -39,7 +40,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->entity->delete();
     watchdog('user', 'Role %name has been deleted.', array('%name' => $this->entity->label()));
     drupal_set_message($this->t('Role %name has been deleted.', array('%name' => $this->entity->label())));
diff --git a/core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php b/core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php
index f844743..c6fb44a 100644
--- a/core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php
+++ b/core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Action\ConfigurableActionBase;
 use Drupal\Core\Entity\DependencyTrait;
 use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -59,7 +60,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $roles = user_role_names(TRUE);
     unset($roles[DRUPAL_AUTHENTICATED_RID]);
     $form['rid'] = array(
@@ -75,7 +76,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['rid'] = $form_state['values']['rid'];
   }
 
diff --git a/core/modules/user/src/Plugin/Condition/UserRole.php b/core/modules/user/src/Plugin/Condition/UserRole.php
index 872b18a..5400d4e 100644
--- a/core/modules/user/src/Plugin/Condition/UserRole.php
+++ b/core/modules/user/src/Plugin/Condition/UserRole.php
@@ -8,6 +8,7 @@
 namespace Drupal\user\Plugin\Condition;
 
 use Drupal\Core\Condition\ConditionPluginBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\Context\ContextDefinition;
 
 /**
@@ -27,7 +28,7 @@ class UserRole extends ConditionPluginBase {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form['roles'] = array(
       '#type' => 'checkboxes',
       '#title' => $this->t('When the user has the following roles'),
@@ -50,7 +51,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function submitConfigurationForm(array &$form, array &$form_state) {
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
     $this->configuration['roles'] = array_filter($form_state['values']['roles']);
     parent::submitConfigurationForm($form, $form_state);
   }
diff --git a/core/modules/user/src/Plugin/views/filter/Name.php b/core/modules/user/src/Plugin/views/filter/Name.php
index 0d1b5fc..dd38820 100644
--- a/core/modules/user/src/Plugin/views/filter/Name.php
+++ b/core/modules/user/src/Plugin/views/filter/Name.php
@@ -108,7 +108,7 @@ public function validateExposed(&$form, &$form_state) {
    * or the exposed filter, this is abstracted out a bit so it can
    * handle the multiple input sources.
    */
-  function validate_user_strings(&$form, array &$form_state, $values) {
+  function validate_user_strings(&$form, &$form_state, $values) {
     $uids = array();
     $placeholders = array();
     $args = array();
diff --git a/core/modules/user/src/ProfileForm.php b/core/modules/user/src/ProfileForm.php
index fbe7665..e9edf60 100644
--- a/core/modules/user/src/ProfileForm.php
+++ b/core/modules/user/src/ProfileForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\Query\QueryFactory;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageManager;
 
 /**
@@ -26,7 +27,7 @@ public function __construct(EntityManagerInterface $entity_manager, LanguageMana
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $element = parent::actions($form, $form_state);
 
     // The user account being edited.
@@ -45,7 +46,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $account = $this->entity;
     $account->save();
     $form_state['values']['uid'] = $account->id();
diff --git a/core/modules/user/src/ProfileTranslationHandler.php b/core/modules/user/src/ProfileTranslationHandler.php
index c332d83..842cc53 100644
--- a/core/modules/user/src/ProfileTranslationHandler.php
+++ b/core/modules/user/src/ProfileTranslationHandler.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\content_translation\ContentTranslationHandler;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Defines the translation handler for users.
@@ -18,7 +19,7 @@ class ProfileTranslationHandler extends ContentTranslationHandler {
   /**
    * {@inheritdoc}
    */
-  public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) {
+  public function entityFormAlter(array &$form, FormStateInterface $form_state, EntityInterface $entity) {
     parent::entityFormAlter($form, $form_state, $entity);
     $form['actions']['submit']['#submit'][] = array($this, 'entityFormSave');
   }
@@ -30,7 +31,7 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac
    *
    * @see \Drupal\Core\Entity\EntityForm::build().
    */
-  function entityFormSave(array $form, array &$form_state) {
+  function entityFormSave(array $form, &$form_state) {
     if ($this->getSourceLangcode($form_state)) {
       $entity = content_translation_form_controller($form_state)->getEntity();
       // We need a redirect here, otherwise we would get an access denied page
diff --git a/core/modules/user/src/RegisterForm.php b/core/modules/user/src/RegisterForm.php
index ddbbcc0..f3f2511 100644
--- a/core/modules/user/src/RegisterForm.php
+++ b/core/modules/user/src/RegisterForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\Query\QueryFactory;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageManager;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 
@@ -25,9 +26,9 @@ public function __construct(EntityManagerInterface $entity_manager, LanguageMana
   }
 
   /**
-   * Overrides Drupal\Core\Entity\EntityForm::form().
+   * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $user = $this->currentUser();
     /** @var \Drupal\user\UserInterface $account */
     $account = $this->entity;
@@ -71,7 +72,7 @@ public function form(array $form, array &$form_state) {
   /**
    * Overrides Drupal\Core\Entity\EntityForm::actions().
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $element = parent::actions($form, $form_state);
     $element['submit']['#value'] = $this->t('Create new account');
     return $element;
@@ -80,7 +81,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * Overrides Drupal\Core\Entity\EntityForm::submit().
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $admin = $form_state['values']['administer_users'];
 
     if (!\Drupal::config('user.settings')->get('verify_mail') || $admin) {
@@ -102,7 +103,7 @@ public function submit(array $form, array &$form_state) {
   /**
    * Overrides Drupal\Core\Entity\EntityForm::submit().
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $account = $this->entity;
     $pass = $account->getPassword();
     $admin = $form_state['values']['administer_users'];
diff --git a/core/modules/user/src/RoleForm.php b/core/modules/user/src/RoleForm.php
index 1961a75..0587041 100644
--- a/core/modules/user/src/RoleForm.php
+++ b/core/modules/user/src/RoleForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityForm;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form controller for the role entity edit forms.
@@ -18,7 +19,7 @@ class RoleForm extends EntityForm {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $entity = $this->entity;
     $form['label'] = array(
       '#type' => 'textfield',
@@ -51,7 +52,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function save(array $form, array &$form_state) {
+  public function save(array $form, FormStateInterface $form_state) {
     $entity = $this->entity;
 
     // Prevent leading and trailing spaces in role names.
diff --git a/core/modules/user/src/RoleListBuilder.php b/core/modules/user/src/RoleListBuilder.php
index afe8d7b..8e7feec 100644
--- a/core/modules/user/src/RoleListBuilder.php
+++ b/core/modules/user/src/RoleListBuilder.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Config\Entity\DraggableListBuilder;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Defines a class to build a listing of user role entities.
@@ -58,7 +59,7 @@ public function getDefaultOperations(EntityInterface $entity) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     parent::submitForm($form, $form_state);
 
     drupal_set_message(t('The role settings have been updated.'));
diff --git a/core/modules/user/src/Tests/UserAccountFormFieldsTest.php b/core/modules/user/src/Tests/UserAccountFormFieldsTest.php
index b560a0c..47849b9 100644
--- a/core/modules/user/src/Tests/UserAccountFormFieldsTest.php
+++ b/core/modules/user/src/Tests/UserAccountFormFieldsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Tests;
 
+use Drupal\Core\Form\FormState;
 use Drupal\simpletest\DrupalUnitTestBase;
 
 /**
@@ -30,7 +31,7 @@ class UserAccountFormFieldsTest extends DrupalUnitTestBase {
   function testInstallConfigureForm() {
     require_once DRUPAL_ROOT . '/core/includes/install.core.inc';
     $install_state = install_state_defaults();
-    $form_state = array();
+    $form_state = new FormState();
     $form_state['build_info']['args'][] = &$install_state;
     $form = $this->container->get('form_builder')
       ->buildForm('Drupal\Core\Installer\Form\SiteConfigureForm', $form_state);
diff --git a/core/modules/user/tests/modules/user_form_test/src/Form/TestCurrentPassword.php b/core/modules/user/tests/modules/user_form_test/src/Form/TestCurrentPassword.php
index 1acbea5..b01fc79 100644
--- a/core/modules/user/tests/modules/user_form_test/src/Form/TestCurrentPassword.php
+++ b/core/modules/user/tests/modules/user_form_test/src/Form/TestCurrentPassword.php
@@ -8,6 +8,7 @@
 namespace Drupal\user_form_test\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\user\UserInterface;
 
 /**
@@ -28,7 +29,7 @@ public function getFormId() {
    * @param \Drupal\user\Entity\UserInterface $user
    *   The user account.
    */
-  public function buildForm(array $form, array &$form_state, UserInterface $user = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, UserInterface $user = NULL) {
     $form_state['user'] = $user ;
     $form['user_form_test_field'] = array(
       '#type' => 'textfield',
@@ -60,7 +61,7 @@ public function buildForm(array $form, array &$form_state, UserInterface $user =
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     drupal_set_message($this->t('The password has been validated and the form submitted successfully.'));
   }
 
diff --git a/core/modules/views/includes/ajax.inc b/core/modules/views/includes/ajax.inc
index 84c33eb..b703c32 100644
--- a/core/modules/views/includes/ajax.inc
+++ b/core/modules/views/includes/ajax.inc
@@ -16,14 +16,12 @@
  */
 function views_ajax_form_wrapper($form_class, &$form_state) {
   // This won't override settings already in.
-  $form_state += array(
-    'rerender' => FALSE,
-    'no_redirect' => !empty($form_state['ajax']),
-    'no_cache' => TRUE,
-    'build_info' => array(
-      'args' => array(),
-    ),
-  );
+  $form_state->setIfNotExists('rerender', FALSE);
+  $form_state->setIfNotExists('no_redirect', !empty($form_state['ajax']));
+  $form_state->setIfNotExists('no_cache', TRUE);
+  $form_state->setIfNotExists('build_info', array(
+    'args' => array(),
+  ));
 
   $form = \Drupal::formBuilder()->buildForm($form_class, $form_state);
   $output = drupal_render($form);
diff --git a/core/modules/views/src/Form/ViewsExposedForm.php b/core/modules/views/src/Form/ViewsExposedForm.php
index ae3da03..2c78f5f 100644
--- a/core/modules/views/src/Form/ViewsExposedForm.php
+++ b/core/modules/views/src/Form/ViewsExposedForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ExposedFormCache;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -51,7 +52,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     // Don't show the form when batch operations are in progress.
     if ($batch = batch_get() && isset($batch['current_set'])) {
       return array(
@@ -131,7 +132,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     foreach (array('field', 'filter') as $type) {
       /** @var \Drupal\views\Plugin\views\HandlerBase[] $handlers */
       $handlers = &$form_state['view']->$type;
@@ -147,7 +148,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     foreach (array('field', 'filter') as $type) {
       /** @var \Drupal\views\Plugin\views\HandlerBase[] $handlers */
       $handlers = &$form_state['view']->$type;
diff --git a/core/modules/views/src/Form/ViewsForm.php b/core/modules/views/src/Form/ViewsForm.php
index 02bf7cb..ac88a11 100644
--- a/core/modules/views/src/Form/ViewsForm.php
+++ b/core/modules/views/src/Form/ViewsForm.php
@@ -13,6 +13,7 @@
 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
 use Drupal\Core\DependencyInjection\DependencySerializationTrait;
 use Drupal\Core\Form\FormInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\UrlGeneratorInterface;
 use Drupal\views\ViewExecutable;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -115,7 +116,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, ViewExecutable $view = NULL, $output = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, ViewExecutable $view = NULL, $output = NULL) {
     $form_state['step'] = isset($form_state['step']) ? $form_state['step'] : 'views_form_views_form';
     $form_state['step_controller']['views_form_views_form'] = 'Drupal\views\Form\ViewsFormMainForm';
 
@@ -146,7 +147,7 @@ public function buildForm(array $form, array &$form_state, ViewExecutable $view
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $form_object = $this->getFormObject($form_state);
     $form_object->validateForm($form, $form_state);
   }
@@ -154,7 +155,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_object = $this->getFormObject($form_state);
     $form_object->submitForm($form, $form_state);
   }
@@ -162,13 +163,13 @@ public function submitForm(array &$form, array &$form_state) {
   /**
    * Returns the object used to build the step form.
    *
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form_state of the current form.
    *
    * @return \Drupal\Core\Form\FormInterface
    *   The form object to use.
    */
-  protected function getFormObject(array $form_state) {
+  protected function getFormObject($form_state) {
     // If this is a class, instantiate it.
     $form_step_class = isset($form_state['step_controller'][$form_state['step']]) ? $form_state['step_controller'][$form_state['step']] : 'Drupal\views\Form\ViewsFormMainForm';
     return $this->classResolver->getInstanceFromDefinition($form_step_class);
diff --git a/core/modules/views/src/Form/ViewsFormMainForm.php b/core/modules/views/src/Form/ViewsFormMainForm.php
index 98cdc4f..6c48b7e 100644
--- a/core/modules/views/src/Form/ViewsFormMainForm.php
+++ b/core/modules/views/src/Form/ViewsFormMainForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Form;
 
 use Drupal\Core\Form\FormInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 
 class ViewsFormMainForm implements FormInterface {
@@ -21,7 +22,7 @@ public function getFormID() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, ViewExecutable $view = NULL, $output = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, ViewExecutable $view = NULL, $output = NULL) {
     $form['#prefix'] = '<div class="views-form">';
     $form['#suffix'] = '</div>';
     $form['#theme'] = 'form';
@@ -106,7 +107,7 @@ public function buildForm(array $form, array &$form_state, ViewExecutable $view
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $view = $form_state['build_info']['args'][0];
 
     // Call the validation method on every field handler that has it.
@@ -129,7 +130,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $view = $form_state['build_info']['args'][0];
 
     // Call the submit method on every field handler that has it.
diff --git a/core/modules/views/src/Plugin/Block/ViewsBlock.php b/core/modules/views/src/Plugin/Block/ViewsBlock.php
index a80aa97..9e5bc99 100644
--- a/core/modules/views/src/Plugin/Block/ViewsBlock.php
+++ b/core/modules/views/src/Plugin/Block/ViewsBlock.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Config\Entity\Query\Query;
 use Drupal\Component\Utility\Xss;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -78,7 +79,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function blockForm($form, &$form_state) {
+  public function blockForm($form, FormStateInterface $form_state) {
     if ($this->displaySet) {
       return $this->view->display_handler->blockForm($this, $form, $form_state);
     }
@@ -89,7 +90,7 @@ public function blockForm($form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function blockValidate($form, &$form_state) {
+  public function blockValidate($form, FormStateInterface $form_state) {
     if ($this->displaySet) {
       $this->view->display_handler->blockValidate($this, $form, $form_state);
     }
@@ -98,7 +99,7 @@ public function blockValidate($form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function blockSubmit($form, &$form_state) {
+  public function blockSubmit($form, FormStateInterface $form_state) {
     parent::blockSubmit($form, $form_state);
     if ($this->displaySet) {
       $this->view->display_handler->blockSubmit($this, $form, $form_state);
diff --git a/core/modules/views/src/Plugin/Block/ViewsBlockBase.php b/core/modules/views/src/Plugin/Block/ViewsBlockBase.php
index 5a63e76..1d4dd98 100644
--- a/core/modules/views/src/Plugin/Block/ViewsBlockBase.php
+++ b/core/modules/views/src/Plugin/Block/ViewsBlockBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\Block;
 
 use Drupal\block\BlockBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\views\ViewExecutableFactory;
 use Drupal\Core\Entity\EntityStorageInterface;
@@ -105,7 +106,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function buildConfigurationForm(array $form, array &$form_state) {
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     $form = parent::buildConfigurationForm($form, $form_state);
 
     // Set the default label to '' so the views internal title is used.
@@ -163,7 +164,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function blockSubmit($form, &$form_state) {
+  public function blockSubmit($form, FormStateInterface $form_state) {
     if (!empty($form_state['values']['views_label_checkbox'])) {
       $this->configuration['views_label'] = $form_state['values']['views_label'];
     }
diff --git a/core/modules/views/src/Plugin/entity_reference/selection/ViewsSelection.php b/core/modules/views/src/Plugin/entity_reference/selection/ViewsSelection.php
index aa84db2..aa8294a 100644
--- a/core/modules/views/src/Plugin/entity_reference/selection/ViewsSelection.php
+++ b/core/modules/views/src/Plugin/entity_reference/selection/ViewsSelection.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Database\Query\SelectInterface;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\entity_reference\Plugin\Type\Selection\SelectionInterface;
 use Drupal\views\Views;
 
@@ -203,7 +204,7 @@ public function validateReferenceableEntities(array $ids) {
   /**
    * {@inheritdoc}
    */
-  public function validateAutocompleteInput($input, &$element, &$form_state, $form, $strict = TRUE) {
+  public function validateAutocompleteInput($input, &$element, FormStateInterface $form_state, $form, $strict = TRUE) {
     return NULL;
   }
 
@@ -215,7 +216,7 @@ public function entityQueryAlter(SelectInterface $query) {}
   /**
    * Element validate; Check View is valid.
    */
-  public function settingsFormValidate($element, &$form_state, $form) {
+  public function settingsFormValidate($element, FormStateInterface $form_state, $form) {
     // Split view name and display name from the 'view_and_display' value.
     if (!empty($element['view_and_display']['#value'])) {
       list($view, $display) = explode(':', $element['view_and_display']['#value']);
diff --git a/core/modules/views/src/Plugin/views/PluginBase.php b/core/modules/views/src/Plugin/views/PluginBase.php
index f19520a..a8c7aa5 100644
--- a/core/modules/views/src/Plugin/views/PluginBase.php
+++ b/core/modules/views/src/Plugin/views/PluginBase.php
@@ -336,7 +336,7 @@ public function getAvailableGlobalTokens($prepared = FALSE, array $types = array
    *
    * @param array $form
    *   The form array to alter, passed by reference.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state array to alter, passed by reference.
    */
   public function globalTokenForm(&$form, &$form_state) {
diff --git a/core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php b/core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php
index 8d98744..5cefa99 100644
--- a/core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php
+++ b/core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\exposed_form;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormState;
 use Drupal\views\Form\ViewsExposedForm;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -127,14 +128,14 @@ public function buildOptionsForm(&$form, &$form_state) {
    */
   public function renderExposedForm($block = FALSE) {
     // Deal with any exposed filters we may have, before building.
-    $form_state = array(
+    $form_state = new FormState(array(
       'view' => &$this->view,
       'display' => &$this->view->display_handler->display,
       'method' => 'get',
       'rerender' => TRUE,
       'no_redirect' => TRUE,
       'always_process' => TRUE,
-    );
+    ));
 
     // Some types of displays (eg. attachments) may wish to use the exposed
     // filters of their parent displays instead of showing an additional
diff --git a/core/modules/views/src/Plugin/views/filter/Date.php b/core/modules/views/src/Plugin/views/filter/Date.php
index 52ea7ce..e0776a8 100644
--- a/core/modules/views/src/Plugin/views/filter/Date.php
+++ b/core/modules/views/src/Plugin/views/filter/Date.php
@@ -79,7 +79,7 @@ public function validateExposed(&$form, &$form_state) {
   /**
    * Validate that the time values convert to something usable.
    */
-  public function validateValidTime(&$form, array &$form_state, $operator, $value) {
+  public function validateValidTime(&$form, &$form_state, $operator, $value) {
     $operators = $this->operators();
 
     if ($operators[$operator]['values'] == 1) {
diff --git a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
index 30d702d..8d25581 100644
--- a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
+++ b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
@@ -331,7 +331,9 @@ protected function showValueForm(&$form, &$form_state) {
    *
    * @see buildOptionsForm()
    */
-  protected function valueForm(&$form, &$form_state) { $form['value'] = array(); }
+  protected function valueForm(&$form, &$form_state) {
+    $form['value'] = array();
+  }
 
   /**
    * Validate the options form.
diff --git a/core/modules/views/src/Plugin/views/style/StylePluginBase.php b/core/modules/views/src/Plugin/views/style/StylePluginBase.php
index c02cb1c..399cd31 100644
--- a/core/modules/views/src/Plugin/views/style/StylePluginBase.php
+++ b/core/modules/views/src/Plugin/views/style/StylePluginBase.php
@@ -352,8 +352,8 @@ public function validateOptionsForm(&$form, &$form_state) {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    * @param string $type
    *    The display type, either block or page.
    */
@@ -365,8 +365,8 @@ public function wizardForm(&$form, &$form_state, $type) {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    * @param \Drupal\views\Plugin\views\wizard\WizardInterface $wizard
    *   The current used wizard.
    * @param array $display_options
diff --git a/core/modules/views/src/Plugin/views/wizard/WizardInterface.php b/core/modules/views/src/Plugin/views/wizard/WizardInterface.php
index 6e1a548..893afee 100644
--- a/core/modules/views/src/Plugin/views/wizard/WizardInterface.php
+++ b/core/modules/views/src/Plugin/views/wizard/WizardInterface.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\wizard;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Defines a common interface for Views Wizard plugins.
  *
@@ -22,34 +24,34 @@
    *
    * @param array $form
    *   The full wizard form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the wizard form.
    *
    * @return array
    *   Returns the changed wizard form.
    */
-  public function buildForm(array $form, array &$form_state);
+  public function buildForm(array $form, FormStateInterface $form_state);
 
   /**
    * Validate form and values.
    *
    * @param array $form
    *   The full wizard form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the wizard form.
    *
    * @return array
    *   An empty array if the view is valid; an array of error strings if it is
    *   not.
    */
-  public function validateView(array $form, array &$form_state);
+  public function validateView(array $form, FormStateInterface $form_state);
 
   /**
    * Creates a view from values that have already been validated.
    *
    * @param array $form
    *   The full wizard form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the wizard form.
    *
    * @return \Drupal\views\ViewStorageInterface
@@ -57,6 +59,6 @@ public function validateView(array $form, array &$form_state);
    *
    * @throws \Drupal\views\Plugin\views\wizard\WizardException
    */
-  public function createView(array $form, array &$form_state);
+  public function createView(array $form, FormStateInterface $form_state);
 
 }
diff --git a/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php b/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php
index 6d5e3fa..3f6d421 100644
--- a/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php
+++ b/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\wizard;
 
 use Drupal\Component\Utility\NestedArray;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Entity\View;
 use Drupal\views\Views;
 use Drupal\views_ui\ViewUI;
@@ -214,7 +215,7 @@ public function getSorts() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $style_options = Views::fetchPluginNames('style', 'normal', array($this->base_table));
     $feed_row_options = Views::fetchPluginNames('row', 'feed', array($this->base_table));
     $path_prefix = url(NULL, array('absolute' => TRUE));
@@ -524,12 +525,12 @@ public static function getSelected($form_state, $parents, $default_value, $eleme
    *
    * @param array $form
    *   The full wizard form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the wizard form.
    * @param string $type
    *   The display ID (e.g. 'page' or 'block').
    */
-  protected function buildFormStyle(array &$form, array &$form_state, $type) {
+  protected function buildFormStyle(array &$form, FormStateInterface $form_state, $type) {
     $style_form = &$form['displays'][$type]['options']['style'];
     $style = $style_form['style_plugin']['#default_value'];
     $style_plugin = Views::pluginManager('style')->createInstance($style);
@@ -578,7 +579,7 @@ protected function rowStyleOptions() {
    * By default, this adds "of type" and "tagged with" filters (when they are
    * available).
    */
-  protected function buildFilters(&$form, &$form_state) {
+  protected function buildFilters(&$form, FormStateInterface $form_state) {
     module_load_include('inc', 'views_ui', 'admin');
 
     $bundles = entity_get_bundles($this->entityTypeId);
@@ -822,7 +823,7 @@ protected function defaultDisplayOptions() {
    *
    * @param array $form
    *   The full wizard form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the wizard form.
    *
    * @return array
@@ -848,14 +849,14 @@ protected function defaultDisplayFilters($form, $form_state) {
    *
    * @param array $form
    *   The full wizard form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the wizard form.
    *
    * @return array
    *   An array of filter arrays keyed by ID. A sort array contains the options
    *   accepted by a filter handler.
    */
-  protected function defaultDisplayFiltersUser(array $form, array &$form_state) {
+  protected function defaultDisplayFiltersUser(array $form, &$form_state) {
     $filters = array();
 
     if (!empty($form_state['values']['show']['type']) && $form_state['values']['show']['type'] != 'all') {
@@ -907,7 +908,7 @@ protected function defaultDisplayFiltersUser(array $form, array &$form_state) {
    *
    * @param array $form
    *   The full wizard form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the wizard form.
    *
    * @return array
@@ -933,7 +934,7 @@ protected function defaultDisplaySorts($form, $form_state) {
    *
    * @param array $form
    *   The full wizard form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the wizard form.
    *
    * @return array
@@ -981,13 +982,13 @@ protected function defaultDisplaySortsUser($form, $form_state) {
    *
    * @param array $form
    *   The full wizard form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the wizard form.
    *
    * @return array
    *   Returns an array of display options.
    */
-  protected function pageDisplayOptions(array $form, array &$form_state) {
+  protected function pageDisplayOptions(array $form, &$form_state) {
     $display_options = array();
     $page = $form_state['values']['page'];
     $display_options['title'] = $page['title'];
@@ -1027,13 +1028,13 @@ protected function pageDisplayOptions(array $form, array &$form_state) {
    *
    * @param array $form
    *   The full wizard form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the wizard form.
    *
    * @return array
    *   Returns an array of display options.
    */
-  protected function blockDisplayOptions(array $form, array &$form_state) {
+  protected function blockDisplayOptions(array $form, &$form_state) {
     $display_options = array();
     $block = $form_state['values']['block'];
     $display_options['title'] = $block['title'];
@@ -1049,7 +1050,7 @@ protected function blockDisplayOptions(array $form, array &$form_state) {
    *
    * @param array $form
    *   The full wizard form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the wizard form.
    *
    * @return array
@@ -1143,7 +1144,7 @@ protected function setOverrideOptions(array $options, DisplayPluginBase $display
    *
    * @param array $form
    *   The full wizard form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the wizard form.
    * @param bool $unset
    *   Should the view be removed from the list of validated views.
@@ -1151,7 +1152,7 @@ protected function setOverrideOptions(array $options, DisplayPluginBase $display
    * @return \Drupal\views_ui\ViewUI $view
    *   The validated view object.
    */
-  protected function retrieveValidatedView(array $form, array &$form_state, $unset = TRUE) {
+  protected function retrieveValidatedView(array $form, FormStateInterface $form_state, $unset = TRUE) {
     // @todo Figure out why all this hashing is done. Wouldn't it be easier to
     //   store a single entry and that's it?
     $key = hash('sha256', serialize($form_state['values']));
@@ -1167,12 +1168,12 @@ protected function retrieveValidatedView(array $form, array &$form_state, $unset
    *
    * @param array $form
    *   The full wizard form array.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the wizard form.
    * @param \Drupal\views_ui\ViewUI $view
    *   The validated view object.
    */
-  protected function setValidatedView(array $form, array &$form_state, ViewUI $view) {
+  protected function setValidatedView(array $form, &$form_state, ViewUI $view) {
     $key = hash('sha256', serialize($form_state['values']));
     $this->validated_views[$key] = $view;
   }
@@ -1182,7 +1183,7 @@ protected function setValidatedView(array $form, array &$form_state, ViewUI $vie
    *
    * Instantiates the view from the form submission and validates its values.
    */
-  public function validateView(array $form, array &$form_state) {
+  public function validateView(array $form, FormStateInterface $form_state) {
     $view = $this->instantiateView($form, $form_state);
     $errors = $view->getExecutable()->validate();
 
@@ -1196,7 +1197,7 @@ public function validateView(array $form, array &$form_state) {
   /**
    * {@inheritDoc}
    */
-  public function createView(array $form, array &$form_state) {
+  public function createView(array $form, FormStateInterface $form_state) {
     $view = $this->retrieveValidatedView($form, $form_state);
     if (empty($view)) {
       throw new WizardException('Attempted to create a view with values that have not been validated.');
diff --git a/core/modules/views/src/Tests/Wizard/WizardPluginBaseUnitTest.php b/core/modules/views/src/Tests/Wizard/WizardPluginBaseUnitTest.php
index 37880d4..a121e70 100644
--- a/core/modules/views/src/Tests/Wizard/WizardPluginBaseUnitTest.php
+++ b/core/modules/views/src/Tests/Wizard/WizardPluginBaseUnitTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests\Wizard;
 
+use Drupal\Core\Form\FormState;
 use Drupal\Core\Language\Language;
 use Drupal\views\Tests\ViewUnitTestBase;
 use Drupal\views_ui\ViewUI;
@@ -50,7 +51,7 @@ protected function setUp() {
    */
   public function testCreateView() {
     $form = array();
-    $form_state = array();
+    $form_state = new FormState();
     $form = $this->wizard->buildForm($form, $form_state);
     $random_id = strtolower($this->randomName());
     $random_label = $this->randomName();
diff --git a/core/modules/views/tests/modules/views_test_data/src/Form/ViewsTestDataElementForm.php b/core/modules/views/tests/modules/views_test_data/src/Form/ViewsTestDataElementForm.php
index 8088559..27f7160 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Form/ViewsTestDataElementForm.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Form/ViewsTestDataElementForm.php
@@ -7,6 +7,7 @@
 namespace Drupal\views_test_data\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Simple form page callback to test the view element.
@@ -23,7 +24,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form['view'] = array(
       '#type' => 'view',
       '#name' => 'test_view',
@@ -37,7 +38,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/views_ui/src/Form/AdvancedSettingsForm.php b/core/modules/views_ui/src/Form/AdvancedSettingsForm.php
index 9ba103d..b84eb29 100644
--- a/core/modules/views_ui/src/Form/AdvancedSettingsForm.php
+++ b/core/modules/views_ui/src/Form/AdvancedSettingsForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\views_ui\Form;
 
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Views;
 
 /**
@@ -25,7 +26,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form = parent::buildForm($form, $form_state);
 
     $config = $this->config('views.settings');
@@ -90,7 +91,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('views.settings')
       ->set('skip_cache', $form_state['values']['skip_cache'])
       ->set('sql_signature', $form_state['values']['sql_signature'])
diff --git a/core/modules/views_ui/src/Form/Ajax/AddHandler.php b/core/modules/views_ui/src/Form/Ajax/AddHandler.php
index 95b3fd0..4b69e93 100644
--- a/core/modules/views_ui/src/Form/Ajax/AddHandler.php
+++ b/core/modules/views_ui/src/Form/Ajax/AddHandler.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Form\Ajax;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\ViewStorageInterface;
 use Drupal\views\Views;
@@ -48,7 +49,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $view = $form_state['view'];
     $display_id = $form_state['display_id'];
     $type = $form_state['type'];
diff --git a/core/modules/views_ui/src/Form/Ajax/Analyze.php b/core/modules/views_ui/src/Form/Ajax/Analyze.php
index 41a7d94..23840cb 100644
--- a/core/modules/views_ui/src/Form/Ajax/Analyze.php
+++ b/core/modules/views_ui/src/Form/Ajax/Analyze.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Form\Ajax;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Views;
 use Drupal\views_ui\ViewUI;
 use Drupal\views\Analyzer;
@@ -33,7 +34,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $view = $form_state['view'];
 
     $form['#title'] = $this->t('View analysis');
@@ -57,7 +58,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     /** @var $view \Drupal\views_ui\ViewUI */
     $view = $form_state['view'];
     $form_state['redirect_route'] = $view->urlInfo('edit-form');
diff --git a/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php b/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php
index 8533e69..3898b18 100644
--- a/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php
+++ b/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Form\Ajax;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewStorageInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Views;
@@ -50,7 +51,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $view = $form_state['view'];
     $display_id = $form_state['display_id'];
     $type = $form_state['type'];
@@ -189,7 +190,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $form_state['handler']->validateOptionsForm($form['options'], $form_state);
 
     if (form_get_errors($form_state)) {
@@ -200,7 +201,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Run it through the handler's submit function.
     $form_state['handler']->submitOptionsForm($form['options'], $form_state);
     $item = $form_state['handler']->options;
diff --git a/core/modules/views_ui/src/Form/Ajax/ConfigHandlerExtra.php b/core/modules/views_ui/src/Form/Ajax/ConfigHandlerExtra.php
index 02ed828..16bc230 100644
--- a/core/modules/views_ui/src/Form/Ajax/ConfigHandlerExtra.php
+++ b/core/modules/views_ui/src/Form/Ajax/ConfigHandlerExtra.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Form\Ajax;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewStorageInterface;
 use Drupal\views\ViewExecutable;
 
@@ -49,7 +50,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $view = $form_state['view'];
     $display_id = $form_state['display_id'];
     $type = $form_state['type'];
@@ -92,14 +93,14 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $form_state['handler']->validateExtraOptionsForm($form['options'], $form_state);
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     // Run it through the handler's submit function.
     $form_state['handler']->submitExtraOptionsForm($form['options'], $form_state);
     $item = $form_state['handler']->options;
diff --git a/core/modules/views_ui/src/Form/Ajax/ConfigHandlerGroup.php b/core/modules/views_ui/src/Form/Ajax/ConfigHandlerGroup.php
index f00d26f..fba13ea 100644
--- a/core/modules/views_ui/src/Form/Ajax/ConfigHandlerGroup.php
+++ b/core/modules/views_ui/src/Form/Ajax/ConfigHandlerGroup.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Form\Ajax;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Views;
 use Drupal\views\ViewStorageInterface;
 use Drupal\views\ViewExecutable;
@@ -50,7 +51,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $view = $form_state['view'];
     $display_id = $form_state['display_id'];
     $type = $form_state['type'];
@@ -95,7 +96,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $item = &$form_state['handler']->options;
     $type = $form_state['type'];
 
diff --git a/core/modules/views_ui/src/Form/Ajax/Display.php b/core/modules/views_ui/src/Form/Ajax/Display.php
index c2dbad6..c653fc1 100644
--- a/core/modules/views_ui/src/Form/Ajax/Display.php
+++ b/core/modules/views_ui/src/Form/Ajax/Display.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Form\Ajax;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewStorageInterface;
 
 /**
@@ -35,9 +36,9 @@ public function getFormKey() {
    *   $form_state['type'].
    */
   public function getFormState(ViewStorageInterface $view, $display_id, $js) {
-    return array(
-      'section' => $this->type,
-    ) + parent::getFormState($view, $display_id, $js);
+    $form_state = parent::getFormState($view, $display_id, $js);
+    $form_state['section'] = $this->type;
+    return $form_state;
   }
 
   /**
@@ -58,7 +59,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $view = $form_state['view'];
     $display_id = $form_state['display_id'];
 
@@ -95,7 +96,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     $form_state['view']->getExecutable()->displayHandlers->get($form_state['display_id'])->validateOptionsForm($form['options'], $form_state);
 
     if (form_get_errors($form_state)) {
@@ -106,7 +107,7 @@ public function validateForm(array &$form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state['view']->getExecutable()->displayHandlers->get($form_state['display_id'])->submitOptionsForm($form['options'], $form_state);
 
     $form_state['view']->cacheSet();
diff --git a/core/modules/views_ui/src/Form/Ajax/EditDetails.php b/core/modules/views_ui/src/Form/Ajax/EditDetails.php
index 6269af1..f6684a2 100644
--- a/core/modules/views_ui/src/Form/Ajax/EditDetails.php
+++ b/core/modules/views_ui/src/Form/Ajax/EditDetails.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Form\Ajax;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Views;
 use Drupal\views_ui\ViewUI;
 
@@ -32,7 +33,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $view = $form_state['view'];
 
     $form['#title'] = $this->t('Name and description');
@@ -73,7 +74,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $view = $form_state['view'];
     foreach ($form_state['values'] as $key => $value) {
       // Only save values onto the view if they're actual view properties
diff --git a/core/modules/views_ui/src/Form/Ajax/Rearrange.php b/core/modules/views_ui/src/Form/Ajax/Rearrange.php
index 86b3274..5e3d709 100644
--- a/core/modules/views_ui/src/Form/Ajax/Rearrange.php
+++ b/core/modules/views_ui/src/Form/Ajax/Rearrange.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Form\Ajax;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewStorageInterface;
 use Drupal\views\ViewExecutable;
 
@@ -47,7 +48,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $view = $form_state['view'];
     $display_id = $form_state['display_id'];
     $type = $form_state['type'];
@@ -134,7 +135,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $types = ViewExecutable::getHandlerTypes();
     $display = &$form_state['view']->getExecutable()->displayHandlers->get($form_state['display_id']);
 
diff --git a/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php b/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php
index e15e440..54ba06e 100644
--- a/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php
+++ b/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php
@@ -8,6 +8,7 @@
 namespace Drupal\views_ui\Form\Ajax;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views_ui\ViewUI;
 use Drupal\views\ViewExecutable;
 
@@ -33,7 +34,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $view = $form_state['view'];
     $display_id = $form_state['display_id'];
     $type = 'filter';
@@ -213,7 +214,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $types = ViewExecutable::getHandlerTypes();
     $display = &$form_state['view']->getExecutable()->displayHandlers->get($form_state['display_id']);
     $remember_groups = array();
diff --git a/core/modules/views_ui/src/Form/Ajax/ReorderDisplays.php b/core/modules/views_ui/src/Form/Ajax/ReorderDisplays.php
index 61e5693..d9bfd29 100644
--- a/core/modules/views_ui/src/Form/Ajax/ReorderDisplays.php
+++ b/core/modules/views_ui/src/Form/Ajax/ReorderDisplays.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Form\Ajax;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views_ui\ViewUI;
 
 /**
@@ -31,7 +32,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     /** @var $view \Drupal\views\ViewStorageInterface */
     $view = $form_state['view'];
     $display_id = $form_state['display_id'];
@@ -148,7 +149,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     /** @var $view \Drupal\views_ui\ViewUI */
     $view = $form_state['view'];
     $order = array();
diff --git a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
index ecf8973..2fd382d 100644
--- a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
+++ b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
@@ -8,6 +8,8 @@
 namespace Drupal\views_ui\Form\Ajax;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormState;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewStorageInterface;
 use Drupal\views\Ajax;
 use Drupal\Core\Ajax\AjaxResponse;
@@ -63,7 +65,7 @@ protected function setType($type) {
   public function getFormState(ViewStorageInterface $view, $display_id, $js) {
     // $js may already have been converted to a Boolean.
     $ajax = is_string($js) ? $js === 'ajax' : $js;
-    return array(
+    return new FormState(array(
       'form_id' => $this->getFormId(),
       'form_key' => $this->getFormKey(),
       'ajax' => $ajax,
@@ -76,7 +78,7 @@ public function getFormState(ViewStorageInterface $view, $display_id, $js) {
         'args' => array(),
         'callback_object' => $this,
       ),
-    );
+    ));
   }
 
   /**
@@ -179,13 +181,13 @@ public function getForm(ViewStorageInterface $view, $display_id, $js) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/modules/views_ui/src/Form/Ajax/ViewsFormInterface.php b/core/modules/views_ui/src/Form/Ajax/ViewsFormInterface.php
index d109ea3..8bc8adf 100644
--- a/core/modules/views_ui/src/Form/Ajax/ViewsFormInterface.php
+++ b/core/modules/views_ui/src/Form/Ajax/ViewsFormInterface.php
@@ -32,8 +32,8 @@ public function getFormKey();
    *   If this is an AJAX form, it will be the string 'ajax'. Otherwise, it will
    *   be 'nojs'. This determines the response.
    *
-   * @return array
-   *   An associative array containing the current state of the form.
+   * @return \Drupal\Core\Form\FormStateInterface
+   *   The current state of the form.
    */
   public function getFormState(ViewStorageInterface $view, $display_id, $js);
 
diff --git a/core/modules/views_ui/src/Form/BasicSettingsForm.php b/core/modules/views_ui/src/Form/BasicSettingsForm.php
index f898f9a..6b15d79 100644
--- a/core/modules/views_ui/src/Form/BasicSettingsForm.php
+++ b/core/modules/views_ui/src/Form/BasicSettingsForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\views_ui\Form;
 
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Form builder for the admin display defaults page.
@@ -24,7 +25,7 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     $form = parent::buildForm($form, $form_state);
 
     $config = $this->config('views.settings');
@@ -126,7 +127,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->config('views.settings')
       ->set('ui.show.master_display', $form_state['values']['ui_show_master_display'])
       ->set('ui.show.advanced_column', $form_state['values']['ui_show_advanced_column'])
diff --git a/core/modules/views_ui/src/Form/BreakLockForm.php b/core/modules/views_ui/src/Form/BreakLockForm.php
index 52501ef..b3adefc 100644
--- a/core/modules/views_ui/src/Form/BreakLockForm.php
+++ b/core/modules/views_ui/src/Form/BreakLockForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\user\TempStoreFactory;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -98,7 +99,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     if (!$this->tempStore->getMetadata($this->entity->id())) {
       $form['message']['#markup'] = $this->t('There is no lock on view %name to break.', array('%name' => $this->entity->id()));
       return $form;
@@ -109,7 +110,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $this->tempStore->delete($this->entity->id());
     $form_state['redirect_route'] = $this->entity->urlInfo('edit-form');
     drupal_set_message($this->t('The lock has been broken and you may now edit this view.'));
diff --git a/core/modules/views_ui/src/ViewAddForm.php b/core/modules/views_ui/src/ViewAddForm.php
index fac46e3..70d57d8 100644
--- a/core/modules/views_ui/src/ViewAddForm.php
+++ b/core/modules/views_ui/src/ViewAddForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\wizard\WizardPluginBase;
 use Drupal\views\Plugin\views\wizard\WizardException;
 use Drupal\views\Plugin\ViewsPluginManager;
@@ -53,7 +54,7 @@ protected function prepareEntity() {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $form['#attached']['css'] = static::getAdminCSS();
     $form['#attached']['js'][] = drupal_get_path('module', 'views_ui') . '/js/views-admin.js';
     $form['#attributes']['class'] = array('views-admin');
@@ -145,7 +146,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->t('Save and edit');
 
@@ -163,7 +164,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     $wizard_type = $form_state['values']['show']['wizard_key'];
     $wizard_instance = $this->wizardManager->createInstance($wizard_type);
     $form_state['wizard'] = $wizard_instance->getPluginDefinition();
@@ -180,7 +181,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     try {
       /** @var $wizard \Drupal\views\Plugin\views\wizard\WizardInterface */
       $wizard = $form_state['wizard_instance'];
@@ -202,10 +203,10 @@ public function submit(array $form, array &$form_state) {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A reference to a keyed array containing the current state of the form.
    */
-  public function cancel(array $form, array &$form_state) {
+  public function cancel(array $form, &$form_state) {
     $form_state['redirect_route']['route_name'] = 'views_ui.list';
   }
 
diff --git a/core/modules/views_ui/src/ViewDeleteForm.php b/core/modules/views_ui/src/ViewDeleteForm.php
index 29e4fe2..d3215e6 100644
--- a/core/modules/views_ui/src/ViewDeleteForm.php
+++ b/core/modules/views_ui/src/ViewDeleteForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\views_ui;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 
 /**
@@ -39,7 +40,7 @@ public function getConfirmText() {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     parent::submit($form, $form_state);
 
     $this->entity->delete();
diff --git a/core/modules/views_ui/src/ViewDuplicateForm.php b/core/modules/views_ui/src/ViewDuplicateForm.php
index c46101a..b4b5eef 100644
--- a/core/modules/views_ui/src/ViewDuplicateForm.php
+++ b/core/modules/views_ui/src/ViewDuplicateForm.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views_ui;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Form controller for the Views duplicate form.
  */
@@ -22,7 +24,7 @@ protected function prepareEntity() {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     parent::form($form, $form_state);
 
     $form['#title'] = $this->t('Duplicate of @label', array('@label' => $this->entity->label()));
@@ -52,7 +54,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $actions['submit'] = array(
       '#type' => 'submit',
       '#value' => $this->t('Duplicate'),
@@ -66,7 +68,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     $original = parent::submit($form, $form_state);
     $this->entity = $original->createDuplicate();
     $this->entity->set('id', $form_state['values']['id']);
diff --git a/core/modules/views_ui/src/ViewEditForm.php b/core/modules/views_ui/src/ViewEditForm.php
index bd276b9..6b13bca 100644
--- a/core/modules/views_ui/src/ViewEditForm.php
+++ b/core/modules/views_ui/src/ViewEditForm.php
@@ -13,6 +13,7 @@
 use Drupal\Core\Ajax\ReplaceCommand;
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\user\TempStoreFactory;
 use Drupal\views\Views;
@@ -64,7 +65,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $view = $this->entity;
     $display_id = $this->displayID;
     // Do not allow the form to be cached, because $form_state['view'] can become
@@ -218,7 +219,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
     unset($actions['delete']);
 
@@ -239,7 +240,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validate(array $form, array &$form_state) {
+  public function validate(array $form, FormStateInterface $form_state) {
     parent::validate($form, $form_state);
 
     $view = $this->entity;
@@ -256,7 +257,7 @@ public function validate(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submit(array $form, array &$form_state) {
+  public function submit(array $form, FormStateInterface $form_state) {
     parent::submit($form, $form_state);
 
     $view = $this->entity;
@@ -326,10 +327,10 @@ public function submit(array $form, array &$form_state) {
    *
    * @param array $form
    *   An associative array containing the structure of the form.
-   * @param array $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   A reference to a keyed array containing the current state of the form.
    */
-  public function cancel(array $form, array &$form_state) {
+  public function cancel(array $form, &$form_state) {
     // Remove this view from cache so edits will be lost.
     $view = $this->entity;
     $this->tempStore->delete($view->id());
diff --git a/core/modules/views_ui/src/ViewFormBase.php b/core/modules/views_ui/src/ViewFormBase.php
index 61b872f..8e875e6 100644
--- a/core/modules/views_ui/src/ViewFormBase.php
+++ b/core/modules/views_ui/src/ViewFormBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\views_ui;
 
 use Drupal\Core\Entity\EntityForm;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
 
@@ -26,7 +27,7 @@
   /**
    * {@inheritdoc}
    */
-  public function init(array &$form_state) {
+  public function init(FormStateInterface $form_state) {
     parent::init($form_state);
 
     if ($display_id = \Drupal::request()->attributes->get('display_id')) {
diff --git a/core/modules/views_ui/src/ViewPreviewForm.php b/core/modules/views_ui/src/ViewPreviewForm.php
index e2d2899..31b5216 100644
--- a/core/modules/views_ui/src/ViewPreviewForm.php
+++ b/core/modules/views_ui/src/ViewPreviewForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\user\TempStoreFactory;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -44,7 +45,7 @@ public static function create(ContainerInterface $container) {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface $form_state) {
     $view = $this->entity;
 
     $form['#prefix'] = '<div id="views-preview-wrapper" class="views-admin clearfix">';
@@ -100,7 +101,7 @@ public function form(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function actions(array $form, array &$form_state) {
+  protected function actions(array $form, FormStateInterface $form_state) {
     $view = $this->entity;
     return array(
       '#attributes' => array(
diff --git a/core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php b/core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php
index add47b1..4ec28d2 100644
--- a/core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php
+++ b/core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Tests\Core\Display;
 
+use Drupal\Core\Form\FormState;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -142,6 +143,7 @@ public function testSubmitConfigurationForm() {
 
     $form = array();
     $label = $this->randomName();
+    $form_state = new FormState();
     $form_state['values']['label'] = $label;
     $display_variant->submitConfigurationForm($form, $form_state);
     $this->assertSame($label, $display_variant->label());
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php
index 14622d2..2e7ab80 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php
@@ -60,7 +60,7 @@ public function testGetForm() {
 
     $this->formBuilder->expects($this->once())
       ->method('buildForm')
-      ->with($form_controller, $this->isType('array'))
+      ->with($form_controller, $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'))
       ->will($this->returnValue('the form contents'));
 
     $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php
index 40a000d..23bd5c9 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Entity\EntityResolverManager;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\Routing\Route;
 
@@ -418,13 +419,13 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, EntityInterface $entity_test = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, EntityInterface $entity_test = NULL) {
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
@@ -443,13 +444,13 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, $entity_test = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, $entity_test = NULL) {
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
@@ -465,19 +466,19 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, array &$form_state, EntityInterface $entity_test = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, EntityInterface $entity_test = NULL) {
   }
 
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, array &$form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
   }
 
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, array &$form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
   }
 
 }
diff --git a/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php b/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
index 4702b9d..39307ac 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
 use Drupal\Core\Form\FormInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -26,11 +27,11 @@ class FormBuilderTest extends FormTestBase {
   public function testGetFormIdWithString() {
     $form_arg = 'foo';
 
-    $form_state = array();
+    $clean_form_state = $form_state = $this->prepareFormState();
     $form_id = $this->formBuilder->getFormId($form_arg, $form_state);
 
     $this->assertSame($form_arg, $form_id);
-    $this->assertEmpty($form_state);
+    $this->assertSame($clean_form_state, $form_state);
   }
 
   /**
@@ -39,7 +40,7 @@ public function testGetFormIdWithString() {
   public function testGetFormIdWithClassName() {
     $form_arg = 'Drupal\Tests\Core\Form\TestForm';
 
-    $form_state = array();
+    $form_state = $this->prepareFormState();
     $form_id = $this->formBuilder->getFormId($form_arg, $form_state);
 
     $this->assertSame('test_form', $form_id);
@@ -55,7 +56,7 @@ public function testGetFormIdWithInjectedClassName() {
 
     $form_arg = 'Drupal\Tests\Core\Form\TestFormInjected';
 
-    $form_state = array();
+    $form_state = $this->prepareFormState();
     $form_id = $this->formBuilder->getFormId($form_arg, $form_state);
 
     $this->assertSame('test_form', $form_id);
@@ -70,7 +71,7 @@ public function testGetFormIdWithObject() {
 
     $form_arg = $this->getMockForm($expected_form_id);
 
-    $form_state = array();
+    $form_state = $this->prepareFormState();
     $form_id = $this->formBuilder->getFormId($form_arg, $form_state);
 
     $this->assertSame($expected_form_id, $form_id);
@@ -92,7 +93,7 @@ public function testGetFormIdWithBaseForm() {
       ->method('getBaseFormId')
       ->will($this->returnValue($base_form_id));
 
-    $form_state = array();
+    $form_state = $this->prepareFormState();
     $form_id = $this->formBuilder->getFormId($form_arg, $form_state);
 
     $this->assertSame($expected_form_id, $form_id);
@@ -119,11 +120,11 @@ public function testHandleFormStateResponse($class, $form_state_key) {
     $form_arg = $this->getMockForm($form_id, $expected_form);
     $form_arg->expects($this->any())
       ->method('submitForm')
-      ->will($this->returnCallback(function ($form, &$form_state) use ($response, $form_state_key) {
+      ->will($this->returnCallback(function ($form, $form_state) use ($response, $form_state_key) {
         $form_state[$form_state_key] = $response;
       }));
 
-    $form_state = array();
+    $form_state = $this->prepareFormState();
     try {
       $form_state['values'] = array();
       $form_state['input']['form_id'] = $form_id;
@@ -171,13 +172,13 @@ public function testHandleRedirectWithResponse() {
     $form_arg = $this->getMockForm($form_id, $expected_form);
     $form_arg->expects($this->any())
       ->method('submitForm')
-      ->will($this->returnCallback(function ($form, &$form_state) use ($response, $redirect) {
+      ->will($this->returnCallback(function ($form, $form_state) use ($response, $redirect) {
         // Set both the response and the redirect.
         $form_state['response'] = $response;
         $form_state['redirect'] = $redirect;
       }));
 
-    $form_state = array();
+    $form_state = $this->prepareFormState();
     try {
       $form_state['values'] = array();
       $form_state['input']['form_id'] = $form_id;
@@ -226,7 +227,7 @@ public function testGetFormWithClassString() {
     $form_id = '\Drupal\Tests\Core\Form\TestForm';
     $object = new TestForm();
     $form = array();
-    $form_state = array();
+    $form_state = $this->prepareFormState();
     $expected_form = $object->buildForm($form, $form_state);
 
     $form = $this->formBuilder->getForm($form_id);
@@ -256,7 +257,7 @@ public function testBuildFormWithClassString() {
     $form_id = '\Drupal\Tests\Core\Form\TestForm';
     $object = new TestForm();
     $form = array();
-    $form_state = array();
+    $form_state = $this->prepareFormState();
     $expected_form = $object->buildForm($form, $form_state);
 
     $form = $this->formBuilder->buildForm($form_id, $form_state);
@@ -273,7 +274,7 @@ public function testBuildFormWithObject() {
 
     $form_arg = $this->getMockForm($form_id, $expected_form);
 
-    $form_state = array();
+    $form_state = $this->prepareFormState();
     $form = $this->formBuilder->buildForm($form_arg, $form_state);
     $this->assertFormElement($expected_form, $form, 'test');
     $this->assertSame($form_id, $form_state['build_info']['form_id']);
@@ -297,7 +298,7 @@ public function testRebuildForm() {
       ->will($this->returnValue($expected_form));
 
     // Do an initial build of the form and track the build ID.
-    $form_state = array();
+    $form_state = $this->prepareFormState();
     $form = $this->formBuilder->buildForm($form_arg, $form_state);
     $original_build_id = $form['#build_id'];
 
@@ -348,7 +349,7 @@ public function testGetCache() {
       ->will($this->returnValue(TRUE));
 
     // Do an initial build of the form and track the build ID.
-    $form_state = array();
+    $form_state = $this->prepareFormState();
     $form_state['build_info']['args'] = array();
     $form_state['build_info']['files'] = array(array('module' => 'node', 'type' => 'pages.inc'));
     $form_state['cache'] = TRUE;
@@ -365,10 +366,11 @@ public function testGetCache() {
       ->will($this->returnValue($cached_form));
     $this->formStateCache->expects($this->once())
       ->method('get')
-      ->will($this->returnValue($form_state));
+      ->will($this->returnValue($form_state->getCacheableArray()));
 
     // The final form build will not trigger any actual form building, but will
     // use the form cache.
+    $form_state['executed'] = TRUE;
     $form_state['input']['form_id'] = $form_id;
     $form_state['input']['form_build_id'] = $form['#build_id'];
     $this->formBuilder->buildForm($form_arg, $form_state);
@@ -392,7 +394,7 @@ public function testSendResponse() {
     $form_arg = $this->getMockForm($form_id, $expected_form);
 
     // Do an initial build of the form and track the build ID.
-    $form_state = array();
+    $form_state = $this->prepareFormState();
     $this->formBuilder->buildForm($form_arg, $form_state);
   }
 
@@ -413,11 +415,11 @@ public function testUniqueHtmlId() {
       ->method('buildForm')
       ->will($this->returnValue($expected_form));
 
-    $form_state = array();
+    $form_state = $this->prepareFormState();
     $form = $this->simulateFormSubmission($form_id, $form_arg, $form_state);
     $this->assertSame($form_id, $form['#id']);
 
-    $form_state = array();
+    $form_state = $this->prepareFormState();
     $form = $this->simulateFormSubmission($form_id, $form_arg, $form_state);
     $this->assertSame("$form_id--2", $form['#id']);
   }
@@ -429,11 +431,11 @@ public function getFormId() {
     return 'test_form';
   }
 
-  public function buildForm(array $form, array &$form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state) {
     return test_form_id();
   }
-  public function validateForm(array &$form, array &$form_state) { }
-  public function submitForm(array &$form, array &$form_state) { }
+  public function validateForm(array &$form, FormStateInterface $form_state) { }
+  public function submitForm(array &$form, FormStateInterface $form_state) { }
 }
 class TestFormInjected extends TestForm implements ContainerInjectionInterface {
   public static function create(ContainerInterface $container) {
@@ -444,7 +446,7 @@ public static function create(ContainerInterface $container) {
 }
 
 namespace {
-  function test_form_id_custom_submit(array &$form, array &$form_state) {
+  function test_form_id_custom_submit(array &$form, &$form_state) {
   }
   // @todo Remove once watchdog() is removed.
   if (!defined('WATCHDOG_ERROR')) {
diff --git a/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php b/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php
index cc34f74..a38fad2 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\Tests\Core\Form;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Form\FormState;
 use Drupal\Core\Url;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\RedirectResponse;
@@ -41,7 +42,7 @@ public function setUp() {
   public function testHandleFormSubmissionNotSubmitted() {
     $form_submitter = $this->getFormSubmitter();
     $form = array();
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
 
     $return = $form_submitter->doSubmitForm($form, $form_state);
     $this->assertFalse($form_state['executed']);
@@ -54,7 +55,7 @@ public function testHandleFormSubmissionNotSubmitted() {
   public function testHandleFormSubmissionNoRedirect() {
     $form_submitter = $this->getFormSubmitter();
     $form = array();
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $form_state['submitted'] = TRUE;
     $form_state['no_redirect'] = TRUE;
 
@@ -76,7 +77,7 @@ public function testHandleFormSubmissionWithResponses($class, $form_state_key) {
       ->method('prepare')
       ->will($this->returnValue($response));
 
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $form_state['submitted'] = TRUE;
     $form_state[$form_state_key] = $response;
 
@@ -113,7 +114,7 @@ public function testRedirectWithResult($form_state, $result, $status = 303) {
         ))
       );
 
-    $form_state += $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState($form_state);
     $redirect = $form_submitter->redirectForm($form_state);
     $this->assertSame($result, $redirect->getTargetUrl());
     $this->assertSame($status, $redirect->getStatusCode());
@@ -139,7 +140,7 @@ public function testRedirectWithRouteWithResult($form_state, $result, $status =
         ))
       );
 
-    $form_state += $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState($form_state);
     $redirect = $form_submitter->redirectForm($form_state);
     $this->assertSame($result, $redirect->getTargetUrl());
     $this->assertSame($status, $redirect->getStatusCode());
@@ -155,7 +156,7 @@ public function testRedirectWithResponseObject() {
     $redirect = new RedirectResponse('/example');
     $form_state['redirect'] = $redirect;
 
-    $form_state += $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState($form_state);
     $result_redirect = $form_submitter->redirectForm($form_state);
 
     $this->assertSame($redirect, $result_redirect);
@@ -174,7 +175,7 @@ public function testRedirectWithoutResult($form_state) {
       ->method('generateFromPath');
     $this->urlGenerator->expects($this->never())
       ->method('generateFromRoute');
-    $form_state += $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState($form_state);
     $redirect = $form_submitter->redirectForm($form_state);
     $this->assertNull($redirect);
   }
@@ -233,13 +234,13 @@ public function testExecuteSubmitHandlers() {
     $mock = $this->getMock('stdClass', array('submit_handler', 'hash_submit'));
     $mock->expects($this->once())
       ->method('submit_handler')
-      ->with($this->isType('array'), $this->isType('array'));
+      ->with($this->isType('array'), $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'));
     $mock->expects($this->once())
       ->method('hash_submit')
-      ->with($this->isType('array'), $this->isType('array'));
+      ->with($this->isType('array'), $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'));
 
     $form = array();
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $form_submitter->executeSubmitHandlers($form, $form_state);
 
     $form['#submit'][] = array($mock, 'hash_submit');
@@ -251,14 +252,18 @@ public function testExecuteSubmitHandlers() {
   }
 
   /**
-   * @return array()
+   * Prepares a FormState object with defaults added.
+   *
+   * @param array $form_state_additions
+   *   (optional) An array of additions for the form state.
+   *
+   * @return \Drupal\Core\Form\FormStateInterface
+   *   The form state object.
    */
-  protected function getFormStateDefaults() {
-    $form_builder = $this->getMockBuilder('Drupal\Core\Form\FormBuilder')
-      ->disableOriginalConstructor()
-      ->setMethods(NULL)
-      ->getMock();
-    return $form_builder->getFormStateDefaults();
+  protected function prepareFormState(array $form_state_additions = array()) {
+    $form_state = new FormState($form_state_additions);
+    $form_state->addFormStateDefaults();
+    return $form_state;
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Form/FormTestBase.php b/core/tests/Drupal/Tests/Core/Form/FormTestBase.php
index 9bb00d2..6c7dcd8 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormTestBase.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormTestBase.php
@@ -9,7 +9,8 @@
 
 use Drupal\Core\Form\FormBuilder;
 use Drupal\Core\Form\FormInterface;
-use Drupal\Core\Session\AccountInterface;
+  use Drupal\Core\Form\FormState;
+  use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RequestStack;
@@ -221,8 +222,8 @@ protected function getMockForm($form_id, $expected_form = NULL, $count = 1) {
    *   The unique string identifying the form.
    * @param \Drupal\Core\Form\FormInterface $form_arg
    *   The form object.
-   * @param array $form_state
-   *   An associative array containing the current state of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
    * @param bool $programmed
    *   Whether $form_state['programmed'] should be set to TRUE or not. If it is
    *   not set to TRUE, you must provide additional data in $form_state for the
@@ -231,7 +232,7 @@ protected function getMockForm($form_id, $expected_form = NULL, $count = 1) {
    * @return array
    *   The built form.
    */
-  protected function simulateFormSubmission($form_id, FormInterface $form_arg, array &$form_state, $programmed = TRUE) {
+  protected function simulateFormSubmission($form_id, FormInterface $form_arg, &$form_state, $programmed = TRUE) {
     $form_state['build_info']['callback_object'] = $form_arg;
     $form_state['build_info']['args'] = array();
     $form_state['input']['op'] = 'Submit';
@@ -257,6 +258,21 @@ protected function assertFormElement(array $expected_form, array $actual_form, $
     $this->assertSame(array_intersect_key($expected_element, $actual_element), $expected_element);
   }
 
+  /**
+   * Prepares a FormState object with defaults added.
+   *
+   * @param array $form_state_additions
+   *   (optional) An array of additions for the form state.
+   *
+   * @return \Drupal\Core\Form\FormStateInterface
+   *   The form state object.
+   */
+  protected function prepareFormState(array $form_state_additions = array()) {
+    $form_state = new FormState($form_state_additions);
+    $form_state->addFormStateDefaults();
+    return $form_state;
+  }
+
 }
 
 /**
diff --git a/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php b/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php
index 0870788..14d4e07 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php
@@ -8,7 +8,8 @@
 namespace Drupal\Tests\Core\Form {
 
 use Drupal\Component\Utility\String;
-use Drupal\Tests\UnitTestCase;
+  use Drupal\Core\Form\FormState;
+  use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RequestStack;
 
@@ -32,6 +33,7 @@ public function testFormErrorsDuringSubmission() {
       ->setMethods(NULL)
       ->getMock();
     $form_state['validation_complete'] = TRUE;
+    $form_state = $this->prepareFormState($form_state);
     $form_validator->setErrorByName('test', $form_state, 'message');
   }
 
@@ -48,7 +50,7 @@ public function testValidationComplete() {
       ->getMock();
 
     $form = array();
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $this->assertFalse($form_state['validation_complete']);
     $form_validator->validateForm('test_form_id', $form, $form_state);
     $this->assertTrue($form_state['validation_complete']);
@@ -68,7 +70,7 @@ public function testPreventDuplicateValidation() {
       ->method('doValidateForm');
 
     $form = array();
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $form_state['validation_complete'] = TRUE;
     $form_validator->validateForm('test_form_id', $form, $form_state);
     $this->assertArrayNotHasKey('#errors', $form);
@@ -88,7 +90,7 @@ public function testMustValidate() {
       ->method('doValidateForm');
 
     $form = array();
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $form_state['validation_complete'] = TRUE;
     $form_state['must_validate'] = TRUE;
     $form_validator->validateForm('test_form_id', $form, $form_state);
@@ -115,12 +117,12 @@ public function testValidateInvalidFormToken() {
       ->getMock();
     $form_validator->expects($this->once())
       ->method('setErrorByName')
-      ->with('form_token', $this->isType('array'), 'The form has become outdated. Copy any unsaved work in the form below and then <a href="/test/example?foo=bar">reload this page</a>.');
+      ->with('form_token', $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'), 'The form has become outdated. Copy any unsaved work in the form below and then <a href="/test/example?foo=bar">reload this page</a>.');
     $form_validator->expects($this->never())
       ->method('doValidateForm');
 
     $form['#token'] = 'test_form_id';
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $form_state['values']['form_token'] = 'some_random_token';
     $form_validator->validateForm('test_form_id', $form, $form_state);
     $this->assertTrue($form_state['validation_complete']);
@@ -148,7 +150,7 @@ public function testValidateValidFormToken() {
       ->method('doValidateForm');
 
     $form['#token'] = 'test_form_id';
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $form_state['values']['form_token'] = 'some_random_token';
     $form_validator->validateForm('test_form_id', $form, $form_state);
     $this->assertTrue($form_state['validation_complete']);
@@ -160,7 +162,7 @@ public function testValidateValidFormToken() {
    * @covers ::setError
    */
   public function testSetError() {
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
 
     $form_validator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
       ->disableOriginalConstructor()
@@ -188,7 +190,7 @@ public function testGetError($errors, $parents, $error = NULL) {
       ->getMock();
 
     $element['#parents'] = $parents;
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $form_state['errors'] = $errors;
     $this->assertSame($error, $form_validator->getError($element, $form_state));
   }
@@ -227,7 +229,7 @@ public function testSetErrorByName($limit_validation_errors, $expected_errors, $
     $form_validator->expects($set_message ? $this->once() : $this->never())
       ->method('drupalSetMessage');
 
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $form_state['limit_validation_errors'] = $limit_validation_errors;
     $form_validator->setErrorByName('test', $form_state, 'Fail 1');
     $form_validator->setErrorByName('test', $form_state, 'Fail 2');
@@ -272,7 +274,7 @@ public function testSetElementErrorsFromFormState() {
       '#title' => 'Test',
       '#parents' => array('test'),
     );
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $form_validator->setErrorByName('test', $form_state, 'invalid');
     $form_validator->validateForm('test_form_id', $form, $form_state);
     $this->assertSame('invalid', $form['test']['#errors']);
@@ -290,7 +292,7 @@ public function testHandleErrorsWithLimitedValidation($sections, $triggering_ele
       ->getMock();
 
     $form = array();
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $form_state['triggering_element'] = $triggering_element;
     $form_state['triggering_element']['#limit_validation_errors'] = $sections;
 
@@ -387,13 +389,13 @@ public function testExecuteValidateHandlers() {
     $mock = $this->getMock('stdClass', array('validate_handler', 'hash_validate'));
     $mock->expects($this->once())
       ->method('validate_handler')
-      ->with($this->isType('array'), $this->isType('array'));
+      ->with($this->isType('array'), $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'));
     $mock->expects($this->once())
       ->method('hash_validate')
-      ->with($this->isType('array'), $this->isType('array'));
+      ->with($this->isType('array'), $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'));
 
     $form = array();
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $form_validator->executeValidateHandlers($form, $form_state);
 
     $form['#validate'][] = array($mock, 'hash_validate');
@@ -421,7 +423,7 @@ public function testRequiredErrorMessage($element, $expected_message) {
       ->method('executeValidateHandlers');
     $form_validator->expects($this->once())
       ->method('setErrorByName')
-      ->with('test', $this->isType('array'), $expected_message);
+      ->with('test', $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'), $expected_message);
 
     $form = array();
     $form['test'] = $element + array(
@@ -431,7 +433,7 @@ public function testRequiredErrorMessage($element, $expected_message) {
       '#required' => TRUE,
       '#parents' => array('test'),
     );
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $form_validator->validateForm('test_form_id', $form, $form_state);
   }
 
@@ -468,7 +470,7 @@ public function testElementValidate() {
     $mock = $this->getMock('stdClass', array('element_validate'));
     $mock->expects($this->once())
       ->method('element_validate')
-      ->with($this->isType('array'), $this->isType('array'), NULL);
+      ->with($this->isType('array'), $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'), NULL);
 
     $form = array();
     $form['test'] = array(
@@ -477,7 +479,7 @@ public function testElementValidate() {
       '#parents' => array('test'),
       '#element_validate' => array(array($mock, 'element_validate')),
     );
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $form_validator->validateForm('test_form_id', $form, $form_state);
   }
 
@@ -496,7 +498,7 @@ public function testPerformRequiredValidation($element, $expected_message, $call
       ->getMock();
     $form_validator->expects($this->once())
       ->method('setErrorByName')
-      ->with('test', $this->isType('array'), $expected_message);
+      ->with('test', $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'), $expected_message);
 
     if ($call_watchdog) {
       $form_validator->expects($this->once())
@@ -511,7 +513,7 @@ public function testPerformRequiredValidation($element, $expected_message, $call
       '#required' => FALSE,
       '#parents' => array('test'),
     );
-    $form_state = $this->getFormStateDefaults();
+    $form_state = $this->prepareFormState();
     $form_state['values'] = array();
     $form_validator->validateForm('test_form_id', $form, $form_state);
   }
@@ -585,14 +587,18 @@ public function providerTestPerformRequiredValidation() {
   }
 
   /**
-   * @return array()
+   * Prepares a FormState object with defaults added.
+   *
+   * @param array $form_state_additions
+   *   (optional) An array of additions for the form state.
+   *
+   * @return \Drupal\Core\Form\FormStateInterface
+   *   The form state object.
    */
-  protected function getFormStateDefaults() {
-    $form_builder = $this->getMockBuilder('Drupal\Core\Form\FormBuilder')
-      ->disableOriginalConstructor()
-      ->setMethods(NULL)
-      ->getMock();
-    return $form_builder->getFormStateDefaults();
+  protected function prepareFormState(array $form_state_additions = array()) {
+    $form_state = new FormState($form_state_additions);
+    $form_state->addFormStateDefaults();
+    return $form_state;
   }
 
 }
