diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc
index 7ab2059..f924725 100644
--- a/core/includes/ajax.inc
+++ b/core/includes/ajax.inc
@@ -5,6 +5,8 @@
  * Functions for use with Drupal's Ajax framework.
  */
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * @defgroup ajax Ajax framework
  * @{
@@ -64,7 +66,7 @@
  *   return \Drupal::formBuilder()->getForm('ajax_example_simplest');
  * }
  *
- * function ajax_example_simplest($form, &$form_state) {
+ * function ajax_example_simplest($form, FormStateInterface &$form_state) {
  *   $form = array();
  *   $form['changethis'] = array(
  *     '#type' => 'select',
@@ -236,7 +238,7 @@
  *
  * @see ajax_pre_render_element()
  */
-function ajax_process_form($element, &$form_state) {
+function ajax_process_form($element, FormStateInterface &$form_state) {
   $element = ajax_pre_render_element($element);
   if (!empty($element['#ajax_processed'])) {
     $form_state['cache'] = TRUE;
diff --git a/core/includes/form.inc b/core/includes/form.inc
index acb81e8..f449cef 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..eee01a9 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..cc8aada 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..c255a75 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..f624533 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..828e387 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..6e656d9 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..5078b2e 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..d471027 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..6a9cd27 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..686a345 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
@@ -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,10 +382,10 @@ 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;
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..22b6bb0 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..5b0db97 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..168ffc4 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..f14b6e2 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..c87a8e4 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..46c14f8 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..6d21574 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..6145621 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..4b23469 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/BooleanItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php
index fd20d22..e334b81 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\TypedData\AllowedValuesInterface;
 use Drupal\Core\TypedData\DataDefinition;
@@ -64,7 +65,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['on_label'] = array(
       '#type' => 'textfield',
       '#title' => $this->t('"On" label'),
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..6cf377c 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..014171a 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/BooleanCheckboxWidget.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/BooleanCheckboxWidget.php
index 711a9b2..71b5013 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/BooleanCheckboxWidget.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/BooleanCheckboxWidget.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'boolean_checkbox' 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['display_label'] = array(
       '#type' => 'checkbox',
       '#title' => t('Use field label instead of the "On label" 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['value'] = $element + array(
       '#type' => 'checkbox',
       '#default_value' => !empty($items[0]->value),
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..696fbd4 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..63f755b 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..e9af7df 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..4a7979f 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..5df36a2 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..507125d 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, FormStateInterface $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..a6a19a1 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..4575907 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..1249e72 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..5091c13 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..cb0eb7e 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..d583014 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..91ce3db 100644
--- a/core/lib/Drupal/Core/Form/FormBuilder.php
+++ b/core/lib/Drupal/Core/Form/FormBuilder.php
@@ -133,7 +133,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 +156,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 +169,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 +207,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 +229,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 +268,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 +313,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 +355,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 +371,8 @@ public function submitForm($form_arg, &$form_state) {
       $form_state['build_info']['args'] = array_values($args);
     }
     // Merge in default values.
-    $form_state += $this->getFormStateDefaults();
+    /** @var $form_state \Drupal\Core\Form\FormStateInterface */
+    $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..8f357fb 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.
@@ -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:
@@ -322,7 +165,7 @@ public function setCache($form_build_id, $form, $form_state);
    * For example:
    * @code
    * // register a new user
-   * $form_state = array();
+   * $form_state = new FormState();
    * $form_state['values']['name'] = 'robo-user';
    * $form_state['values']['mail'] = 'robouser@example.com';
    * $form_state['values']['pass']['pass1'] = 'password';
@@ -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.
@@ -510,6 +353,6 @@ public function doBuildForm($form_id, &$element, &$form_state);
    * @param $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..3110f53 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..8d6d50f 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..cb58ff1
--- /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_additions
+   */
+  public function __construct(array $form_state_additions = array()) {
+    $this->formState = $form_state_additions;
+  }
+
+  /**
+   * {@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_additions) {
+    $this->formState = $form_state_additions + $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..4b9b1d7
--- /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_additions
+   *   An array of values to add to the form state.
+   *
+   * @return $this
+   */
+  public function setFormState(array $form_state_additions);
+
+  /**
+   * 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..b212549 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..5c6e67c 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.
@@ -39,7 +39,7 @@ public function doSubmitForm(&$form, &$form_state);
    *   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.
@@ -94,7 +94,7 @@ public function executeSubmitHandlers(&$form, &$form_state);
    *   $form_state['redirect'].
    *
    * @param $form_state
-   *   An associative array containing the current state of the form.
+   *   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..eddf449 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..17dccf6 100644
--- a/core/lib/Drupal/Core/Form/FormValidatorInterface.php
+++ b/core/lib/Drupal/Core/Form/FormValidatorInterface.php
@@ -25,7 +25,7 @@
    *   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.
@@ -52,6 +52,6 @@ public function executeValidateHandlers(&$form, &$form_state);
    *   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..5a9291c 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..620046a 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..5db953b 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..74a609e 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..727a01b 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..fd05354 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..e071443 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..9bf1fa7 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..ddcd2b4 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..1e748c8 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..8b45c48 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..7e426f3 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..8f196b1 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..47f5d92 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..09fb223 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..27056ae 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..91921c2 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..8c9a8fc 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..b5f3270 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..aaacab4 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..e064b5f 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..d404988 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/src/Plugin/views/field/TitleLink.php b/core/modules/aggregator/src/Plugin/views/field/TitleLink.php
index 725b82d..102ba9c 100644
--- a/core/modules/aggregator/src/Plugin/views/field/TitleLink.php
+++ b/core/modules/aggregator/src/Plugin/views/field/TitleLink.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\aggregator\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\ResultRow;
@@ -45,7 +46,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['display_as_link'] = array(
       '#title' => t('Display as link'),
       '#type' => 'checkbox',
diff --git a/core/modules/aggregator/src/Plugin/views/row/Rss.php b/core/modules/aggregator/src/Plugin/views/row/Rss.php
index f9a73a6..4729114 100644
--- a/core/modules/aggregator/src/Plugin/views/row/Rss.php
+++ b/core/modules/aggregator/src/Plugin/views/row/Rss.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\aggregator\Plugin\views\row;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\row\RowPluginBase;
 
 /**
@@ -51,7 +52,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['view_mode'] = array(
       '#type' => 'select',
       '#title' => t('Display type'),
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..aeffd18 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..ba237ce 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..b47f7ac 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..89841ec 100644
--- a/core/modules/block/src/BlockBase.php
+++ b/core/modules/block/src/BlockBase.php
@@ -12,6 +12,8 @@
 use Drupal\Component\Plugin\ContextAwarePluginInterface;
 use Drupal\Core\Condition\ConditionAccessResolverTrait;
 use Drupal\Core\Condition\ConditionPluginBag;
+use Drupal\Core\Form\FormState;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContextAwarePluginBase;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Component\Utility\NestedArray;
@@ -206,7 +208,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 +333,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,15 +345,15 @@ 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']));
 
     foreach ($this->getVisibilityConditions() as $condition_id => $condition) {
       // Allow the condition to validate the form.
-      $condition_values = array(
+      $condition_values = new FormState(array(
         'values' => &$form_state['values']['visibility'][$condition_id],
-      );
+      ));
       $condition->validateConfigurationForm($form, $condition_values);
     }
 
@@ -361,7 +363,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 +373,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'];
@@ -380,9 +382,9 @@ public function submitConfigurationForm(array &$form, array &$form_state) {
       $this->configuration['cache'] = $form_state['values']['cache'];
       foreach ($this->getVisibilityConditions() as $condition_id => $condition) {
         // Allow the condition to submit the form.
-        $condition_values = array(
+        $condition_values = new FormState(array(
           'values' => &$form_state['values']['visibility'][$condition_id],
-        );
+        ));
         $condition->submitConfigurationForm($form, $condition_values);
       }
       $this->blockSubmit($form, $form_state);
@@ -392,7 +394,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..6c672b7 100644
--- a/core/modules/block/src/BlockForm.php
+++ b/core/modules/block/src/BlockForm.php
@@ -9,6 +9,8 @@
 
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormState;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -52,7 +54,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.
@@ -125,7 +127,7 @@ public function form(array $form, array &$form_state) {
   /**
    * Handles switching the available regions based on the selected theme.
    */
-  public function themeSwitch($form, &$form_state) {
+  public function themeSwitch($form, FormStateInterface &$form_state) {
     $form['region']['#options'] = system_region_list($form_state['values']['theme'], REGIONS_VISIBLE);
     return $form['region'];
   }
@@ -133,7 +135,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,14 +144,14 @@ 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
     // settings form element, so just pass that to the block for validation.
-    $settings = array(
+    $settings = new FormState(array(
       'values' => &$form_state['values']['settings']
-    );
+    ));
     // Call the plugin validate handler.
     $this->entity->getPlugin()->validateConfigurationForm($form, $settings);
   }
@@ -157,17 +159,17 @@ 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;
     // The Block Entity form puts all block plugin form elements in the
     // settings form element, so just pass that to the block for submission.
     // @todo Find a way to avoid this manipulation.
-    $settings = array(
+    $settings = new FormState(array(
       'values' => &$form_state['values']['settings'],
       'errors' => $form_state['errors'],
-    );
+    ));
 
     // Call the plugin submit handler.
     $entity->getPlugin()->submitConfigurationForm($form, $settings);
diff --git a/core/modules/block/src/BlockListBuilder.php b/core/modules/block/src/BlockListBuilder.php
index 1bf034d..644af01 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..d32bbc5 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..6d7d203 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..e362ce4 100644
--- a/core/modules/block/src/Plugin/views/display/Block.php
+++ b/core/modules/block/src/Plugin/views/display/Block.php
@@ -9,6 +9,7 @@
 namespace Drupal\block\Plugin\views\display;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\Block\ViewsBlock;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Views;
@@ -140,7 +141,7 @@ public function optionsSummary(&$categories, &$options) {
   /**
    * Provide the default form for setting options.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     switch ($form_state['section']) {
@@ -201,7 +202,7 @@ public function buildOptionsForm(&$form, &$form_state) {
    * Perform any necessary changes to the form values prior to storage.
    * There is no need for this function to actually store the data.
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::submitOptionsForm($form, $form_state);
     switch ($form_state['section']) {
       case 'block_description':
@@ -222,7 +223,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 +231,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, FormStateInterface &$form_state) {
     $allow_settings = array_filter($this->getOption('allow'));
 
     $block_configuration = $block->getConfiguration();
@@ -267,12 +268,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, FormStateInterface &$form_state) {
   }
 
   /**
@@ -282,12 +283,12 @@ 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()
    */
-  public function blockSubmit(ViewsBlock $block, $form, &$form_state) {
+  public function blockSubmit(ViewsBlock $block, $form, FormStateInterface &$form_state) {
     if (isset($form_state['values']['override']['items_per_page'])) {
       $block->setConfigurationValue('items_per_page', $form_state['values']['override']['items_per_page']);
     }
diff --git a/core/modules/block/src/Tests/BlockInterfaceTest.php b/core/modules/block/src/Tests/BlockInterfaceTest.php
index 77cdc7a..d07f168 100644
--- a/core/modules/block/src/Tests/BlockInterfaceTest.php
+++ b/core/modules/block/src/Tests/BlockInterfaceTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\block\Tests;
 
+use Drupal\Core\Form\FormState;
 use Drupal\simpletest\DrupalUnitTestBase;
 use Drupal\block\BlockInterface;
 
@@ -118,7 +119,7 @@ public function testBlockInterface() {
         '#default_value' => 'My custom display message.',
       ),
     );
-    $form_state = array();
+    $form_state = new FormState();
     // Ensure there are no form elements that do not belong to the plugin.
     $actual_form = $display_block->buildConfigurationForm(array(), $form_state);
     // Remove the visibility sections, as that just tests condition plugins.
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..544d7b8 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..67f7971 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..deaf1bf 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..6532e59 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..7d5e22b 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..e9c9199 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..3dd7626 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..e8c2781 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -8,6 +8,7 @@
 use Drupal\book\BookManagerInterface;
 use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\node\NodeInterface;
@@ -158,7 +159,7 @@ function book_node_links_alter(array &$node_links, NodeInterface $node, array &$
  *
  * @see book_pick_book_nojs_submit()
  */
-function book_form_node_form_alter(&$form, &$form_state, $form_id) {
+function book_form_node_form_alter(&$form, FormStateInterface &$form_state, $form_id) {
   $node = $form_state['controller']->getEntity();
   $account = \Drupal::currentUser();
   $access = $account->hasPermission('administer book outlines');
@@ -193,7 +194,7 @@ function book_form_node_form_alter(&$form, &$form_state, $form_id) {
  *
  * @todo: Remove this in favor of an entity field.
  */
-function book_node_builder($entity_type, NodeInterface $entity, &$form, &$form_state) {
+function book_node_builder($entity_type, NodeInterface $entity, &$form, FormStateInterface &$form_state) {
   $entity->book = $form_state['values']['book'];
 
   // Always save a revision for non-administrators.
@@ -214,7 +215,7 @@ function book_node_builder($entity_type, NodeInterface $entity, &$form, &$form_s
  * @see book_form_update()
  * @see book_form_node_form_alter()
  */
-function book_pick_book_nojs_submit($form, &$form_state) {
+function book_pick_book_nojs_submit($form, FormStateInterface &$form_state) {
   $node = $form_state['controller']->getEntity();
   $node->book = $form_state['values']['book'];
   $form_state['rebuild'] = TRUE;
@@ -309,7 +310,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, FormStateInterface &$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..7c3c787 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..0db041e 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..0ccebe9 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..38978ea 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, FormStateInterface &$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..3ac3ce2 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..c597929 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..bfa99b7 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..a77f790 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..c1c8c53 100644
--- a/core/modules/ckeditor/src/CKEditorPluginManager.php
+++ b/core/modules/ckeditor/src/CKEditorPluginManager.php
@@ -8,6 +8,7 @@
 namespace Drupal\ckeditor;
 
 use Drupal\Component\Utility\NestedArray;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
@@ -147,12 +148,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, FormStateInterface &$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..7040fd0 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..a501145 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..f8e5761 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..8216e5b 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..d5386cf 100644
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -8,6 +8,7 @@
 use Drupal\Component\Utility\Bytes;
 use Drupal\Component\Utility\Environment;
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
@@ -43,7 +44,7 @@ function color_theme() {
 /**
  * Implements hook_form_FORM_ID_alter().
  */
-function color_form_system_theme_settings_alter(&$form, &$form_state) {
+function color_form_system_theme_settings_alter(&$form, FormStateInterface &$form_state) {
   if (isset($form_state['build_info']['args'][0]) && ($theme = $form_state['build_info']['args'][0]) && color_get_info($theme) && function_exists('gd_info')) {
     $form['color'] = array(
       '#type' => 'details',
@@ -165,7 +166,7 @@ function color_get_palette($theme, $default = FALSE) {
  * @see color_scheme_form_validate()
  * @see color_scheme_form_submit()
  */
-function color_scheme_form($complete_form, &$form_state, $theme) {
+function color_scheme_form($complete_form, FormStateInterface &$form_state, $theme) {
   $base = drupal_get_path('module', 'color');
   $info = color_get_info($theme);
 
@@ -285,14 +286,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, FormStateInterface $form_state) {
   // 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.
@@ -328,7 +329,7 @@ function color_valid_hexadecimal_string($color) {
  *
  * @see color_scheme_form_submit()
  */
-function color_scheme_form_validate($form, &$form_state) {
+function color_scheme_form_validate($form, FormStateInterface &$form_state) {
   // Only accept hexadecimal CSS color strings to avoid XSS upon use.
   foreach ($form_state['values']['palette'] as $key => $color) {
     if (!color_valid_hexadecimal_string($color)) {
@@ -342,7 +343,7 @@ function color_scheme_form_validate($form, &$form_state) {
  *
  * @see color_scheme_form_validate()
  */
-function color_scheme_form_submit($form, &$form_state) {
+function color_scheme_form_submit($form, FormStateInterface &$form_state) {
 
   // Get theme coloring info.
   if (!isset($form_state['values']['info'])) {
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index a98ea09..6a2365a 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -18,6 +18,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\entity\Entity\EntityViewDisplay;
 use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
@@ -870,11 +871,13 @@ function comment_user_predelete($account) {
  *
  * @param \Drupal\comment\CommentInterface $comment
  *   The comment entity to preview.
+ * @param Drupal\Core\Form\FormStateInterface &$form_state
+ *   The current state of the form.
  *
  * @return array
  *   An array as expected by drupal_render().
  */
-function comment_preview(CommentInterface $comment, array &$form_state) {
+function comment_preview(CommentInterface $comment, FormStateInterface &$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..8eeab0c 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, FormStateInterface &$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..1c8c46c 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..da90976 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..849b942 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..6d768fc 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..b66f0de 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..0efccd8 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..cc26a8d 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..6a651e9 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..42d409f6 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/field/Comment.php b/core/modules/comment/src/Plugin/views/field/Comment.php
index 1a47a4a..2f92860 100644
--- a/core/modules/comment/src/Plugin/views/field/Comment.php
+++ b/core/modules/comment/src/Plugin/views/field/Comment.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -60,7 +61,7 @@ protected function defineOptions() {
   /**
    * Provide link-to-comment option
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['link_to_comment'] = array(
       '#title' => t('Link this field to its comment'),
       '#description' => t("Enable to override this field's links."),
diff --git a/core/modules/comment/src/Plugin/views/field/EntityLink.php b/core/modules/comment/src/Plugin/views/field/EntityLink.php
index f848210..9286e3f 100644
--- a/core/modules/comment/src/Plugin/views/field/EntityLink.php
+++ b/core/modules/comment/src/Plugin/views/field/EntityLink.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\ResultRow;
 
@@ -32,7 +33,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['teaser'] = array(
       '#type' => 'checkbox',
       '#title' => t('Show teaser-style link'),
diff --git a/core/modules/comment/src/Plugin/views/field/Link.php b/core/modules/comment/src/Plugin/views/field/Link.php
index a57ff12..89f9ce2 100644
--- a/core/modules/comment/src/Plugin/views/field/Link.php
+++ b/core/modules/comment/src/Plugin/views/field/Link.php
@@ -8,6 +8,7 @@
 namespace Drupal\comment\Plugin\views\field;
 
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\views\ResultRow;
@@ -65,7 +66,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['text'] = array(
       '#type' => 'textfield',
       '#title' => t('Text to display'),
diff --git a/core/modules/comment/src/Plugin/views/field/LinkEdit.php b/core/modules/comment/src/Plugin/views/field/LinkEdit.php
index f6137ad..c1783f4 100644
--- a/core/modules/comment/src/Plugin/views/field/LinkEdit.php
+++ b/core/modules/comment/src/Plugin/views/field/LinkEdit.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 
 /**
@@ -25,7 +26,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['destination'] = array(
diff --git a/core/modules/comment/src/Plugin/views/field/NodeNewComments.php b/core/modules/comment/src/Plugin/views/field/NodeNewComments.php
index 3366157..1be0d2b 100644
--- a/core/modules/comment/src/Plugin/views/field/NodeNewComments.php
+++ b/core/modules/comment/src/Plugin/views/field/NodeNewComments.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Database\Connection;
 use Drupal\comment\CommentInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\field\Numeric;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ResultRow;
@@ -82,7 +83,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['link_to_comment'] = array(
       '#title' => t('Link this field to new comments'),
       '#description' => t("Enable to override this field's links."),
diff --git a/core/modules/comment/src/Plugin/views/field/Username.php b/core/modules/comment/src/Plugin/views/field/Username.php
index c400144..3113d15 100644
--- a/core/modules/comment/src/Plugin/views/field/Username.php
+++ b/core/modules/comment/src/Plugin/views/field/Username.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -39,7 +40,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['link_to_user'] = array(
       '#title' => t("Link this field to its user or an author's homepage"),
       '#type' => 'checkbox',
diff --git a/core/modules/comment/src/Plugin/views/row/CommentRow.php b/core/modules/comment/src/Plugin/views/row/CommentRow.php
index 2d34728..8c6e048 100644
--- a/core/modules/comment/src/Plugin/views/row/CommentRow.php
+++ b/core/modules/comment/src/Plugin/views/row/CommentRow.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Plugin\views\row;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\row\EntityRow;
 
 /**
@@ -31,7 +32,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['links'] = array(
diff --git a/core/modules/comment/src/Plugin/views/row/Rss.php b/core/modules/comment/src/Plugin/views/row/Rss.php
index 8b8fc4a..350c0fa 100644
--- a/core/modules/comment/src/Plugin/views/row/Rss.php
+++ b/core/modules/comment/src/Plugin/views/row/Rss.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Plugin\views\row;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\row\RowPluginBase;
 
 /**
@@ -36,7 +37,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['view_mode'] = array(
diff --git a/core/modules/comment/src/Plugin/views/wizard/Comment.php b/core/modules/comment/src/Plugin/views/wizard/Comment.php
index c2c4ff4..3ef86f5 100644
--- a/core/modules/comment/src/Plugin/views/wizard/Comment.php
+++ b/core/modules/comment/src/Plugin/views/wizard/Comment.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Plugin\views\wizard;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\wizard\WizardPluginBase;
 
 /**
@@ -73,7 +74,7 @@ protected function rowStyleOptions() {
     return $options;
   }
 
-  protected function buildFormStyle(array &$form, array &$form_state, $type) {
+  protected function buildFormStyle(array &$form, FormStateInterface &$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 +102,7 @@ protected function buildFormStyle(array &$form, array &$form_state, $type) {
   /**
    * {@inheritdoc}
    */
-  protected function pageDisplayOptions(array $form, array &$form_state) {
+  protected function pageDisplayOptions(array $form, FormStateInterface &$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 +113,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, FormStateInterface &$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..5cc7f64 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..07b8bd1 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..f415a19 100644
--- a/core/modules/config/src/Form/ConfigSingleExportForm.php
+++ b/core/modules/config/src/Form/ConfigSingleExportForm.php
@@ -12,6 +12,8 @@
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormState;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -73,7 +75,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;
@@ -121,10 +123,10 @@ public function buildForm(array $form, array &$form_state, $config_type = NULL,
       '#suffix' => '</div>',
     );
     if ($config_type && $config_name) {
-      $fake_form_state = array('values' => array(
+      $fake_form_state = new FormState(array('values' => array(
         'config_type' => $config_type,
         'config_name' => $config_name,
-      ));
+      )));
       $form['export'] = $this->updateExport($form, $fake_form_state);
     }
     return $form;
@@ -133,7 +135,7 @@ public function buildForm(array $form, array &$form_state, $config_type = NULL,
   /**
    * Handles switching the configuration type selector.
    */
-  public function updateConfigurationType($form, &$form_state) {
+  public function updateConfigurationType($form, FormStateInterface &$form_state) {
     $form['config_name']['#options'] = $this->findConfiguration($form_state['values']['config_type']);
     return $form['config_name'];
   }
@@ -141,7 +143,7 @@ public function updateConfigurationType($form, &$form_state) {
   /**
    * Handles switching the export textarea.
    */
-  public function updateExport($form, &$form_state) {
+  public function updateExport($form, FormStateInterface &$form_state) {
     // Determine the full config name for the selected config entity.
     if ($form_state['values']['config_type'] !== 'system.simple') {
       $definition = $this->entityManager->getDefinition($form_state['values']['config_type']);
@@ -197,7 +199,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..2289e5a 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..ea1fce6 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..c99c9aa 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..f471b25 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..dd99b62 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..c54f6b7 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..14f6a98 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..82af14f 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..d00a71e 100644
--- a/core/modules/config_translation/src/FormElement/DateFormat.php
+++ b/core/modules/config_translation/src/FormElement/DateFormat.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\ReplaceCommand;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
 use Drupal\Core\TypedData\DataDefinitionInterface;
@@ -46,7 +47,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 +55,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, FormStateInterface $form_state) {
     $response = new AjaxResponse();
 
     $format_value = NestedArray::getValue($form_state['values'], $form_state['triggering_element']['#array_parents']);
diff --git a/core/modules/config_translation/tests/modules/config_translation_test/config_translation_test.module b/core/modules/config_translation/tests/modules/config_translation_test/config_translation_test.module
index d38be97..b54d261 100644
--- a/core/modules/config_translation/tests/modules/config_translation_test/config_translation_test.module
+++ b/core/modules/config_translation/tests/modules/config_translation_test/config_translation_test.module
@@ -6,6 +6,7 @@
  */
 
 use Drupal\Core\Extension\Extension;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Implements hook_system_info_alter().
@@ -47,7 +48,7 @@ function config_translation_test_config_translation_info_alter(&$info) {
  *
  * @see \Drupal\config_translation\Form\ConfigTranslationFormBase
  */
-function config_translation_test_form_config_translation_form_alter(&$form, &$form_state) {
+function config_translation_test_form_config_translation_form_alter(&$form, FormStateInterface &$form_state) {
   if (\Drupal::state()->get('config_translation_test_alter_form_alter')) {
     $form['#base_altered'] = TRUE;
   }
@@ -60,7 +61,7 @@ function config_translation_test_form_config_translation_form_alter(&$form, &$fo
  *
  * @see \Drupal\config_translation\Form\ConfigTranslationAddForm
  */
-function config_translation_test_form_config_translation_add_form_alter(&$form, &$form_state) {
+function config_translation_test_form_config_translation_add_form_alter(&$form, FormStateInterface &$form_state) {
   if (\Drupal::state()->get('config_translation_test_alter_form_alter')) {
     $form['#altered'] = TRUE;
   }
@@ -77,7 +78,7 @@ function config_translation_test_form_config_translation_add_form_alter(&$form,
  *
  * @see \Drupal\config_translation\Form\ConfigTranslationEditForm
  */
-function config_translation_test_form_config_translation_edit_form_alter(&$form, &$form_state) {
+function config_translation_test_form_config_translation_edit_form_alter(&$form, FormStateInterface &$form_state) {
   if (\Drupal::state()->get('config_translation_test_alter_form_alter')) {
     $form['#altered'] = TRUE;
   }
diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module
index e8485c1..bbafe09 100644
--- a/core/modules/contact/contact.module
+++ b/core/modules/contact/contact.module
@@ -5,6 +5,7 @@
  * Enables the use of personal and site-wide contact forms.
  */
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
@@ -162,7 +163,7 @@ function contact_mail($key, &$message, $params) {
  *
  * @see \Drupal\user\ProfileForm::form()
  */
-function contact_form_user_form_alter(&$form, &$form_state) {
+function contact_form_user_form_alter(&$form, FormStateInterface &$form_state) {
   $form['contact'] = array(
     '#type' => 'details',
     '#title' => t('Contact settings'),
@@ -185,7 +186,7 @@ function contact_form_user_form_alter(&$form, &$form_state) {
 /**
  * Submit callback for the user profile form to save the contact page setting.
  */
-function contact_user_profile_form_submit($form, &$form_state) {
+function contact_user_profile_form_submit($form, FormStateInterface &$form_state) {
   $account = $form_state['controller']->getEntity();
   if ($account->id() && isset($form_state['values']['contact'])) {
     \Drupal::service('user.data')->set('contact', $account->id(), 'enabled', (int) $form_state['values']['contact']);
@@ -199,7 +200,7 @@ function contact_user_profile_form_submit($form, &$form_state) {
  *
  * @see user_admin_settings()
  */
-function contact_form_user_admin_settings_alter(&$form, &$form_state) {
+function contact_form_user_admin_settings_alter(&$form, FormStateInterface &$form_state) {
   $form['contact'] = array(
     '#type' => 'details',
     '#title' => t('Contact settings'),
@@ -221,7 +222,7 @@ function contact_form_user_admin_settings_alter(&$form, &$form_state) {
  *
  * @see contact_form_user_admin_settings_alter()
  */
-function contact_form_user_admin_settings_submit($form, &$form_state) {
+function contact_form_user_admin_settings_submit($form, FormStateInterface &$form_state) {
   \Drupal::config('contact.settings')
     ->set('user_default_enabled', $form_state['values']['contact_default_status'])
     ->save();
diff --git a/core/modules/contact/src/CategoryForm.php b/core/modules/contact/src/CategoryForm.php
index fd315a6..ff25a51 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..a8e18f9 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..4274a79 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, FormStateInterface &$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/contact/src/Plugin/views/field/ContactLink.php b/core/modules/contact/src/Plugin/views/field/ContactLink.php
index e0daca3..017dc6a 100644
--- a/core/modules/contact/src/Plugin/views/field/ContactLink.php
+++ b/core/modules/contact/src/Plugin/views/field/ContactLink.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Access\AccessManager;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\user\Plugin\views\field\Link;
 use Drupal\views\ResultRow;
@@ -84,7 +85,7 @@ public static function create(ContainerInterface $container, array $configuratio
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['text']['#title'] = t('Link label');
     $form['text']['#required'] = TRUE;
diff --git a/core/modules/content_translation/content_translation.admin.inc b/core/modules/content_translation/content_translation.admin.inc
index 7e7e790..a362ada 100644
--- a/core/modules/content_translation/content_translation.admin.inc
+++ b/core/modules/content_translation/content_translation.admin.inc
@@ -8,6 +8,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\ContentEntityTypeInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Render\Element;
 use Drupal\field\FieldInstanceConfigInterface;
@@ -60,7 +61,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, FormStateInterface &$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 +255,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, FormStateInterface &$form_state) {
   $settings = &$form_state['values']['settings'];
   foreach ($settings as $entity_type => $entity_settings) {
     foreach ($entity_settings as $bundle => $bundle_settings) {
@@ -284,7 +285,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, FormStateInterface &$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..9b7b176 100644
--- a/core/modules/content_translation/content_translation.module
+++ b/core/modules/content_translation/content_translation.module
@@ -9,6 +9,7 @@
 use Drupal\Core\Entity\EntityFormInterface;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\field\Entity\FieldInstanceConfig;
@@ -366,7 +367,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 +376,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 +459,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, FormStateInterface &$form_state) {
   $form_controller = content_translation_form_controller($form_state);
   $entity = $form_controller ? $form_controller->getEntity() : NULL;
 
@@ -644,7 +645,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, FormStateInterface &$form_state) {
   $instance = $form_state['instance'];
   $bundle_is_translatable = content_translation_enabled($instance->entity_type, $instance->bundle);
 
@@ -722,10 +723,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, FormStateInterface &$form_state) {
   $key = $form_state['content_translation']['key'];
   if (!isset($form_state['language'][$key])) {
     $form_state['language'][$key] = array();
@@ -745,7 +746,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, FormStateInterface &$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 +773,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, FormStateInterface &$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 +794,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, FormStateInterface &$form_state) {
   $key = $form_state['content_translation']['key'];
   $context = $form_state['language'][$key];
   $enabled = $form_state['values'][$key]['content_translation'];
@@ -808,7 +809,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, FormStateInterface &$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..4c613f0 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, FormStateInterface &$form_state) {
     $form_controller = content_translation_form_controller($form_state);
     $form_langcode = $form_controller->getFormLangcode($form_state);
 
@@ -410,7 +411,7 @@ public function entityFormEntityBuild($entity_type, EntityInterface $entity, arr
    *
    * Validates the submitted content translation metadata.
    */
-  function entityFormValidate($form, &$form_state) {
+  function entityFormValidate($form, FormStateInterface &$form_state) {
     if (!empty($form_state['values']['content_translation'])) {
       $translation = $form_state['values']['content_translation'];
       // Validate the "authored by" field.
@@ -429,7 +430,7 @@ function entityFormValidate($form, &$form_state) {
    *
    * Takes care of the source language change.
    */
-  public function entityFormSourceChange($form, &$form_state) {
+  public function entityFormSourceChange($form, FormStateInterface &$form_state) {
     $form_controller = content_translation_form_controller($form_state);
     $entity = $form_controller->getEntity();
     $source = $form_state['values']['source_langcode']['source'];
@@ -445,7 +446,7 @@ public function entityFormSourceChange($form, &$form_state) {
    *
    * Takes care of entity deletion.
    */
-  function entityFormDelete($form, &$form_state) {
+  function entityFormDelete($form, FormStateInterface &$form_state) {
     $form_controller = content_translation_form_controller($form_state);
     $entity = $form_controller->getEntity();
     if (count($entity->getTranslationLanguages()) > 1) {
@@ -458,7 +459,7 @@ function entityFormDelete($form, &$form_state) {
    *
    * Takes care of content translation deletion.
    */
-  function entityFormDeleteTranslation($form, &$form_state) {
+  function entityFormDeleteTranslation($form, FormStateInterface &$form_state) {
     $form_controller = content_translation_form_controller($form_state);
     $entity = $form_controller->getEntity();
     $path = $entity->getSystemPath('drupal:content-translation-overview');
diff --git a/core/modules/content_translation/src/ContentTranslationHandlerInterface.php b/core/modules/content_translation/src/ContentTranslationHandlerInterface.php
index c41fd27..9762c99 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..2343846 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/content_translation/src/Plugin/views/field/TranslationLink.php b/core/modules/content_translation/src/Plugin/views/field/TranslationLink.php
index 2a6ec79..3ca637f 100644
--- a/core/modules/content_translation/src/Plugin/views/field/TranslationLink.php
+++ b/core/modules/content_translation/src/Plugin/views/field/TranslationLink.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\content_translation\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\views\ResultRow;
@@ -32,7 +33,7 @@ protected function defineOptions() {
   /**
    * Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::buildOptionsForm().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['text'] = array(
       '#type' => 'textfield',
       '#title' => t('Text to display'),
diff --git a/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php b/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
index aff000c..1474154 100644
--- a/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
+++ b/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Serialization\Json;
 use Drupal\Component\Utility\UrlHelper;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\ResultRow;
 
@@ -37,7 +38,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $all_fields = $this->view->display_handler->getFieldLabels();
     // Offer to include only those fields that follow this one.
     $field_options = array_slice($all_fields, 0, array_search($this->options['id'], array_keys($all_fields)));
diff --git a/core/modules/datetime/datetime.module b/core/modules/datetime/datetime.module
index b5f98dd..2445ad9 100644
--- a/core/modules/datetime/datetime.module
+++ b/core/modules/datetime/datetime.module
@@ -7,6 +7,7 @@
 
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Datetime\DrupalDateTime;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Template\Attribute;
 use Drupal\datetime\DateHelper;
@@ -119,10 +120,10 @@ 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) {
+function datetime_datetime_widget_validate(&$element, FormStateInterface &$form_state) {
   if (!form_get_errors($form_state)) {
     $input_exists = FALSE;
     $input = NestedArray::getValue($form_state['values'], $element['#parents'], $input_exists);
@@ -157,10 +158,10 @@ 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) {
+function datetime_datelist_widget_validate(&$element, FormStateInterface &$form_state) {
   if (!form_get_errors($form_state)) {
     $input_exists = FALSE;
     $input = NestedArray::getValue($form_state['values'], $element['#parents'], $input_exists);
@@ -352,13 +353,13 @@ 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
  *   The form element whose value has been processed.
  */
-function datetime_datetime_form_process($element, &$form_state) {
+function datetime_datetime_form_process($element, FormStateInterface &$form_state) {
   $format_settings = array();
   // The value callback has populated the #value array.
   $date = !empty($element['#value']['object']) ? $element['#value']['object'] : NULL;
@@ -527,10 +528,10 @@ 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) {
+function datetime_datetime_validate($element, FormStateInterface &$form_state) {
 
   $input_exists = FALSE;
   $input = NestedArray::getValue($form_state['values'], $element['#parents'], $input_exists);
@@ -675,10 +676,10 @@ 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) {
+function datetime_datelist_form_process($element, FormStateInterface &$form_state) {
 
   // Load translated date part labels from the appropriate calendar plugin.
   $date_helper = new DateHelper();
@@ -788,14 +789,12 @@ function datetime_datelist_form_process($element, &$form_state) {
  * @param array $element
  *   The element being processed.
  * @param array|false $input
- *
- * @param array $form_state
- *   (optional) The current state of the form.  Defaults to an empty array.
+ * @param \Drupal\Core\Form\FormStateInterface $form_state
+ *   The current state of the form.
  *
  * @return array
- *
  */
-function form_type_datelist_value($element, $input = FALSE, &$form_state = array()) {
+function form_type_datelist_value($element, $input = FALSE, FormStateInterface &$form_state) {
   $parts = $element['#date_part_order'];
   $increment = $element['#date_increment'];
 
@@ -871,10 +870,10 @@ 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) {
+function datetime_datelist_validate($element, FormStateInterface &$form_state) {
   $input_exists = FALSE;
   $input = NestedArray::getValue($form_state['values'], $element['#parents'], $input_exists);
   if ($input_exists) {
@@ -1001,7 +1000,7 @@ function datetime_range_years($string, $date = NULL) {
 /**
  * Implements hook_form_BASE_FORM_ID_alter() for node forms.
  */
-function datetime_form_node_form_alter(&$form, &$form_state, $form_id) {
+function datetime_form_node_form_alter(&$form, FormStateInterface &$form_state, $form_id) {
   // Alter the 'Authored on' date to use datetime.
   $form['created']['#type'] = 'datetime';
   $date_format = entity_load('date_format', 'html_date')->getPattern();
@@ -1013,7 +1012,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, FormStateInterface &$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..58ae1b8 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..1f6f2ef 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..0ec4fa1 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..8815ebc 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..85b84a2 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/dblog.module b/core/modules/dblog/dblog.module
index d6e20ff..d1c17a1 100644
--- a/core/modules/dblog/dblog.module
+++ b/core/modules/dblog/dblog.module
@@ -11,6 +11,7 @@
  * @see watchdog()
  */
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
@@ -112,6 +113,6 @@ function dblog_form_system_logging_settings_alter(&$form, $form_state) {
  *
  * @see dblog_form_system_logging_settings_alter()
  */
-function dblog_logging_settings_submit($form, &$form_state) {
+function dblog_logging_settings_submit($form, FormStateInterface &$form_state) {
   \Drupal::config('dblog.settings')->set('row_limit', $form_state['values']['dblog_row_limit'])->save();
 }
diff --git a/core/modules/dblog/src/Form/DblogClearLogConfirmForm.php b/core/modules/dblog/src/Form/DblogClearLogConfirmForm.php
index 3c668a8..da08a3c 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..6556820 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..7682484 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, FormStateInterface &$form_state) {
     $_SESSION['dblog_overview_filter'] = array();
   }
 
diff --git a/core/modules/dblog/src/Plugin/views/field/DblogMessage.php b/core/modules/dblog/src/Plugin/views/field/DblogMessage.php
index e6595d2..8e28bb5 100644
--- a/core/modules/dblog/src/Plugin/views/field/DblogMessage.php
+++ b/core/modules/dblog/src/Plugin/views/field/DblogMessage.php
@@ -8,6 +8,7 @@
 namespace Drupal\dblog\Plugin\views\field;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\ResultRow;
 use Drupal\views\ViewExecutable;
@@ -46,7 +47,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['replace_variables'] = array(
diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module
index 5aa7929..ad6e80c 100644
--- a/core/modules/editor/editor.module
+++ b/core/modules/editor/editor.module
@@ -7,6 +7,7 @@
 
 use Drupal\Component\Utility\Html;
 use Drupal\Core\Entity\ContentEntityInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\editor\Entity\Editor;
@@ -91,7 +92,7 @@ function editor_form_filter_admin_overview_alter(&$form, $form_state) {
 /**
  * Implements hook_form_BASE_FORM_ID_alter() for 'filter_format_form'.
  */
-function editor_form_filter_format_form_alter(&$form, &$form_state) {
+function editor_form_filter_format_form_alter(&$form, FormStateInterface &$form_state) {
   if (!isset($form_state['editor'])) {
     $format_id = $form_state['controller']->getEntity()->id();
     $form_state['editor'] = editor_load($format_id);
@@ -168,7 +169,7 @@ function editor_form_filter_format_form_alter(&$form, &$form_state) {
 /**
  * Button submit handler for filter_format_form()'s 'editor_configure' button.
  */
-function editor_form_filter_admin_format_editor_configure($form, &$form_state) {
+function editor_form_filter_admin_format_editor_configure($form, FormStateInterface &$form_state) {
   $editor = $form_state['editor'];
   if (isset($form_state['values']['editor']['editor'])) {
     if ($form_state['values']['editor']['editor'] === '') {
@@ -188,14 +189,14 @@ function editor_form_filter_admin_format_editor_configure($form, &$form_state) {
 /**
  * AJAX callback handler for filter_format_form().
  */
-function editor_form_filter_admin_form_ajax($form, &$form_state) {
+function editor_form_filter_admin_form_ajax($form, FormStateInterface &$form_state) {
   return $form['editor']['settings'];
 }
 
 /**
  * Additional validate handler for filter_format_form().
  */
-function editor_form_filter_admin_format_validate($form, &$form_state) {
+function editor_form_filter_admin_format_validate($form, FormStateInterface &$form_state) {
   // This validate handler is not applicable when using the 'Configure' button.
   if ($form_state['triggering_element']['#name'] === 'editor_configure') {
     return;
@@ -213,7 +214,7 @@ function editor_form_filter_admin_format_validate($form, &$form_state) {
 /**
  * Additional submit handler for filter_format_form().
  */
-function editor_form_filter_admin_format_submit($form, &$form_state) {
+function editor_form_filter_admin_format_submit($form, FormStateInterface &$form_state) {
   // Delete the existing editor if disabling or switching between editors.
   $format_id = $form_state['controller']->getEntity()->id();
   $original_editor = editor_load($format_id);
diff --git a/core/modules/editor/src/Form/EditorImageDialog.php b/core/modules/editor/src/Form/EditorImageDialog.php
index 23a4e20..24274f8 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..f392416 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..1d43460 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..690a4fd 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..cef5c68 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..e8024d8 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..766fc8c 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..715e341 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..f3c2401 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,11 @@ public function form(array $form, array &$form_state) {
    *   The entity ID.
    * @param array $element
    *   The form element.
-   * @param array $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) {
     // Do not allow to add internal 'default' view mode.
     if ($entity_id == 'default') {
       return TRUE;
@@ -122,7 +121,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/entity_reference.module b/core/modules/entity_reference/entity_reference.module
index 48ffc92..f95cd7c 100644
--- a/core/modules/entity_reference/entity_reference.module
+++ b/core/modules/entity_reference/entity_reference.module
@@ -9,6 +9,7 @@
 use Drupal\Core\Database\Query\AlterableInterface;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\field\Entity\FieldConfig;
@@ -149,7 +150,7 @@ function _entity_reference_form_process_merge_parent($element) {
 /**
  * Form element validation handler; Filters the #value property of an element.
  */
-function _entity_reference_element_validate_filter(&$element, &$form_state) {
+function _entity_reference_element_validate_filter(&$element, FormStateInterface &$form_state) {
   $element['#value'] = array_filter($element['#value']);
   form_set_value($element, $element['#value'], $form_state);
 }
@@ -169,7 +170,7 @@ function entity_reference_settings_ajax($form, $form_state) {
  *
  * @see entity_reference_field_instance_settings_form()
  */
-function entity_reference_settings_ajax_submit($form, &$form_state) {
+function entity_reference_settings_ajax_submit($form, FormStateInterface &$form_state) {
   $form_state['rebuild'] = TRUE;
 }
 
diff --git a/core/modules/entity_reference/src/ConfigurableEntityReferenceItem.php b/core/modules/entity_reference/src/ConfigurableEntityReferenceItem.php
index cabf660..19d276d 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, FormStateInterface &$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..dbe3a04 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..013aaa3 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..2819ecf 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/AutocompleteTagsWidget.php b/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteTagsWidget.php
index f930de2..e097071 100644
--- a/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteTagsWidget.php
+++ b/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteTagsWidget.php
@@ -8,6 +8,7 @@
 namespace Drupal\entity_reference\Plugin\Field\FieldWidget;
 
 use Drupal\Component\Utility\Tags;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'entity_reference autocomplete-tags' widget.
@@ -39,7 +40,7 @@ public static function defaultSettings() {
   /**
    * {@inheritdoc}
    */
-  public function elementValidate($element, &$form_state, $form) {
+  public function elementValidate($element, FormStateInterface &$form_state, $form) {
     $value = array();
     // If a value was entered into the autocomplete.
     $handler = \Drupal::service('plugin.manager.entity_reference.selection')->getSelectionHandler($this->fieldDefinition);
diff --git a/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteWidget.php b/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteWidget.php
index 234eb7a..e9b9b7f 100644
--- a/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteWidget.php
+++ b/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteWidget.php
@@ -8,6 +8,7 @@
 namespace Drupal\entity_reference\Plugin\Field\FieldWidget;
 
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Plugin implementation of the 'entity_reference autocomplete' widget.
@@ -57,7 +58,7 @@ protected function getEntityIds(FieldItemListInterface $items, $delta) {
   /**
    * {@inheritdoc}
    */
-  public function elementValidate($element, &$form_state, $form) {
+  public function elementValidate($element, FormStateInterface &$form_state, $form) {
     $auto_create = $this->getSelectionHandlerSetting('auto_create');
 
     // If a value was entered into the autocomplete.
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..0d7ff78 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,14 +104,14 @@ 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'];
   }
 
   /**
    * Validates an element.
    */
-  public function elementValidate($element, &$form_state, $form) { }
+  public function elementValidate($element, FormStateInterface &$form_state, $form) { }
 
   /**
    * Gets the entity labels.
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..5da5ba7 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..d3415dd 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..cbfca39 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/entity_reference/src/Plugin/views/row/EntityReference.php b/core/modules/entity_reference/src/Plugin/views/row/EntityReference.php
index b975b0a..1bbdd15 100644
--- a/core/modules/entity_reference/src/Plugin/views/row/EntityReference.php
+++ b/core/modules/entity_reference/src/Plugin/views/row/EntityReference.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\entity_reference\Plugin\views\row;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\row\Fields;
 
 /**
@@ -38,7 +39,7 @@ protected function defineOptions() {
   /**
    * Overrides \Drupal\views\Plugin\views\row\Fields::buildOptionsForm().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     // Expand the description of the 'Inline field' checkboxes.
diff --git a/core/modules/entity_reference/src/Plugin/views/style/EntityReference.php b/core/modules/entity_reference/src/Plugin/views/style/EntityReference.php
index 37a446b..37aad61 100644
--- a/core/modules/entity_reference/src/Plugin/views/style/EntityReference.php
+++ b/core/modules/entity_reference/src/Plugin/views/style/EntityReference.php
@@ -8,6 +8,7 @@
 namespace Drupal\entity_reference\Plugin\views\style;
 
 use Drupal\Component\Utility\Xss;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\style\StylePluginBase;
 
 /**
@@ -54,7 +55,7 @@ protected function defineOptions() {
   /**
    * Overrides \Drupal\views\Plugin\views\style\StylePluginBase\StylePluginBase::buildOptionsForm().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $options = $this->displayHandler->getFieldLabels(TRUE);
diff --git a/core/modules/field/field.api.php b/core/modules/field/field.api.php
index fed48ca..efcd194 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
@@ -120,7 +120,7 @@ function hook_field_widget_info_alter(array &$info) {
  * @see \Drupal\Core\Field\WidgetBase::formSingleElement()
  * @see hook_field_widget_WIDGET_TYPE_form_alter()
  */
-function hook_field_widget_form_alter(&$element, &$form_state, $context) {
+function hook_field_widget_form_alter(&$element, \Drupal\Core\Form\FormStateInterface &$form_state, $context) {
   // Add a css class to widget form elements for all fields of type mytype.
   $field_definition = $context['items']->getFieldDefinition();
   if ($field_definition->getType() == 'mytype') {
@@ -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.
@@ -147,7 +147,7 @@ function hook_field_widget_form_alter(&$element, &$form_state, $context) {
  * @see \Drupal\Core\Field\WidgetBase::formSingleElement()
  * @see hook_field_widget_form_alter()
  */
-function hook_field_widget_WIDGET_TYPE_form_alter(&$element, &$form_state, $context) {
+function hook_field_widget_WIDGET_TYPE_form_alter(&$element, \Drupal\Core\Form\FormStateInterface &$form_state, $context) {
   // Code here will only act on widgets of type WIDGET_TYPE.  For example,
   // hook_field_widget_mymodule_autocomplete_form_alter() will only act on
   // widgets of type 'mymodule_autocomplete'.
diff --git a/core/modules/field/field.module b/core/modules/field/field.module
index 5695f40..783145a 100644
--- a/core/modules/field/field.module
+++ b/core/modules/field/field.module
@@ -9,6 +9,7 @@
 use Drupal\Core\Config\ConfigImporter;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Extension\Extension;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /*
@@ -343,7 +344,7 @@ function field_config_import_steps_alter(&$sync_steps, ConfigImporter $config_im
  *
  * @see \Drupal\field\ConfigImporterFieldPurger
  */
-function field_form_config_admin_import_form_alter(&$form, &$form_state) {
+function field_form_config_admin_import_form_alter(&$form, FormStateInterface &$form_state) {
   // Only display the message when there is a storage comparer available and the
   // form is not submitted.
   if (isset($form_state['storage_comparer']) && empty($form_state['input'])) {
diff --git a/core/modules/field/src/Plugin/views/argument/FieldList.php b/core/modules/field/src/Plugin/views/argument/FieldList.php
index d55ca6a..9d7dbcf 100644
--- a/core/modules/field/src/Plugin/views/argument/FieldList.php
+++ b/core/modules/field/src/Plugin/views/argument/FieldList.php
@@ -8,6 +8,7 @@
 namespace Drupal\field\Plugin\views\argument;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\argument\Numeric;
@@ -47,7 +48,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['summary']['human'] = array(
diff --git a/core/modules/field/src/Plugin/views/argument/ListString.php b/core/modules/field/src/Plugin/views/argument/ListString.php
index 742a151..a8dd7cf 100644
--- a/core/modules/field/src/Plugin/views/argument/ListString.php
+++ b/core/modules/field/src/Plugin/views/argument/ListString.php
@@ -8,6 +8,7 @@
 namespace Drupal\field\Plugin\views\argument;
 
 use Drupal\Component\Utility\String as UtilityString;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\argument\String;
@@ -48,7 +49,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['summary']['human'] = array(
diff --git a/core/modules/field/src/Plugin/views/field/Field.php b/core/modules/field/src/Plugin/views/field/Field.php
index c678554..a51e2eb 100644
--- a/core/modules/field/src/Plugin/views/field/Field.php
+++ b/core/modules/field/src/Plugin/views/field/Field.php
@@ -15,6 +15,7 @@
 use Drupal\Core\Field\FieldDefinition;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\Core\Field\FormatterPluginManager;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Language\LanguageManager;
 use Drupal\Core\Render\Element;
@@ -432,7 +433,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $field = $this->getFieldDefinition();
@@ -513,7 +514,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * Provide options for multiple value fields.
    */
-  function multiple_options_form(&$form, &$form_state) {
+  function multiple_options_form(&$form, FormStateInterface &$form_state) {
     $field = $this->getFieldDefinition();
 
     $form['multiple_field_settings'] = array(
@@ -636,7 +637,7 @@ function multiple_options_form(&$form, &$form_state) {
   /**
    * Extend the groupby form with group columns.
    */
-  public function buildGroupByForm(&$form, &$form_state) {
+  public function buildGroupByForm(&$form, FormStateInterface &$form_state) {
     parent::buildGroupByForm($form, $form_state);
     // With "field API" fields, the column target of the grouping function
     // and any additional grouping columns must be specified.
@@ -669,7 +670,7 @@ public function buildGroupByForm(&$form, &$form_state) {
     );
   }
 
-  public function submitGroupByForm(&$form, &$form_state) {
+  public function submitGroupByForm(&$form, FormStateInterface &$form_state) {
     parent::submitGroupByForm($form, $form_state);
     $item = &$form_state['handler']->options;
 
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/field_test.module b/core/modules/field/tests/modules/field_test/field_test.module
index 6c9b7d4..36c16b9 100644
--- a/core/modules/field/tests/modules/field_test/field_test.module
+++ b/core/modules/field/tests/modules/field_test/field_test.module
@@ -1,6 +1,7 @@
 <?php
 
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\field\FieldConfigInterface;
 
 /**
@@ -115,7 +116,7 @@ function field_test_entity_display_build_alter(&$output, $context) {
 /**
  * Implements hook_field_widget_form_alter().
  */
-function field_test_field_widget_form_alter(&$element, &$form_state, $context) {
+function field_test_field_widget_form_alter(&$element, FormStateInterface &$form_state, $context) {
   $field_definition = $context['items']->getFieldDefinition();
   switch ($field_definition->getName()) {
     case 'alter_test_text':
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..438f857 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..d2acf58 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..29e9a46 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..6668b39 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..1b5c8c1 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..31b6bae 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..b197c84 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..543a858 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,14 +80,14 @@ 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;
   }
 
   /**
    * Element validation helper.
    */
-  public static function multipleValidate($element, &$form_state) {
+  public static function multipleValidate($element, FormStateInterface &$form_state) {
     $values = array_map('trim', explode(',', $element['#value']));
     $items = array();
     foreach ($values as $value) {
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/field_ui.module b/core/modules/field_ui/field_ui.module
index 4fe550c..cf1f864 100644
--- a/core/modules/field_ui/field_ui.module
+++ b/core/modules/field_ui/field_ui.module
@@ -6,6 +6,7 @@
  */
 
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\entity\EntityViewModeInterface;
@@ -198,7 +199,7 @@ function field_ui_entity_operation(EntityInterface $entity) {
  *
  * @see field_ui_form_node_type_form_alter()
  */
-function field_ui_form_node_type_form_submit($form, &$form_state) {
+function field_ui_form_node_type_form_submit($form, FormStateInterface &$form_state) {
   if ($form_state['triggering_element']['#parents'][0] === 'save_continue' && $route_info = FieldUI::getOverviewRouteInfo('node', $form_state['values']['type'])) {
     $form_state['redirect_route'] = $route_info;
   }
diff --git a/core/modules/field_ui/src/DisplayOverview.php b/core/modules/field_ui/src/DisplayOverview.php
index 3c55ec0..bdd610d 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..ac9350e 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..2ffd068 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, FormStateInterface &$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, FormStateInterface &$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..d2884b9 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..a8864e4 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..4acd77e 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, FormStateInterface &$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..17442cb 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..6f330d5 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..a26cd0e 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -7,6 +7,7 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\file\Entity\File;
@@ -741,8 +742,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.
@@ -1158,7 +1159,7 @@ function file_token_info() {
  *
  * This function is assigned as a #process callback in file_element_info().
  */
-function file_managed_file_process($element, &$form_state, $form) {
+function file_managed_file_process($element, FormStateInterface &$form_state, $form) {
   // Append the '-upload' to the #id so the field label's 'for' attribute
   // corresponds with the file element.
   $element['#id'] .= '-upload';
@@ -1305,7 +1306,7 @@ function file_managed_file_process($element, &$form_state, $form) {
  *
  * This function is assigned as a #value_callback in file_element_info().
  */
-function file_managed_file_value(&$element, $input, &$form_state) {
+function file_managed_file_value(&$element, $input, FormStateInterface &$form_state) {
   // Find the current value of this field.
   $fids = !empty($input['fids']) ? explode(' ', $input['fids']) : array();
   foreach ($fids as $key => $fid) {
@@ -1381,7 +1382,7 @@ function file_managed_file_value(&$element, $input, &$form_state) {
  * This function is assigned as a #element_validate callback in
  * file_element_info().
  */
-function file_managed_file_validate(&$element, &$form_state) {
+function file_managed_file_validate(&$element, FormStateInterface &$form_state) {
   // If referencing an existing file, only allow if there are existing
   // references. This prevents unmanaged files from being deleted if this
   // item were to be deleted.
@@ -1419,7 +1420,7 @@ function file_managed_file_validate(&$element, &$form_state) {
  *
  * @see file_managed_file_process()
  */
-function file_managed_file_submit($form, &$form_state) {
+function file_managed_file_submit($form, FormStateInterface &$form_state) {
   // Determine whether it was the upload or the remove button that was clicked,
   // and set $element to the managed_file element that contains that button.
   $parents = $form_state['triggering_element']['#array_parents'];
@@ -1483,14 +1484,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, FormStateInterface &$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..9124a11 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..4f5c5d5 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();
 
@@ -208,7 +209,7 @@ public function instanceSettingsForm(array $form, array &$form_state) {
    * This function is assigned as an #element_validate callback in
    * instanceSettingsForm().
    */
-  public static function validateDirectory($element, &$form_state) {
+  public static function validateDirectory($element, FormStateInterface &$form_state) {
     // Strip slashes from the beginning and end of $element['file_directory'].
     $value = trim($element['#value'], '\\/');
     form_set_value($element, $value, $form_state);
@@ -224,7 +225,7 @@ public static function validateDirectory($element, &$form_state) {
    * Commas are allowed by the end-user, but ultimately the value will be stored
    * as a space-separated list for compatibility with file_validate_extensions().
    */
-  public static function validateExtensions($element, &$form_state) {
+  public static function validateExtensions($element, FormStateInterface &$form_state) {
     if (!empty($element['#value'])) {
       $extensions = preg_replace('/([, ]+\.?)/', ' ', trim(strtolower($element['#value'])));
       $extensions = array_filter(explode(' ', $extensions));
@@ -247,7 +248,7 @@ public static function validateExtensions($element, &$form_state) {
    * This function is assigned as an #element_validate callback in
    * instanceSettingsForm().
    */
-  public static function validateMaxFilesize($element, &$form_state) {
+  public static function validateMaxFilesize($element, FormStateInterface &$form_state) {
     if (!empty($element['#value']) && !is_numeric(Bytes::toInt($element['#value']))) {
       form_error($element, $form_state, t('The "!name" option must contain a valid value. You may either leave the text field empty or enter a string like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes).', array('!name' => t($element['title']))));
     }
diff --git a/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php b/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php
index 8f7fb02..75e81a0 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.
@@ -306,7 +307,7 @@ public static function value($element, $input = FALSE, $form_state) {
    *
    * This validator is used only when cardinality not set to 1 or unlimited.
    */
-  public static function validateMultipleCount($element, &$form_state, $form) {
+  public static function validateMultipleCount($element, FormStateInterface &$form_state, $form) {
     $parents = $element['#parents'];
     $values = NestedArray::getValue($form_state['values'], $parents);
 
@@ -341,7 +342,7 @@ public static function validateMultipleCount($element, &$form_state, $form) {
    *
    * This method is assigned as a #process callback in formElement() method.
    */
-  public static function process($element, &$form_state, $form) {
+  public static function process($element, FormStateInterface &$form_state, $form) {
     $item = $element['#value'];
     $item['fids'] = $element['fids']['#value'];
 
@@ -419,7 +420,7 @@ public static function process($element, &$form_state, $form) {
    * This method on is assigned as a #process callback in formMultipleElements()
    * method.
    */
-  public static function processMultiple($element, &$form_state, $form) {
+  public static function processMultiple($element, FormStateInterface &$form_state, $form) {
     $element_children = Element::children($element, TRUE);
     $count = count($element_children);
 
@@ -484,7 +485,7 @@ protected static function getDescriptionFromElement($element) {
    *
    * @see file_managed_file_submit()
    */
-  public static function submit($form, &$form_state) {
+  public static function submit($form, FormStateInterface &$form_state) {
     // During the form rebuild, formElement() will create field item widget
     // elements using re-indexed deltas, so clear out $form_state['input'] to
     // avoid a mismatch between old and new deltas. The rebuilt elements will
diff --git a/core/modules/file/src/Plugin/views/field/Extension.php b/core/modules/file/src/Plugin/views/field/Extension.php
index 1272e2f..8ab3851 100644
--- a/core/modules/file/src/Plugin/views/field/Extension.php
+++ b/core/modules/file/src/Plugin/views/field/Extension.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\ResultRow;
 
@@ -31,7 +32,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['extension_detect_tar'] = array(
       '#type' => 'checkbox',
diff --git a/core/modules/file/src/Plugin/views/field/File.php b/core/modules/file/src/Plugin/views/field/File.php
index 0ce77e8..da6ff84 100644
--- a/core/modules/file/src/Plugin/views/field/File.php
+++ b/core/modules/file/src/Plugin/views/field/File.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -41,7 +42,7 @@ protected function defineOptions() {
   /**
    * Provide link to file option
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['link_to_file'] = array(
       '#title' => t('Link this field to download the file'),
       '#description' => t("Enable to override this field's links."),
diff --git a/core/modules/file/src/Plugin/views/field/FileMime.php b/core/modules/file/src/Plugin/views/field/FileMime.php
index fd1c355..f101c08 100644
--- a/core/modules/file/src/Plugin/views/field/FileMime.php
+++ b/core/modules/file/src/Plugin/views/field/FileMime.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 
 /**
@@ -24,7 +25,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['filemime_image'] = array(
       '#title' => t('Display an icon representing the file type, instead of the MIME text (such as "image/jpeg")'),
       '#type' => 'checkbox',
diff --git a/core/modules/file/src/Plugin/views/field/Uri.php b/core/modules/file/src/Plugin/views/field/Uri.php
index 04497b1..53a4725 100644
--- a/core/modules/file/src/Plugin/views/field/Uri.php
+++ b/core/modules/file/src/Plugin/views/field/Uri.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 
 /**
@@ -22,7 +23,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['file_download_path'] = array(
       '#title' => t('Display download path instead of file storage URI'),
       '#description' => t('This will provide the full download URL rather than the internal filestream address.'),
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..708d924 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..a4139e3 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..0494eb0 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..00a5c12 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..efef10e 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..05c3b2c 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..52dfac9 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..0eac79b 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..51427c3 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..f912864 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..da3d1c4 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..0747ff9 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/forum.module b/core/modules/forum/forum.module
index 23293fe..d8b3596 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\Xss;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
@@ -201,7 +202,7 @@ function forum_uri($forum) {
  * Checks in particular that the node is assigned only a "leaf" term in the
  * forum taxonomy.
  */
-function forum_node_validate(EntityInterface $node, $form, &$form_state) {
+function forum_node_validate(EntityInterface $node, $form, FormStateInterface &$form_state) {
   if (\Drupal::service('forum_manager')->checkNodeType($node)) {
     // vocabulary is selected, not a "container" term.
     if (!$node->taxonomy_forums->isEmpty()) {
@@ -387,7 +388,7 @@ function forum_comment_delete(CommentInterface $comment) {
 /**
  * Implements hook_form_BASE_FORM_ID_alter().
  */
-function forum_form_taxonomy_vocabulary_form_alter(&$form, &$form_state, $form_id) {
+function forum_form_taxonomy_vocabulary_form_alter(&$form, FormStateInterface &$form_state, $form_id) {
   $vid = \Drupal::config('forum.settings')->get('vocabulary');
   $vocabulary = $form_state['controller']->getEntity();
   if ($vid == $vocabulary->id()) {
@@ -409,7 +410,7 @@ function forum_form_taxonomy_vocabulary_form_alter(&$form, &$form_state, $form_i
 /**
  * Implements hook_form_FORM_ID_alter() for taxonomy_term_form().
  */
-function forum_form_taxonomy_term_form_alter(&$form, &$form_state, $form_id) {
+function forum_form_taxonomy_term_form_alter(&$form, FormStateInterface &$form_state, $form_id) {
   $vid = \Drupal::config('forum.settings')->get('vocabulary');
   if (isset($form['vid']['#value']) && $form['vid']['#value'] == $vid) {
     // Hide multiple parents select from forum terms.
@@ -420,7 +421,7 @@ function forum_form_taxonomy_term_form_alter(&$form, &$form_state, $form_id) {
 /**
  * Implements hook_form_BASE_FORM_ID_alter() for node_form().
  */
-function forum_form_node_form_alter(&$form, &$form_state, $form_id) {
+function forum_form_node_form_alter(&$form, FormStateInterface &$form_state, $form_id) {
   $node = $form_state['controller']->getEntity();
   if (isset($node->taxonomy_forums) && !$node->isNew()) {
     $forum_terms = $node->taxonomy_forums;
diff --git a/core/modules/forum/src/Form/ContainerForm.php b/core/modules/forum/src/Form/ContainerForm.php
index 1918bd0..3840c15 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..5d2b377 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..f759cbf 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..1ba8a24 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..64e3c89 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..eb7161c 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/history/src/Plugin/views/field/HistoryUserTimestamp.php b/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php
index ca9a276..c47594d 100644
--- a/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php
+++ b/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\history\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -54,7 +55,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     if (\Drupal::moduleHandler()->moduleExists('comment')) {
       $form['comments'] = array(
diff --git a/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php b/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php
index 0648fec..ffcf52d 100644
--- a/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php
+++ b/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\history\Plugin\views\filter;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\filter\FilterPluginBase;
 
 /**
@@ -31,7 +32,7 @@ public function usesGroupBy() {
     return FALSE;
   }
 
-  public function buildExposeForm(&$form, &$form_state) {
+  public function buildExposeForm(&$form, FormStateInterface &$form_state) {
     parent::buildExposeForm($form, $form_state);
     // @todo There are better ways of excluding required and multiple (object flags)
     unset($form['expose']['required']);
@@ -39,7 +40,7 @@ public function buildExposeForm(&$form, &$form_state) {
     unset($form['expose']['remember']);
   }
 
-  protected function valueForm(&$form, &$form_state) {
+  protected function valueForm(&$form, FormStateInterface &$form_state) {
     // Only present a checkbox for the exposed filter itself. There's no way
     // to tell the difference between not checked and the default value, so
     // specifying the default value via the views UI is meaningless.
diff --git a/core/modules/image/src/ConfigurableImageEffectBase.php b/core/modules/image/src/ConfigurableImageEffectBase.php
index ce42164..f36c568 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..8a13e74 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..4005515 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..2cb143c 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..f31c105 100644
--- a/core/modules/image/src/Form/ImageEffectFormBase.php
+++ b/core/modules/image/src/Form/ImageEffectFormBase.php
@@ -8,6 +8,8 @@
 namespace Drupal\image\Form;
 
 use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormState;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\image\ConfigurableImageEffectInterface;
 use Drupal\image\ImageStyleInterface;
 use Drupal\Component\Plugin\Exception\PluginNotFoundException;
@@ -53,7 +55,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,26 +103,26 @@ 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(
+    $effect_data = new FormState(array(
       'values' => &$form_state['values']['data']
-    );
+    ));
     $this->imageEffect->validateConfigurationForm($form, $effect_data);
   }
 
   /**
    * {@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,
     // pass that through for submission.
-    $effect_data = array(
+    $effect_data = new FormState(array(
       'values' => &$form_state['values']['data']
-    );
+    ));
     $this->imageEffect->submitConfigurationForm($form, $effect_data);
     $this->imageEffect->setWeight($form_state['values']['weight']);
     if (!$this->imageEffect->getUuid()) {
diff --git a/core/modules/image/src/Form/ImageStyleAddForm.php b/core/modules/image/src/Form/ImageStyleAddForm.php
index 64c2a37..36632df 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..5d937f4 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..c3ca46d 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();
@@ -155,7 +156,7 @@ public function form(array $form, array &$form_state) {
   /**
    * Validate handler for image effect.
    */
-  public function effectValidate($form, &$form_state) {
+  public function effectValidate($form, FormStateInterface &$form_state) {
     if (!$form_state['values']['new']) {
       $this->setFormError('new', $form_state, $this->t('Select an effect to add.'));
     }
@@ -164,7 +165,7 @@ public function effectValidate($form, &$form_state) {
   /**
    * Submit handler for image effect.
    */
-  public function effectSave($form, &$form_state) {
+  public function effectSave($form, FormStateInterface &$form_state) {
 
     // Update image effect weights.
     if (!empty($form_state['values']['effects'])) {
@@ -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..33e5d26 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..856309e 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..30f5020 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..b9f7ad9 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);
 
@@ -313,7 +314,7 @@ public function preSave() {
   /**
    * Element validate function for resolution fields.
    */
-  public static function validateResolution($element, &$form_state) {
+  public static function validateResolution($element, FormStateInterface &$form_state) {
     if (!empty($element['x']['#value']) || !empty($element['y']['#value'])) {
       foreach (array('x', 'y') as $dimension) {
         if (!$element[$dimension]['#value']) {
@@ -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, FormStateInterface &$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..e936cb5 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();
@@ -144,7 +145,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
    *
    * This method is assigned as a #process callback in formElement() method.
    */
-  public static function process($element, &$form_state, $form) {
+  public static function process($element, FormStateInterface &$form_state, $form) {
     $item = $element['#value'];
     $item['fids'] = $element['fids']['#value'];
 
@@ -227,7 +228,7 @@ public static function process($element, &$form_state, $form) {
    * This is separated in a validate function instead of a #required flag to
    * avoid being validated on the process callback.
    */
-  public static function validateRequiredFields($element, &$form_state) {
+  public static function validateRequiredFields($element, FormStateInterface &$form_state) {
     // Only do validation if the function is triggered from other places than
     // the image process form.
     if (!in_array('file_managed_file_submit', $form_state['triggering_element']['#submit'])) {
diff --git a/core/modules/image/src/Plugin/ImageEffect/CropImageEffect.php b/core/modules/image/src/Plugin/ImageEffect/CropImageEffect.php
index 42f6561..9cf7b12 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..a9bdc6a 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..3490ca9 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..917ac71 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/language.module b/core/modules/language/language.module
index 5ac331b..42dfed6 100644
--- a/core/modules/language/language.module
+++ b/core/modules/language/language.module
@@ -5,6 +5,7 @@
  * Add language handling functionality to Drupal.
  */
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\PhpStorage\PhpStorageFactory;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
@@ -214,7 +215,7 @@ function language_configuration_element_default_options() {
 /**
  * Process handler for the language_configuration form element.
  */
-function language_configuration_element_process($element, &$form_state, &$form) {
+function language_configuration_element_process($element, FormStateInterface &$form_state, &$form) {
   $options = isset($element['#options']) ? $element['#options'] : array();
   // Avoid validation failure since we are moving the '#options' key in the
   // nested 'language' select element.
@@ -265,7 +266,7 @@ function language_configuration_element_process($element, &$form_state, &$form)
 /**
  * Submit handler for the forms that have a language_configuration element.
  */
-function language_configuration_element_submit(&$form, &$form_state) {
+function language_configuration_element_submit(&$form, FormStateInterface &$form_state) {
   // Iterate through all the language_configuration elements and save their
   // values.
   if (isset($form_state['language'])) {
@@ -650,7 +651,7 @@ function language_set_browser_drupal_langcode_mappings($mappings) {
  *
  * @see language_system_regional_settings_form_submit()
  */
-function language_form_system_regional_settings_alter(&$form, &$form_state) {
+function language_form_system_regional_settings_alter(&$form, FormStateInterface &$form_state) {
   $languages = \Drupal::languageManager()->getLanguages();
   $default = \Drupal::languageManager()->getDefaultLanguage();
   foreach ($languages as $key => $language) {
@@ -673,7 +674,7 @@ function language_form_system_regional_settings_alter(&$form, &$form_state) {
  *
  * @see language_form_system_regional_settings_alter()
  */
-function language_system_regional_settings_form_submit($form, &$form_state) {
+function language_system_regional_settings_form_submit($form, FormStateInterface &$form_state) {
   $languages = \Drupal::languageManager()->getLanguages();
   $language = $languages[$form_state['values']['site_default_language']];
   $language->default = TRUE;
diff --git a/core/modules/language/src/Form/ContentLanguageSettingsForm.php b/core/modules/language/src/Form/ContentLanguageSettingsForm.php
index 4738a18..0799ff2 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..423a2ef 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, FormStateInterface &$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.
@@ -135,7 +136,7 @@ public function validateCustom(array $form, array &$form_state) {
   /**
    * Element specific validator for the Add language button.
    */
-  public function validatePredefined($form, &$form_state) {
+  public function validatePredefined($form, FormStateInterface &$form_state) {
     $langcode = $form_state['values']['predefined_langcode'];
     if ($langcode == 'custom') {
       $this->setFormError('predefined_langcode', $form_state, $this->t('Fill in the language details and save the language with <em>Add custom language</em>.'));
diff --git a/core/modules/language/src/Form/LanguageDeleteForm.php b/core/modules/language/src/Form/LanguageDeleteForm.php
index 1e1e2a0..5632a51 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..f1030a8 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..01fce3c 100644
--- a/core/modules/language/src/Form/LanguageFormBase.php
+++ b/core/modules/language/src/Form/LanguageFormBase.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityForm;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\language\ConfigurableLanguageManagerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -96,7 +97,7 @@ public function commonForm(array &$form) {
   /**
    * Validates the language editing element.
    */
-  public function validateCommon(array $form, array &$form_state) {
+  public function validateCommon(array $form, FormStateInterface &$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..0e42778 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..1988567 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..d1741bb 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..3dddccb 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..2f7cca6 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..e1c3d29 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..a9b229d 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..f193617 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/src/Plugin/views/field/LanguageField.php b/core/modules/language/src/Plugin/views/field/LanguageField.php
index 3909fcd..ed48d9b 100644
--- a/core/modules/language/src/Plugin/views/field/LanguageField.php
+++ b/core/modules/language/src/Plugin/views/field/LanguageField.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\language\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\ResultRow;
 
@@ -26,7 +27,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['native_language'] = array(
       '#title' => t('Native language'),
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..270fd16 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..753e45e 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..16df1c7 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..00a3fdd 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..b5666f8 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(
@@ -190,7 +191,7 @@ public function settingsSummary() {
    *
    * Conditionally requires the link title if a URL value was filled in.
    */
-  public function validateTitle(&$element, &$form_state, $form) {
+  public function validateTitle(&$element, FormStateInterface &$form_state, $form) {
     if ($element['url']['#value'] !== '' && $element['title']['#value'] === '') {
       $element['title']['#required'] = TRUE;
       \Drupal::formBuilder()->setError($element['title'], $form_state, $this->t('!name field is required.', array('!name' => $element['title']['#title'])));
@@ -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/locale.module b/core/modules/locale/locale.module
index a0efd9f..014835e 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -14,6 +14,7 @@
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Component\Utility\Xss;
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\StringTranslation\TranslationWrapper;
@@ -642,7 +643,7 @@ function locale_library_alter(array &$library, $name) {
 /**
  * Implements hook_form_FORM_ID_alter() for language_admin_overview_form().
  */
-function locale_form_language_admin_overview_form_alter(&$form, &$form_state) {
+function locale_form_language_admin_overview_form_alter(&$form, FormStateInterface &$form_state) {
   $languages = $form['languages']['#languages'];
 
   $total_strings = \Drupal::service('locale.storage')->countStrings();
@@ -695,7 +696,7 @@ function locale_form_language_admin_overview_form_alter(&$form, &$form_state) {
 /**
  * Implements hook_form_FORM_ID_alter() for language_admin_add_form(().
  */
-function locale_form_language_admin_add_form_alter(&$form, &$form_state) {
+function locale_form_language_admin_add_form_alter(&$form, FormStateInterface &$form_state) {
   $form['predefined_submit']['#submit'][] = 'locale_form_language_admin_add_form_alter_submit';
   $form['custom_language']['submit']['#submit'][] = 'locale_form_language_admin_add_form_alter_submit';
 }
@@ -731,7 +732,7 @@ function locale_form_language_admin_add_form_alter_submit($form, $form_state) {
 /**
  * Implements hook_form_FORM_ID_alter() for language_admin_edit_form().
  */
-function locale_form_language_admin_edit_form_alter(&$form, &$form_state) {
+function locale_form_language_admin_edit_form_alter(&$form, FormStateInterface &$form_state) {
   if ($form['langcode']['#type'] == 'value' && $form['langcode']['#value'] == 'en') {
     $form['locale_translate_english'] = array(
       '#title' => t('Enable interface translation to English'),
diff --git a/core/modules/locale/src/Form/ExportForm.php b/core/modules/locale/src/Form/ExportForm.php
index 70f611c..3d6d1ea 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..74a5164 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..2a8a509 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..9d8eb88 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..fb25981 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, FormStateInterface &$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..7e2cd48 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..5c2eea9 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..b6af48a 100644
--- a/core/modules/menu_ui/menu_ui.module
+++ b/core/modules/menu_ui/menu_ui.module
@@ -10,6 +10,7 @@
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\block\BlockPluginInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\node\NodeTypeInterface;
@@ -377,7 +378,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, FormStateInterface &$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..7069ee1 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..4323af4 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..673b544 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..026ffd5 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, FormStateInterface &$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, FormStateInterface &$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, FormStateInterface &$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..2f16a48 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.api.php b/core/modules/node/node.api.php
index dd47b47..dee34f2 100644
--- a/core/modules/node/node.api.php
+++ b/core/modules/node/node.api.php
@@ -424,7 +424,7 @@ function hook_node_update_index(\Drupal\node\NodeInterface $node, $langcode) {
  *
  * @ingroup entity_crud
  */
-function hook_node_validate(\Drupal\node\NodeInterface $node, $form, &$form_state) {
+function hook_node_validate(\Drupal\node\NodeInterface $node, $form, \Drupal\Core\Form\FormStateInterface &$form_state) {
   if (isset($node->end) && isset($node->start)) {
     if ($node->start > $node->end) {
       form_set_error('time', $form_state, t('An event may not end before it starts.'));
@@ -451,7 +451,7 @@ function hook_node_validate(\Drupal\node\NodeInterface $node, $form, &$form_stat
  *
  * @ingroup entity_crud
  */
-function hook_node_submit(\Drupal\node\NodeInterface $node, $form, &$form_state) {
+function hook_node_submit(\Drupal\node\NodeInterface $node, $form, \Drupal\Core\Form\FormStateInterface &$form_state) {
   // Decompose the selected menu parent option into 'menu_name' and 'plid', if
   // the form used the default parent selection widget.
   if (!empty($form_state['values']['menu']['parent'])) {
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index f23559e..22b6f7e 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -9,6 +9,7 @@
  */
 
 use Drupal\Component\Utility\Xss;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Routing\RouteMatchInterface;
@@ -1053,7 +1054,7 @@ function node_view_multiple($nodes, $view_mode = 'teaser', $langcode = NULL) {
  * @see taxonomy_term_page()
  * @see node_form_system_site_information_settings_form_submit()
  */
-function node_form_system_site_information_settings_form_alter(&$form, &$form_state, $form_id) {
+function node_form_system_site_information_settings_form_alter(&$form, FormStateInterface &$form_state, $form_id) {
   $options = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30);
   $form['front_page']['default_nodes_main'] = array(
     '#type' => 'select',
@@ -1071,7 +1072,7 @@ function node_form_system_site_information_settings_form_alter(&$form, &$form_st
  *
  * @see node_form_system_site_information_settings_form_alter()
  */
-function node_form_system_site_information_settings_form_submit($form, &$form_state) {
+function node_form_system_site_information_settings_form_submit($form, FormStateInterface &$form_state) {
   \Drupal::config('node.settings')
     ->set('items_per_page', $form_state['values']['default_nodes_main'])
     ->save();
@@ -1084,7 +1085,7 @@ function node_form_system_site_information_settings_form_submit($form, &$form_st
  *
  * @see node_form_system_themes_admin_form_submit()
  */
-function node_form_system_themes_admin_form_alter(&$form, &$form_state, $form_id) {
+function node_form_system_themes_admin_form_alter(&$form, FormStateInterface &$form_state, $form_id) {
   $form['admin_theme']['use_admin_theme'] = array(
     '#type' => 'checkbox',
     '#title' => t('Use the administration theme when editing or creating content'),
@@ -1098,7 +1099,7 @@ function node_form_system_themes_admin_form_alter(&$form, &$form_state, $form_id
  *
  * @see node_form_system_themes_admin_form_alter()
  */
-function node_form_system_themes_admin_form_submit($form, &$form_state) {
+function node_form_system_themes_admin_form_submit($form, FormStateInterface &$form_state) {
   \Drupal::config('node.settings')
     ->set('use_admin_theme', $form_state['values']['use_admin_theme'])
     ->save();
diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc
index 9757596..a95a255 100644
--- a/core/modules/node/node.pages.inc
+++ b/core/modules/node/node.pages.inc
@@ -10,6 +10,7 @@
  */
 
 use Drupal\Component\Utility\Xss;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 use Drupal\node\NodeInterface;
 
@@ -48,7 +49,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, FormStateInterface &$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..a044643 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..c1e44cb 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..7723208 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..c56835a 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..b825774 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..2356775 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..2730f29 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, FormStateInterface &$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, FormStateInterface &$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, FormStateInterface &$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..9ee0a06 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, FormStateInterface &$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..716c105 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..bd6ced6 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..cbc88ec 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..ff6c909 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..7f98412 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..ec53c30 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/field/Language.php b/core/modules/node/src/Plugin/views/field/Language.php
index af705cb..b3c79d2 100644
--- a/core/modules/node/src/Plugin/views/field/Language.php
+++ b/core/modules/node/src/Plugin/views/field/Language.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\node\Plugin\views\field\Node;
 use Drupal\views\ResultRow;
 
@@ -26,7 +27,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['native_language'] = array(
       '#title' => t('Native language'),
diff --git a/core/modules/node/src/Plugin/views/field/Link.php b/core/modules/node/src/Plugin/views/field/Link.php
index d2a89a4..5b9cd7e 100644
--- a/core/modules/node/src/Plugin/views/field/Link.php
+++ b/core/modules/node/src/Plugin/views/field/Link.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\ResultRow;
 
@@ -32,7 +33,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['text'] = array(
       '#type' => 'textfield',
       '#title' => t('Text to display'),
diff --git a/core/modules/node/src/Plugin/views/field/Node.php b/core/modules/node/src/Plugin/views/field/Node.php
index b85cd02..345df01 100644
--- a/core/modules/node/src/Plugin/views/field/Node.php
+++ b/core/modules/node/src/Plugin/views/field/Node.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -44,7 +45,7 @@ protected function defineOptions() {
   /**
    * Provide link to node option
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['link_to_node'] = array(
       '#title' => t('Link this field to the original piece of content'),
       '#description' => t("Enable to override this field's links."),
diff --git a/core/modules/node/src/Plugin/views/field/Path.php b/core/modules/node/src/Plugin/views/field/Path.php
index a08b7cd..af41266 100644
--- a/core/modules/node/src/Plugin/views/field/Path.php
+++ b/core/modules/node/src/Plugin/views/field/Path.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ResultRow;
@@ -37,7 +38,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['absolute'] = array(
       '#type' => 'checkbox',
diff --git a/core/modules/node/src/Plugin/views/field/Revision.php b/core/modules/node/src/Plugin/views/field/Revision.php
index db18760..9f57537 100644
--- a/core/modules/node/src/Plugin/views/field/Revision.php
+++ b/core/modules/node/src/Plugin/views/field/Revision.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -41,7 +42,7 @@ protected function defineOptions() {
   /**
    * Provide link to revision option.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['link_to_node_revision'] = array(
       '#title' => t('Link this field to its content revision'),
       '#description' => t('This will override any other link you have set.'),
diff --git a/core/modules/node/src/Plugin/views/field/Type.php b/core/modules/node/src/Plugin/views/field/Type.php
index 9e1be57..8978544 100644
--- a/core/modules/node/src/Plugin/views/field/Type.php
+++ b/core/modules/node/src/Plugin/views/field/Type.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\node\Plugin\views\field\Node;
 use Drupal\views\ResultRow;
 
@@ -29,7 +30,7 @@ protected function defineOptions() {
   /**
    * Provide machine_name option for to node type display.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['machine_name'] = array(
diff --git a/core/modules/node/src/Plugin/views/filter/Access.php b/core/modules/node/src/Plugin/views/filter/Access.php
index 524426f..b973b2e 100644
--- a/core/modules/node/src/Plugin/views/filter/Access.php
+++ b/core/modules/node/src/Plugin/views/filter/Access.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Plugin\views\filter;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\filter\FilterPluginBase;
 
 /**
@@ -19,7 +20,7 @@
 class Access extends FilterPluginBase {
 
   public function adminSummary() { }
-  protected function operatorForm(&$form, &$form_state) { }
+  protected function operatorForm(&$form, FormStateInterface &$form_state) { }
   public function canExpose() {
     return FALSE;
   }
diff --git a/core/modules/node/src/Plugin/views/filter/Status.php b/core/modules/node/src/Plugin/views/filter/Status.php
index 08e63d9..7fcd740 100644
--- a/core/modules/node/src/Plugin/views/filter/Status.php
+++ b/core/modules/node/src/Plugin/views/filter/Status.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Plugin\views\filter;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\filter\FilterPluginBase;
 
 /**
@@ -20,7 +21,7 @@ class Status extends FilterPluginBase {
 
   public function adminSummary() { }
 
-  protected function operatorForm(&$form, &$form_state) { }
+  protected function operatorForm(&$form, FormStateInterface &$form_state) { }
 
   public function canExpose() { return FALSE; }
 
diff --git a/core/modules/node/src/Plugin/views/row/NodeRow.php b/core/modules/node/src/Plugin/views/row/NodeRow.php
index de71343..683bfbb 100644
--- a/core/modules/node/src/Plugin/views/row/NodeRow.php
+++ b/core/modules/node/src/Plugin/views/row/NodeRow.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Plugin\views\row;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\row\EntityRow;
 
 /**
@@ -38,7 +39,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['links'] = array(
diff --git a/core/modules/node/src/Plugin/views/row/Rss.php b/core/modules/node/src/Plugin/views/row/Rss.php
index a8f9d50..6fe6f85 100644
--- a/core/modules/node/src/Plugin/views/row/Rss.php
+++ b/core/modules/node/src/Plugin/views/row/Rss.php
@@ -8,6 +8,7 @@
 namespace Drupal\node\Plugin\views\row;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\row\RowPluginBase;
 
 /**
@@ -43,7 +44,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['view_mode'] = array(
diff --git a/core/modules/node/src/Plugin/views/wizard/Node.php b/core/modules/node/src/Plugin/views/wizard/Node.php
index fc5aadb..919ace7 100644
--- a/core/modules/node/src/Plugin/views/wizard/Node.php
+++ b/core/modules/node/src/Plugin/views/wizard/Node.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Plugin\views\wizard;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\wizard\WizardPluginBase;
 
 /**
@@ -86,12 +87,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, FormStateInterface &$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 +157,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, FormStateInterface &$form_state) {
     $filters = parent::defaultDisplayFiltersUser($form, $form_state);
 
     if (!empty($form_state['values']['show']['tagged_with']['tids'])) {
@@ -183,7 +184,7 @@ protected function defaultDisplayFiltersUser(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function pageDisplayOptions(array $form, array &$form_state) {
+  protected function pageDisplayOptions(array $form, FormStateInterface &$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 +195,7 @@ protected function pageDisplayOptions(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function blockDisplayOptions(array $form, array &$form_state) {
+  protected function blockDisplayOptions(array $form, FormStateInterface &$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();
@@ -233,7 +234,7 @@ protected  function display_options_row(&$display_options, $row_plugin, $row_opt
    *
    * Add some options for filter by taxonomy terms.
    */
-  protected function buildFilters(&$form, &$form_state) {
+  protected function buildFilters(&$form, FormStateInterface &$form_state) {
     parent::buildFilters($form, $form_state);
 
     $selected_bundle = static::getSelected($form_state, array('show', 'type'), 'all', $form['displays']['show']['type']);
diff --git a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php
index d61aef1..e4dd508 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');
 
@@ -121,7 +122,7 @@ public function settingsForm(array &$form, array &$form_state, $has_data) {
    *
    * @see form_process_pattern()
    */
-  public static function validateAllowedValues($element, &$form_state) {
+  public static function validateAllowedValues($element, FormStateInterface &$form_state) {
     $values = static::extractAllowedValues($element['#value'], $element['#field_has_data']);
 
     if (!is_array($values)) {
diff --git a/core/modules/options/src/Plugin/Field/FieldWidget/ButtonsWidget.php b/core/modules/options/src/Plugin/Field/FieldWidget/ButtonsWidget.php
index fa56329..63aee21 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;
 
 /**
  * Plugin implementation of the 'options_buttons' widget.
@@ -29,7 +30,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/OptionsWidgetBase.php b/core/modules/options/src/Plugin/Field/FieldWidget/OptionsWidgetBase.php
index 01e7688..fde0334 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, FormStateInterface &$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..f3fb8ab 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..573bcd0 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..e78aa40 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, FormStateInterface &$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..1458fd1 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, FormStateInterface &$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..724872c 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..0b3380d 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, FormStateInterface &$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..ae15e4b 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(FormStateInterface &$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, FormStateInterface &$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, FormStateInterface &$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..14d8bab 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..51f2ada 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..94f37f0 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/rest/src/Plugin/views/row/DataFieldRow.php b/core/modules/rest/src/Plugin/views/row/DataFieldRow.php
index b3896a1..e2f7753 100644
--- a/core/modules/rest/src/Plugin/views/row/DataFieldRow.php
+++ b/core/modules/rest/src/Plugin/views/row/DataFieldRow.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\rest\Plugin\views\row;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\row\RowPluginBase;
@@ -74,7 +75,7 @@ protected function defineOptions() {
   /**
    * Overrides \Drupal\views\Plugin\views\row\RowPluginBase::buildOptionsForm().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['field_options'] = array(
@@ -111,7 +112,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * Form element validation handler for \Drupal\rest\Plugin\views\row\DataFieldRow::buildOptionsForm().
    */
-  public function validateAliasName($element, &$form_state) {
+  public function validateAliasName($element, FormStateInterface &$form_state) {
     if (preg_match('@[^A-Za-z0-9_-]+@', $element['#value'])) {
       form_error($element, $form_state, t('The machine-readable name must contain only letters, numbers, dashes and underscores.'));
     }
@@ -120,7 +121,7 @@ public function validateAliasName($element, &$form_state) {
   /**
    * Overrides \Drupal\views\Plugin\views\row\RowPluginBase::validateOptionsForm().
    */
-  public function validateOptionsForm(&$form, &$form_state) {
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) {
     // Collect an array of aliases to validate.
     $aliases = static::extractFromOptionsArray('alias', $form_state['values']['row_options']['field_options']);
 
diff --git a/core/modules/rest/src/Plugin/views/style/Serializer.php b/core/modules/rest/src/Plugin/views/style/Serializer.php
index 1403dc3..1d85a24 100644
--- a/core/modules/rest/src/Plugin/views/style/Serializer.php
+++ b/core/modules/rest/src/Plugin/views/style/Serializer.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\rest\Plugin\views\style;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\style\StylePluginBase;
@@ -88,7 +89,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['formats'] = array(
@@ -103,7 +104,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::submitOptionsForm($form, $form_state);
 
     $form_state['values']['style_options']['formats'] = array_filter($form_state['values']['style_options']['formats']);
diff --git a/core/modules/search/search.module b/core/modules/search/search.module
index 6c041d0..24b5bb5 100644
--- a/core/modules/search/search.module
+++ b/core/modules/search/search.module
@@ -7,6 +7,7 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
@@ -825,7 +826,7 @@ function search_module_preinstall() {
  *
  * @see \Drupal\search\Form\SearchBlockForm
  */
-function search_form_search_block_form_alter(&$form, &$form_state) {
+function search_form_search_block_form_alter(&$form, FormStateInterface &$form_state) {
   $form['form_build_id']['#access'] = FALSE;
   $form['form_token']['#access'] = FALSE;
   $form['form_id']['#access'] = FALSE;
diff --git a/core/modules/search/src/Form/ReindexConfirm.php b/core/modules/search/src/Form/ReindexConfirm.php
index 33d3b89..544085a 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..1fc8dd5 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..ee24bf1 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..40d48b1 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..501fb67 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..6538d57 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..5c80387 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..cde0e28 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..e988137 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..1e2f2b5 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/Plugin/views/filter/Search.php b/core/modules/search/src/Plugin/views/filter/Search.php
index ef69c7d..90f59cd 100644
--- a/core/modules/search/src/Plugin/views/filter/Search.php
+++ b/core/modules/search/src/Plugin/views/filter/Search.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\search\Plugin\views\filter;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\filter\FilterPluginBase;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ViewExecutable;
@@ -70,7 +71,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  protected function operatorForm(&$form, &$form_state) {
+  protected function operatorForm(&$form, FormStateInterface &$form_state) {
     $form['operator'] = array(
       '#type' => 'radios',
       '#title' => t('On empty input'),
@@ -85,7 +86,7 @@ protected function operatorForm(&$form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  protected function valueForm(&$form, &$form_state) {
+  protected function valueForm(&$form, FormStateInterface &$form_state) {
     $form['value'] = array(
       '#type' => 'textfield',
       '#size' => 15,
@@ -98,7 +99,7 @@ protected function valueForm(&$form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateExposed(&$form, &$form_state) {
+  public function validateExposed(&$form, FormStateInterface &$form_state) {
     if (!isset($this->options['expose']['identifier'])) {
       return;
     }
diff --git a/core/modules/search/src/Plugin/views/row/SearchRow.php b/core/modules/search/src/Plugin/views/row/SearchRow.php
index 8c0709f..580e917 100644
--- a/core/modules/search/src/Plugin/views/row/SearchRow.php
+++ b/core/modules/search/src/Plugin/views/row/SearchRow.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\search\Plugin\views\row;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\row\RowPluginBase;
 
 /**
@@ -34,7 +35,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['score'] = array(
       '#type' => 'checkbox',
       '#title' => t('Display score'),
diff --git a/core/modules/search/src/SearchPageListBuilder.php b/core/modules/search/src/SearchPageListBuilder.php
index 701a605..af36885 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, FormStateInterface &$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, FormStateInterface &$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, FormStateInterface &$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..f329fc6 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..6e26353 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..9d0fd62 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..283a768 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..bbd1aa4 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..78edeed 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..0b5418a 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..799b64b 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..94c5a8e 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..2c41280 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..c69e95f 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..02a4f47 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..4c5e013 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/syslog/syslog.module b/core/modules/syslog/syslog.module
index 4165fab..e5e9c95 100644
--- a/core/modules/syslog/syslog.module
+++ b/core/modules/syslog/syslog.module
@@ -5,6 +5,7 @@
  * Redirects logging messages to syslog.
  */
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
@@ -30,7 +31,7 @@ function syslog_help($route_name, RouteMatchInterface $route_match) {
 /**
  * Implements hook_form_FORM_ID_alter().
  */
-function syslog_form_system_logging_settings_alter(&$form, &$form_state) {
+function syslog_form_system_logging_settings_alter(&$form, FormStateInterface &$form_state) {
   $config = \Drupal::config('syslog.settings');
   $help = \Drupal::moduleHandler()->moduleExists('help') ? ' ' . l(t('More information'), 'admin/help/syslog') . '.' : NULL;
   $form['syslog_identity'] = array(
@@ -63,7 +64,7 @@ function syslog_form_system_logging_settings_alter(&$form, &$form_state) {
  *
  * @see syslog_form_system_logging_settings_alter()
  */
-function syslog_logging_settings_submit($form, &$form_state) {
+function syslog_logging_settings_submit($form, FormStateInterface &$form_state) {
   \Drupal::config('syslog.settings')
     ->set('identity', $form_state['values']['syslog_identity'])
     ->set('facility', $form_state['values']['syslog_facility'])
diff --git a/core/modules/system/entity.api.php b/core/modules/system/entity.api.php
index 5388dab..7684cc7 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, \Drupal\Core\Form\FormStateInterface &$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, \Drupal\Core\Form\FormStateInterface &$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..d8caa76 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, FormStateInterface &$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..00bddc2 100644
--- a/core/modules/system/src/Form/DateFormatAddForm.php
+++ b/core/modules/system/src/Form/DateFormatAddForm.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\system\Form;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Provides a form for adding a date format.
  */
@@ -15,7 +17,7 @@ class DateFormatAddForm extends DateFormatFormBase {
   /**
    * {@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('Add format');
     return $actions;
@@ -24,7 +26,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) {
     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..555b9a4 100644
--- a/core/modules/system/src/Form/DateFormatDeleteForm.php
+++ b/core/modules/system/src/Form/DateFormatDeleteForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Datetime\Date;
 use Drupal\Core\Entity\EntityConfirmFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -70,7 +71,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(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..14fb18b 100644
--- a/core/modules/system/src/Form/DateFormatEditForm.php
+++ b/core/modules/system/src/Form/DateFormatEditForm.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\system\Form;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Provides a form for editing a date format.
  */
@@ -15,7 +17,7 @@ class DateFormatEditForm extends DateFormatFormBase {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, array &$form_state) {
+  public function form(array $form, FormStateInterface &$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 +30,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 format');
     unset($actions['delete']);
@@ -38,7 +40,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) {
     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..96e6171 100644
--- a/core/modules/system/src/Form/DateFormatFormBase.php
+++ b/core/modules/system/src/Form/DateFormatFormBase.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Ajax\ReplaceCommand;
 use Drupal\Core\Config\Entity\ConfigEntityStorageInterface;
 use Drupal\Core\Datetime\Date;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Datetime\DrupalDateTime;
@@ -67,13 +68,11 @@ public static function create(ContainerInterface $container) {
    *   The entity ID.
    * @param array $element
    *   The form element.
-   * @param array $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) {
     return (bool) $this->dateFormatStorage
       ->getQuery()
       ->condition('id', $element['#field_prefix'] . $entity_id)
@@ -85,13 +84,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, FormStateInterface $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 +106,7 @@ public static function dateTimeLookup(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' => 'Name',
@@ -156,7 +155,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);
 
     // The machine name field should already check to see if the requested
@@ -174,7 +173,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) {
     $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..15a9724 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..5443789 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..6d4626f 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..e70ad2b 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..609004b 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..f39fdb8 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..8535cf7 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..7c00387 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, FormStateInterface &$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..b6ccd5e 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..db41924 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..49a722f 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..c6b636f 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..00f7aa4 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..b1df67d 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..e049108 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..00a7d5e 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..d6e6a28 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..86e0731 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..4b527e2 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..71e43ee 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..42511a1 100644
--- a/core/modules/system/src/Plugin/views/field/BulkForm.php
+++ b/core/modules/system/src/Plugin/views/field/BulkForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Plugin\views\field;
 
 use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\Plugin\views\style\Table;
@@ -92,7 +93,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['action_title'] = array(
       '#type' => 'textfield',
       '#title' => t('Action title'),
@@ -122,7 +123,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateOptionsForm(&$form, &$form_state) {
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::validateOptionsForm($form, $form_state);
 
     $form_state['values']['options']['selected_actions'] = array_filter($form_state['values']['options']['selected_actions']);
@@ -157,10 +158,10 @@ 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) {
+  public function viewsForm(&$form, FormStateInterface &$form_state) {
     // Add the tableselect javascript.
     $form['#attached']['library'][] = 'core/drupal.tableselect';
 
@@ -245,10 +246,10 @@ 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) {
+  public function viewsFormSubmit(&$form, FormStateInterface &$form_state) {
     if ($form_state['step'] == 'views_form_views_form') {
       // Filter only selected checkboxes.
       $selected = array_filter($form_state['values'][$this->options['id']]);
@@ -289,7 +290,7 @@ protected function emptySelectedMessage() {
   /**
    * {@inheritdoc}
    */
-  public function viewsFormValidate(&$form, &$form_state) {
+  public function viewsFormValidate(&$form, FormStateInterface &$form_state) {
     $selected = array_filter($form_state['values'][$this->options['id']]);
     if (empty($selected)) {
       form_set_error('', $form_state, $this->emptySelectedMessage());
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..2e5f4e0 100644
--- a/core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php
+++ b/core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php
@@ -8,6 +8,8 @@
 namespace Drupal\system\Tests\Form;
 
 use Drupal\Core\Form\FormInterface;
+use Drupal\Core\Form\FormState;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\simpletest\KernelTestBase;
 
 /**
@@ -34,7 +36,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 +46,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__;
   }
 
@@ -73,7 +75,7 @@ public function submitForm(array &$form, array &$form_state) {
    * Tests that default handlers are added even if custom are specified.
    */
   function testDefaultAndCustomHandlers() {
-    $form_state['values'] = array();
+    $form_state = new FormState(array('values' => array()));
     $form_builder = $this->container->get('form_builder');
     $form_builder->submitForm($this, $form_state);
 
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..cac6579 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..f985a19 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/system.api.php b/core/modules/system/system.api.php
index 8ff4b54..43e70db 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -703,7 +703,7 @@ function hook_page_alter(&$page) {
  * @see hook_form_FORM_ID_alter()
  * @see forms_api_reference.html
  */
-function hook_form_alter(&$form, &$form_state, $form_id) {
+function hook_form_alter(&$form, \Drupal\Core\Form\FormStateInterface &$form_state, $form_id) {
   if (isset($form['type']) && $form['type']['#value'] . '_node_settings' == $form_id) {
     $upload_enabled_types = \Drupal::config('mymodule.settings')->get('upload_enabled_types');
     $form['workflow']['upload_' . $form['type']['#value']] = array(
@@ -743,7 +743,7 @@ function hook_form_alter(&$form, &$form_state, $form_id) {
  * @see \Drupal\Core\Form\FormBuilderInterface::prepareForm()
  * @see forms_api_reference.html
  */
-function hook_form_FORM_ID_alter(&$form, &$form_state, $form_id) {
+function hook_form_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface &$form_state, $form_id) {
   // Modification for the form with the given form ID goes here. For example, if
   // FORM_ID is "user_register_form" this code would run only on the user
   // registration form.
@@ -788,7 +788,7 @@ function hook_form_FORM_ID_alter(&$form, &$form_state, $form_id) {
  * @see hook_form_FORM_ID_alter()
  * @see \Drupal\Core\Form\FormBuilderInterface::prepareForm()
  */
-function hook_form_BASE_FORM_ID_alter(&$form, &$form_state, $form_id) {
+function hook_form_BASE_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface &$form_state, $form_id) {
   // Modification for the form with the given BASE_FORM_ID goes here. For
   // example, if BASE_FORM_ID is "node_form", this code would run on every
   // node form, regardless of node type.
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 117dc49..c95f0d6 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -8,6 +8,7 @@
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Extension\Extension;
 use Drupal\Core\Extension\ExtensionDiscovery;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\StringTranslation\TranslationWrapper;
 use Drupal\Core\Language\LanguageInterface;
@@ -990,7 +991,7 @@ function system_page_build(&$page) {
 /**
  * Implements hook_form_FORM_ID_alter().
  */
-function system_form_user_form_alter(&$form, &$form_state) {
+function system_form_user_form_alter(&$form, FormStateInterface &$form_state) {
   if (\Drupal::config('system.date')->get('timezone.user.configurable')) {
     system_user_timezone($form, $form_state);
   }
@@ -999,7 +1000,7 @@ function system_form_user_form_alter(&$form, &$form_state) {
 /**
  * Implements hook_form_FORM_ID_alter().
  */
-function system_form_user_register_form_alter(&$form, &$form_state) {
+function system_form_user_register_form_alter(&$form, FormStateInterface &$form_state) {
   $config = \Drupal::config('system.date');
   if ($config->get('timezone.user.configurable') && $config->get('timezone.user.default') == DRUPAL_USER_TIMEZONE_SELECT) {
     system_user_timezone($form, $form_state);
@@ -1030,7 +1031,7 @@ function system_user_login($account) {
 /**
  * Add the time zone field to the user edit and register forms.
  */
-function system_user_timezone(&$form, &$form_state) {
+function system_user_timezone(&$form, FormStateInterface &$form_state) {
   $user = \Drupal::currentUser();
 
   $account = $form_state['controller']->getEntity();
diff --git a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module
index 3a605c5..2f45911 100644
--- a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module
+++ b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module
@@ -7,6 +7,7 @@
 
 use Drupal\Core\Ajax;
 use Drupal\Core\Ajax\AjaxResponse;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Ajax form callback: Selects 'after'.
@@ -206,6 +207,6 @@ function ajax_forms_test_validation_number_form_callback($form, $form_state) {
 /**
  * AJAX form callback: Selects for the ajax_forms_test_lazy_load_form() form.
  */
-function ajax_forms_test_lazy_load_form_ajax($form, &$form_state) {
+function ajax_forms_test_lazy_load_form_ajax($form, FormStateInterface &$form_state) {
   return array('#markup' => 'new content');
 }
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..c67f97b 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..59e3291 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..7df4e55 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..caa450b 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..496c44d 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';
   }
 
@@ -74,14 +75,14 @@ public function submitForm(array &$form, array &$form_state) {
   /**
    * AJAX callback handler for AjaxTestDialogForm.
    */
-  public function modal(&$form, &$form_state) {
+  public function modal(&$form, FormStateInterface &$form_state) {
     return $this->dialog(TRUE);
   }
 
   /**
    * AJAX callback handler for AjaxTestDialogForm.
    */
-  public function nonModal(&$form, &$form_state) {
+  public function nonModal(&$form, FormStateInterface &$form_state) {
     return $this->dialog(FALSE);
   }
 
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..1065f34 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..b4b5240 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,13 +50,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) {
   }
 
   /**
    * Form submission handler #1 for batch_test_chained_form
    */
-  public static function batchTestChainedFormSubmit1($form, &$form_state) {
+  public static function batchTestChainedFormSubmit1($form, FormStateInterface &$form_state) {
     batch_test_stack(NULL, TRUE);
 
     batch_test_stack('submit handler 1');
@@ -70,7 +71,7 @@ public static function batchTestChainedFormSubmit1($form, &$form_state) {
   /**
    * Form submission handler #2 for batch_test_chained_form
    */
-  public static function batchTestChainedFormSubmit2($form, &$form_state) {
+  public static function batchTestChainedFormSubmit2($form, FormStateInterface &$form_state) {
     batch_test_stack('submit handler 2');
     batch_test_stack('value = ' . $form_state['values']['value']);
 
@@ -83,7 +84,7 @@ public static function batchTestChainedFormSubmit2($form, &$form_state) {
   /**
    * Form submission handler #3 for batch_test_chained_form
    */
-  public static function batchTestChainedFormSubmit3($form, &$form_state) {
+  public static function batchTestChainedFormSubmit3($form, FormStateInterface &$form_state) {
     batch_test_stack('submit handler 3');
     batch_test_stack('value = ' . $form_state['values']['value']);
 
@@ -95,7 +96,7 @@ public static function batchTestChainedFormSubmit3($form, &$form_state) {
   /**
    * Form submission handler #4 for batch_test_chained_form
    */
-  public static function batchTestChainedFormSubmit4($form, &$form_state) {
+  public static function batchTestChainedFormSubmit4($form, FormStateInterface &$form_state) {
     batch_test_stack('submit handler 4');
     batch_test_stack('value = ' . $form_state['values']['value']);
 
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..c68b7ea 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..10cfb2b 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..31effbb 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..5c54903 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..4eb4bb5 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/entity_test.module b/core/modules/system/tests/modules/entity_test/entity_test.module
index 864e302..6881baa 100644
--- a/core/modules/system/tests/modules/entity_test/entity_test.module
+++ b/core/modules/system/tests/modules/entity_test/entity_test.module
@@ -10,6 +10,7 @@
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\entity\Entity\EntityFormDisplay;
 
@@ -242,7 +243,7 @@ function entity_test_permission() {
 /**
  * Implements hook_form_BASE_FORM_ID_alter().
  */
-function entity_test_form_node_form_alter(&$form, &$form_state, $form_id) {
+function entity_test_form_node_form_alter(&$form, FormStateInterface &$form_state, $form_id) {
   $langcode = $form_state['controller']->getFormLangcode($form_state);
   \Drupal::state()->set('entity_test.form_langcode', $langcode);
 }
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..dfdbf48 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..617db12 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/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module
index 08fdb2e..70e573a 100644
--- a/core/modules/system/tests/modules/form_test/form_test.module
+++ b/core/modules/system/tests/modules/form_test/form_test.module
@@ -5,6 +5,8 @@
  * Helper module for the form API tests.
  */
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Implements hook_permission().
  */
@@ -23,14 +25,14 @@ function form_test_permission() {
 /**
  * Implements hook_form_FORM_ID_alter() on behalf of block.module.
  */
-function block_form_form_test_alter_form_alter(&$form, &$form_state) {
+function block_form_form_test_alter_form_alter(&$form, FormStateInterface &$form_state) {
   drupal_set_message('block_form_form_test_alter_form_alter() executed.');
 }
 
 /**
  * Implements hook_form_alter().
  */
-function form_test_form_alter(&$form, &$form_state, $form_id) {
+function form_test_form_alter(&$form, FormStateInterface &$form_state, $form_id) {
   if ($form_id == 'form_test_alter_form') {
     drupal_set_message('form_test_form_alter() executed.');
   }
@@ -39,14 +41,14 @@ function form_test_form_alter(&$form, &$form_state, $form_id) {
 /**
  * Implements hook_form_FORM_ID_alter().
  */
-function form_test_form_form_test_alter_form_alter(&$form, &$form_state) {
+function form_test_form_form_test_alter_form_alter(&$form, FormStateInterface &$form_state) {
   drupal_set_message('form_test_form_form_test_alter_form_alter() executed.');
 }
 
 /**
  * Implements hook_form_FORM_ID_alter() on behalf of system.module.
  */
-function system_form_form_test_alter_form_alter(&$form, &$form_state) {
+function system_form_form_test_alter_form_alter(&$form, FormStateInterface &$form_state) {
   drupal_set_message('system_form_form_test_alter_form_alter() executed.');
 }
 
@@ -93,7 +95,7 @@ function _form_test_tableselect_get_data() {
  *
  * @see form_test_state_persist()
  */
-function form_test_form_form_test_state_persist_alter(&$form, &$form_state) {
+function form_test_form_form_test_state_persist_alter(&$form, FormStateInterface &$form_state) {
   // Simulate a form alter implementation inserting form elements that enable
   // caching of the form, e.g. elements having #ajax.
   if (\Drupal::request()->get('cache')) {
@@ -104,7 +106,7 @@ function form_test_form_form_test_state_persist_alter(&$form, &$form_state) {
 /**
  * Implements hook_form_FORM_ID_alter() for the registration form.
  */
-function form_test_form_user_register_form_alter(&$form, &$form_state) {
+function form_test_form_user_register_form_alter(&$form, FormStateInterface &$form_state) {
   $form['test_rebuild'] = array(
     '#type' => 'submit',
     '#value' => t('Rebuild'),
@@ -115,7 +117,7 @@ function form_test_form_user_register_form_alter(&$form, &$form_state) {
 /**
  * Submit callback that just lets the form rebuild.
  */
-function form_test_user_register_form_rebuild($form, &$form_state) {
+function form_test_user_register_form_rebuild($form, FormStateInterface &$form_state) {
   drupal_set_message('Form rebuilt.');
   $form_state['rebuild'] = TRUE;
 }
diff --git a/core/modules/system/tests/modules/form_test/src/Callbacks.php b/core/modules/system/tests/modules/form_test/src/Callbacks.php
index 08d970d..d621c7e 100644
--- a/core/modules/system/tests/modules/form_test/src/Callbacks.php
+++ b/core/modules/system/tests/modules/form_test/src/Callbacks.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\form_test;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Simple class for testing methods as Form API callbacks.
  */
@@ -15,7 +17,7 @@ class Callbacks {
   /**
    * Form element validation handler for 'name' in form_test_validate_form().
    */
-  public function validateName(&$element, &$form_state) {
+  public function validateName(&$element, FormStateInterface &$form_state) {
     $triggered = FALSE;
     if ($form_state['values']['name'] == 'element_validate') {
       // Alter the form element.
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..62eb8ce 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..f329f45 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..17085aa 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..aa05897 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..80f1bb7 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..bc127ec 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..d7928dc 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..e823089 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..4ac16cf 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..cdc0a20 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..fc755b9 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..b57d05b 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..f5ce073 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..b0a1b24 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..dd86486 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..717f5d3 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..3230ceb 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..94c13db 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..b9bcc09 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..719ac2f 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..f8bc6f0 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..3a93052 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..9f2b0b9 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',
@@ -87,7 +88,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function elementValidateLimitValidationErrors($element, &$form_state) {
+  public function elementValidateLimitValidationErrors($element, FormStateInterface &$form_state) {
     if ($element['#value'] == 'invalid') {
       form_error($element, $form_state, t('@label element is invalid', array('@label' => $element['#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, FormStateInterface &$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..2dd465a 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..51c507d 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..1a18d5d 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..4d7f5b2 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..646a6cf 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..ac1ac61 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..127f084 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, FormStateInterface &$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..f78ac76 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..2c57996 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..4c260f4 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..3ba17c9 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..e8c2f60 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();
     }
@@ -92,7 +93,7 @@ public function buildForm(array $form, array &$form_state) {
    *
    * Tests updating of cached form storage during validation.
    */
-  public function elementValidateValueCached($element, &$form_state) {
+  public function elementValidateValueCached($element, FormStateInterface &$form_state) {
     // If caching is enabled and we receive a certain value, change the storage.
     // This presumes that another submitted form value triggers a validation error
     // elsewhere in the form. Form API should still update the cached form storage
@@ -105,7 +106,7 @@ public function elementValidateValueCached($element, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function continueSubmitForm(array &$form, array &$form_state) {
+  public function continueSubmitForm(array &$form, FormStateInterface &$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..a5bc7f2 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..6fe80d0 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..8c01422 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..3afee7c 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..4aeacf2 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..2c83f84 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..e4ab55f 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..c962dd5 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'));
 
@@ -75,7 +76,7 @@ public function buildForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function elementValidateRequired($element, &$form_state) {
+  public function elementValidateRequired($element, FormStateInterface &$form_state) {
     // Set a custom validation error on the #required element.
     if (!empty($element['#required_but_empty']) && isset($element['#form_test_required_error'])) {
       form_error($element, $form_state, $element['#form_test_required_error']);
@@ -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..9aa1377 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..869a7b1 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..d1efb86 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..9d07f84 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..b685d61 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..c515f7d 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..5e5934a 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..78016b2 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..2bf067e 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..9455858 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/system/theme.api.php b/core/modules/system/theme.api.php
index ecfa229..e7897c4 100644
--- a/core/modules/system/theme.api.php
+++ b/core/modules/system/theme.api.php
@@ -168,7 +168,7 @@
  * @param $form_state
  *   A keyed array containing the current state of the form.
  */
-function hook_form_system_theme_settings_alter(&$form, &$form_state) {
+function hook_form_system_theme_settings_alter(&$form, \Drupal\Core\Form\FormStateInterface &$form_state) {
   // Add a checkbox to toggle the breadcrumb trail.
   $form['toggle_breadcrumb'] = array(
     '#type' => 'checkbox',
diff --git a/core/modules/taxonomy/src/Form/OverviewTerms.php b/core/modules/taxonomy/src/Form/OverviewTerms.php
index 4ff067a..31f4e51 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, FormStateInterface &$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..6042905 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..6f733f2 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..992a345 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..56aed5a 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..a342ec1 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..8719dd4 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/Plugin/views/argument/IndexTidDepth.php b/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php
index d41e893..7317b17 100644
--- a/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\taxonomy\Plugin\views\argument;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
 use Drupal\Component\Utility\String;
 
@@ -32,7 +33,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['depth'] = array(
       '#type' => 'weight',
       '#title' => t('Depth'),
diff --git a/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepthModifier.php b/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepthModifier.php
index ddfd1b9..c570771 100644
--- a/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepthModifier.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepthModifier.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\taxonomy\Plugin\views\argument;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
 
 /**
@@ -21,7 +22,7 @@
  */
 class IndexTidDepthModifier extends ArgumentPluginBase {
 
-  public function buildOptionsForm(&$form, &$form_state) { }
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   public function query($group_by = FALSE) { }
 
diff --git a/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php b/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
index 6dfd7bd..f449579 100644
--- a/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\taxonomy\Plugin\views\argument_default;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\taxonomy\TermInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -55,7 +56,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['term_page'] = array(
       '#type' => 'checkbox',
       '#title' => t('Load default filter from term page'),
@@ -113,7 +114,7 @@ public function buildOptionsForm(&$form, &$form_state) {
     );
   }
 
-  public function submitOptionsForm(&$form, &$form_state, &$options = array()) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state, &$options = array()) {
     // Filter unselected items so we don't unnecessarily store giant arrays.
     $options['vids'] = array_filter($options['vids']);
   }
diff --git a/core/modules/taxonomy/src/Plugin/views/argument_validator/TermName.php b/core/modules/taxonomy/src/Plugin/views/argument_validator/TermName.php
index d44b58c..196fe1c 100644
--- a/core/modules/taxonomy/src/Plugin/views/argument_validator/TermName.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument_validator/TermName.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\taxonomy\Plugin\views\argument_validator;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\Core\Entity\EntityManagerInterface;
@@ -53,7 +54,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['transform'] = array(
diff --git a/core/modules/taxonomy/src/Plugin/views/field/LinkEdit.php b/core/modules/taxonomy/src/Plugin/views/field/LinkEdit.php
index 295bb9c..bf5bc0b 100644
--- a/core/modules/taxonomy/src/Plugin/views/field/LinkEdit.php
+++ b/core/modules/taxonomy/src/Plugin/views/field/LinkEdit.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\taxonomy\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ResultRow;
@@ -39,7 +40,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['text'] = array(
       '#type' => 'textfield',
       '#title' => t('Text to display'),
diff --git a/core/modules/taxonomy/src/Plugin/views/field/Taxonomy.php b/core/modules/taxonomy/src/Plugin/views/field/Taxonomy.php
index 7700b27..e9b2fb5 100644
--- a/core/modules/taxonomy/src/Plugin/views/field/Taxonomy.php
+++ b/core/modules/taxonomy/src/Plugin/views/field/Taxonomy.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\taxonomy\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\area\Result;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -48,7 +49,7 @@ protected function defineOptions() {
   /**
    * Provide link to taxonomy option
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['link_to_taxonomy'] = array(
       '#title' => t('Link this field to its taxonomy term page'),
       '#description' => t("Enable to override this field's links."),
diff --git a/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php
index 90e8225..02fb2bd 100644
--- a/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php
+++ b/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\taxonomy\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\field\PrerenderList;
@@ -49,7 +50,7 @@ protected function defineOptions() {
   /**
    * Provide "link to term" option.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['link_to_taxonomy'] = array(
       '#title' => t('Link this field to its term page'),
       '#type' => 'checkbox',
diff --git a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
index 2c708ea..39118f6 100644
--- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
+++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\taxonomy\Plugin\views\filter;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\filter\ManyToOne;
@@ -51,7 +52,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildExtraOptionsForm(&$form, &$form_state) {
+  public function buildExtraOptionsForm(&$form, FormStateInterface &$form_state) {
     $vocabularies = entity_load_multiple('taxonomy_vocabulary');
     $options = array();
     foreach ($vocabularies as $voc) {
@@ -95,7 +96,7 @@ public function buildExtraOptionsForm(&$form, &$form_state) {
     );
   }
 
-  protected function valueForm(&$form, &$form_state) {
+  protected function valueForm(&$form, FormStateInterface &$form_state) {
     $vocabulary = entity_load('taxonomy_vocabulary', $this->options['vid']);
     if (empty($vocabulary) && $this->options['limit']) {
       $form['markup'] = array(
@@ -212,7 +213,7 @@ protected function valueForm(&$form, &$form_state) {
     }
   }
 
-  protected function valueValidate($form, &$form_state) {
+  protected function valueValidate($form, FormStateInterface &$form_state) {
     // We only validate if they've chosen the text field style.
     if ($this->options['type'] != 'textfield') {
       return;
@@ -253,7 +254,7 @@ public function acceptExposedInput($input) {
     return $rc;
   }
 
-  public function validateExposed(&$form, &$form_state) {
+  public function validateExposed(&$form, FormStateInterface &$form_state) {
     if (empty($this->options['exposed'])) {
       return;
     }
@@ -331,11 +332,11 @@ function validate_term_strings(&$form, $values) {
     return $tids;
   }
 
-  protected function valueSubmit($form, &$form_state) {
+  protected function valueSubmit($form, FormStateInterface &$form_state) {
     // prevent array_filter from messing up our arrays in parent submit.
   }
 
-  public function buildExposeForm(&$form, &$form_state) {
+  public function buildExposeForm(&$form, FormStateInterface &$form_state) {
     parent::buildExposeForm($form, $form_state);
     if ($this->options['type'] != 'select') {
       unset($form['expose']['reduce']);
diff --git a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php
index da0a61d..cc31f37 100644
--- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php
+++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\taxonomy\Plugin\views\filter;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Filter handler for taxonomy terms with depth.
  *
@@ -33,7 +35,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildExtraOptionsForm(&$form, &$form_state) {
+  public function buildExtraOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildExtraOptionsForm($form, $form_state);
 
     $form['depth'] = array(
diff --git a/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php b/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php
index c720ee9..1fe5c9e 100644
--- a/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php
+++ b/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\taxonomy\Plugin\views\relationship;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\relationship\RelationshipPluginBase;
@@ -44,7 +45,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $vocabularies = entity_load_multiple('taxonomy_vocabulary');
     $options = array();
     foreach ($vocabularies as $voc) {
diff --git a/core/modules/taxonomy/src/TermForm.php b/core/modules/taxonomy/src/TermForm.php
index 851fa43..0427e93 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..b1a537c 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, FormStateInterface &$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..a21f540 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, FormStateInterface &$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..15d48e2 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/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index 56ec514..ea831f2 100644
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -8,6 +8,7 @@
 use Drupal\Component\Utility\Tags;
 use Drupal\Core\Entity\ContentEntityDatabaseStorage;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Url;
@@ -717,7 +718,7 @@ function taxonomy_term_title(Term $term) {
 /**
  * Form element validate handler for taxonomy term autocomplete element.
  */
-function taxonomy_autocomplete_validate($element, &$form_state) {
+function taxonomy_autocomplete_validate($element, FormStateInterface &$form_state) {
   // Split the values into an array.
   // @see \Drupal\taxonomy\Plugin\Field\FieldWidget\TaxonomyAutocompleteWidget:massageFormValues()
   $typed_terms = array();
diff --git a/core/modules/telephone/src/Plugin/Field/FieldFormatter/TelephoneLinkFormatter.php b/core/modules/telephone/src/Plugin/Field/FieldFormatter/TelephoneLinkFormatter.php
index 7dd4dee..dcad4df 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..879b133 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..314c4a4 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..f9998b2 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..16e5eaf 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..4830df4 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..85e177a 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..9bd3b67 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..df25263 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..0f78a90 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..c39ff21 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..4515701 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..1b7e93e 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/update/update.module b/core/modules/update/update.module
index 06f2dd6..7de4692 100644
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -11,6 +11,7 @@
  * ability to install contributed modules and themes via an user interface.
  */
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Site\Settings;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
@@ -260,7 +261,7 @@ function update_form_system_modules_alter(&$form, $form_state) {
  *
  * @see update_form_system_modules_alter()
  */
-function update_storage_clear_submit($form, &$form_state) {
+function update_storage_clear_submit($form, FormStateInterface &$form_state) {
   // Clear all update module data.
   update_storage_clear();
 }
diff --git a/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php
index f4f718b..3740882 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..2d6b719 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..e2b1e2b 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..83b93d8 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, FormStateInterface &$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, FormStateInterface &$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, FormStateInterface &$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..bdd6ea9 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..d7869ab 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..2b943ea 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..466547e 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..85bba52 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..902de61 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..9c7d642 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..927d22b 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/access/Permission.php b/core/modules/user/src/Plugin/views/access/Permission.php
index 7797913..86c03eb 100644
--- a/core/modules/user/src/Plugin/views/access/Permission.php
+++ b/core/modules/user/src/Plugin/views/access/Permission.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Plugin\views\access;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\views\Plugin\views\access\AccessPluginBase;
 use Symfony\Component\Routing\Route;
@@ -60,7 +61,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $perms = array();
     $module_info = system_get_info('module');
diff --git a/core/modules/user/src/Plugin/views/access/Role.php b/core/modules/user/src/Plugin/views/access/Role.php
index 496c9d7..5473c66 100644
--- a/core/modules/user/src/Plugin/views/access/Role.php
+++ b/core/modules/user/src/Plugin/views/access/Role.php
@@ -8,6 +8,7 @@
 namespace Drupal\user\Plugin\views\access;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\access\AccessPluginBase;
 use Symfony\Component\Routing\Route;
 use Drupal\Core\Session\AccountInterface;
@@ -69,7 +70,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['role'] = array(
       '#type' => 'checkboxes',
@@ -80,13 +81,13 @@ public function buildOptionsForm(&$form, &$form_state) {
     );
   }
 
-  public function validateOptionsForm(&$form, &$form_state) {
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) {
     if (!array_filter($form_state['values']['access_options']['role'])) {
       form_error($form['role'], $form_state, t('You must select at least one role if type is "by role"'));
     }
   }
 
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     // I hate checkboxes.
     $form_state['values']['access_options']['role'] = array_filter($form_state['values']['access_options']['role']);
   }
diff --git a/core/modules/user/src/Plugin/views/argument_default/User.php b/core/modules/user/src/Plugin/views/argument_default/User.php
index fad8743..d252d43 100644
--- a/core/modules/user/src/Plugin/views/argument_default/User.php
+++ b/core/modules/user/src/Plugin/views/argument_default/User.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Plugin\views\argument_default;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\Request;
@@ -36,7 +37,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['user'] = array(
       '#type' => 'checkbox',
       '#title' => t('Also look for a node and use the node author'),
diff --git a/core/modules/user/src/Plugin/views/argument_validator/User.php b/core/modules/user/src/Plugin/views/argument_validator/User.php
index e6a15dd..2768c19 100644
--- a/core/modules/user/src/Plugin/views/argument_validator/User.php
+++ b/core/modules/user/src/Plugin/views/argument_validator/User.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\argument_validator\Entity;
 
 /**
@@ -50,7 +51,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['restrict_roles'] = array(
@@ -76,7 +77,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitOptionsForm(&$form, &$form_state, &$options = array()) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state, &$options = array()) {
     // filter trash out of the options so we don't store giant unnecessary arrays
     $options['roles'] = array_filter($options['roles']);
   }
diff --git a/core/modules/user/src/Plugin/views/argument_validator/UserName.php b/core/modules/user/src/Plugin/views/argument_validator/UserName.php
index daf50b3..5aae535 100644
--- a/core/modules/user/src/Plugin/views/argument_validator/UserName.php
+++ b/core/modules/user/src/Plugin/views/argument_validator/UserName.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\user\Plugin\views\argument_validator;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Validates whether a user name is valid.
  *
@@ -21,7 +23,7 @@ class UserName extends User {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $entity_type = $this->entityManager->getDefinition('user');
diff --git a/core/modules/user/src/Plugin/views/field/Link.php b/core/modules/user/src/Plugin/views/field/Link.php
index 1300de5..ffc9384 100644
--- a/core/modules/user/src/Plugin/views/field/Link.php
+++ b/core/modules/user/src/Plugin/views/field/Link.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -45,7 +46,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['text'] = array(
       '#type' => 'textfield',
       '#title' => t('Text to display'),
diff --git a/core/modules/user/src/Plugin/views/field/Mail.php b/core/modules/user/src/Plugin/views/field/Mail.php
index 2908526..9ea5344 100644
--- a/core/modules/user/src/Plugin/views/field/Mail.php
+++ b/core/modules/user/src/Plugin/views/field/Mail.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 
 /**
@@ -24,7 +25,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['link_to_user'] = array(
       '#title' => t('Link this field'),
diff --git a/core/modules/user/src/Plugin/views/field/Name.php b/core/modules/user/src/Plugin/views/field/Name.php
index fa924d7..e27628b 100644
--- a/core/modules/user/src/Plugin/views/field/Name.php
+++ b/core/modules/user/src/Plugin/views/field/Name.php
@@ -8,6 +8,7 @@
 namespace Drupal\user\Plugin\views\field;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\user\Plugin\views\field\User;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ResultRow;
@@ -48,7 +49,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['format_username'] = array(
diff --git a/core/modules/user/src/Plugin/views/field/User.php b/core/modules/user/src/Plugin/views/field/User.php
index ef04e9c..671089c 100644
--- a/core/modules/user/src/Plugin/views/field/User.php
+++ b/core/modules/user/src/Plugin/views/field/User.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ResultRow;
@@ -41,7 +42,7 @@ protected function defineOptions() {
   /**
    * Provide link to node option
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['link_to_user'] = array(
       '#title' => t('Link this field to its user'),
       '#description' => t("Enable to override this field's links."),
diff --git a/core/modules/user/src/Plugin/views/field/UserBulkForm.php b/core/modules/user/src/Plugin/views/field/UserBulkForm.php
index 3811eae..c5eef2f 100644
--- a/core/modules/user/src/Plugin/views/field/UserBulkForm.php
+++ b/core/modules/user/src/Plugin/views/field/UserBulkForm.php
@@ -8,6 +8,7 @@
 namespace Drupal\user\Plugin\views\field;
 
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\system\Plugin\views\field\BulkForm;
 use Drupal\user\UserInterface;
 
@@ -23,7 +24,7 @@ class UserBulkForm extends BulkForm {
    *
    * Provide a more useful title to improve the accessibility.
    */
-  public function viewsForm(&$form, &$form_state) {
+  public function viewsForm(&$form, FormStateInterface &$form_state) {
     parent::viewsForm($form, $form_state);
 
     if (!empty($this->view->result)) {
diff --git a/core/modules/user/src/Plugin/views/field/UserData.php b/core/modules/user/src/Plugin/views/field/UserData.php
index b58c3fc..4f7ad9d 100644
--- a/core/modules/user/src/Plugin/views/field/UserData.php
+++ b/core/modules/user/src/Plugin/views/field/UserData.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\ResultRow;
@@ -63,7 +64,7 @@ protected function defineOptions() {
   /**
    * Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $modules = system_get_info('module');
diff --git a/core/modules/user/src/Plugin/views/filter/Name.php b/core/modules/user/src/Plugin/views/filter/Name.php
index 0d1b5fc..863b77f 100644
--- a/core/modules/user/src/Plugin/views/filter/Name.php
+++ b/core/modules/user/src/Plugin/views/filter/Name.php
@@ -8,6 +8,7 @@
 namespace Drupal\user\Plugin\views\filter;
 
 use Drupal\Component\Utility\Tags;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\filter\InOperator;
 
 /**
@@ -21,7 +22,7 @@ class Name extends InOperator {
 
   protected $alwaysMultiple = TRUE;
 
-  protected function valueForm(&$form, &$form_state) {
+  protected function valueForm(&$form, FormStateInterface &$form_state) {
     $values = array();
     if ($this->value) {
       $result = entity_load_multiple_by_properties('user', array('uid' => $this->value));
@@ -50,7 +51,7 @@ protected function valueForm(&$form, &$form_state) {
     }
   }
 
-  protected function valueValidate($form, &$form_state) {
+  protected function valueValidate($form, FormStateInterface &$form_state) {
     $values = Tags::explode($form_state['values']['options']['value']);
     $uids = $this->validate_user_strings($form['value'], $form_state, $values);
 
@@ -72,7 +73,7 @@ public function acceptExposedInput($input) {
     return $rc;
   }
 
-  public function validateExposed(&$form, &$form_state) {
+  public function validateExposed(&$form, FormStateInterface &$form_state) {
     if (empty($this->options['exposed'])) {
       return;
     }
@@ -108,7 +109,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, FormStateInterface &$form_state, $values) {
     $uids = array();
     $placeholders = array();
     $args = array();
@@ -140,7 +141,7 @@ function validate_user_strings(&$form, array &$form_state, $values) {
     return $uids;
   }
 
-  protected function valueSubmit($form, &$form_state) {
+  protected function valueSubmit($form, FormStateInterface &$form_state) {
     // prevent array filter from removing our anonymous user.
   }
 
diff --git a/core/modules/user/src/ProfileForm.php b/core/modules/user/src/ProfileForm.php
index fbe7665..954bcb6 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();
@@ -56,7 +57,7 @@ public function save(array $form, array &$form_state) {
   /**
    * Provides a submit handler for the 'Cancel account' button.
    */
-  public function editCancelSubmit($form, &$form_state) {
+  public function editCancelSubmit($form, FormStateInterface &$form_state) {
     $destination = array();
     $query = $this->getRequest()->query;
     if ($query->has('destination')) {
diff --git a/core/modules/user/src/ProfileTranslationHandler.php b/core/modules/user/src/ProfileTranslationHandler.php
index c332d83..15bdc33 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, FormStateInterface &$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..f77802a 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..62012d2 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..52295e1 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..c9ddece 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/user/user.module b/core/modules/user/user.module
index 32c2571..599ad99 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -4,6 +4,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Session\AnonymousUserSession;
@@ -508,7 +509,7 @@ function user_user_view(array &$build, UserInterface $account, EntityViewDisplay
 /**
  * Sets the value of the user register and profile forms' langcode element.
  */
-function _user_language_selector_langcode_value($element, $input, &$form_state) {
+function _user_language_selector_langcode_value($element, $input, FormStateInterface &$form_state) {
   // Only add to the description if the form element have a description.
   if (isset($form_state['complete_form']['language']['preferred_langcode']['#description'])) {
     $form_state['complete_form']['language']['preferred_langcode']['#description'] .= ' ' . t("This is also assumed to be the primary language of this account's profile information.");
@@ -521,7 +522,7 @@ function _user_language_selector_langcode_value($element, $input, &$form_state)
  *
  * @see AccountForm::form()
  */
-function user_validate_current_pass(&$form, &$form_state) {
+function user_validate_current_pass(&$form, FormStateInterface &$form_state) {
   $account = $form_state['user'];
   foreach ($form_state['values']['current_pass_required_values'] as $key => $name) {
     // This validation only works for required textfields (like mail) or
diff --git a/core/modules/views/includes/ajax.inc b/core/modules/views/includes/ajax.inc
index 84c33eb..5930856 100644
--- a/core/modules/views/includes/ajax.inc
+++ b/core/modules/views/includes/ajax.inc
@@ -5,6 +5,7 @@
  * Handles the server side AJAX interactions of Views.
  */
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Ajax\HighlightCommand;
 use Drupal\Core\Ajax\OpenModalDialogCommand;
 use Drupal\Core\Ajax\AjaxResponse;
@@ -14,16 +15,14 @@
  * some AJAX stuff automatically.
  * This makes some assumptions about the client.
  */
-function views_ajax_form_wrapper($form_class, &$form_state) {
+function views_ajax_form_wrapper($form_class, FormStateInterface &$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..724f671 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..44e328d 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..8ed170f 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/ManyToOneHelper.php b/core/modules/views/src/ManyToOneHelper.php
index 4c4d2ae..0aef719 100644
--- a/core/modules/views/src/ManyToOneHelper.php
+++ b/core/modules/views/src/ManyToOneHelper.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\HandlerBase;
 
 /**
@@ -33,7 +34,7 @@ public static function defineOptions(&$options) {
     $options['reduce_duplicates'] = array('default' => FALSE, 'bool' => TRUE);
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['reduce_duplicates'] = array(
       '#type' => 'checkbox',
       '#title' => t('Reduce duplicates'),
diff --git a/core/modules/views/src/Plugin/Block/ViewsBlock.php b/core/modules/views/src/Plugin/Block/ViewsBlock.php
index a80aa97..4b6c752 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..d979197 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..99e2c0c 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/BrokenHandlerTrait.php b/core/modules/views/src/Plugin/views/BrokenHandlerTrait.php
index e1623f7..20a33d7 100644
--- a/core/modules/views/src/Plugin/views/BrokenHandlerTrait.php
+++ b/core/modules/views/src/Plugin/views/BrokenHandlerTrait.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * A Trait for Views broken handlers.
  */
@@ -55,7 +57,7 @@ public function query($group_by = FALSE) {
    *
    * @see \Drupal\views\Plugin\views\PluginBase::defineOptions().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     if ($this->isOptional()) {
       $description_top = t('The handler for this item is optional. The following details are available:');
     }
diff --git a/core/modules/views/src/Plugin/views/HandlerBase.php b/core/modules/views/src/Plugin/views/HandlerBase.php
index 979fa4b..5dccde9 100644
--- a/core/modules/views/src/Plugin/views/HandlerBase.php
+++ b/core/modules/views/src/Plugin/views/HandlerBase.php
@@ -12,6 +12,7 @@
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Component\Utility\Xss;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -295,7 +296,7 @@ protected function caseTransform($string, $option) {
   /**
    * Build the options form.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     // Some form elements belong in a fieldset for presentation, but can't
     // be moved into one because of the form_state['values'] hierarchy. Those
     // elements can add a #fieldset => 'fieldset_name' property, and they'll
@@ -366,7 +367,7 @@ public function usesGroupBy() {
   /**
    * Provide a form for aggregation settings.
    */
-  public function buildGroupByForm(&$form, &$form_state) {
+  public function buildGroupByForm(&$form, FormStateInterface &$form_state) {
     $display_id = $form_state['display_id'];
     $type = $form_state['type'];
     $id = $form_state['id'];
@@ -392,7 +393,7 @@ public function buildGroupByForm(&$form, &$form_state) {
    * Perform any necessary changes to the form values prior to storage.
    * There is no need for this function to actually store the data.
    */
-  public function submitGroupByForm(&$form, &$form_state) {
+  public function submitGroupByForm(&$form, FormStateInterface &$form_state) {
     $form_state['handler']->options['group_type'] = $form_state['values']['options']['group_type'];
   }
 
@@ -410,18 +411,18 @@ public function defineExtraOptions(&$option) { }
   /**
    * Provide a form for setting options.
    */
-  public function buildExtraOptionsForm(&$form, &$form_state) { }
+  public function buildExtraOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Validate the options form.
    */
-  public function validateExtraOptionsForm($form, &$form_state) { }
+  public function validateExtraOptionsForm($form, FormStateInterface &$form_state) { }
 
   /**
    * Perform any necessary changes to the form values prior to storage.
    * There is no need for this function to actually store the data.
    */
-  public function submitExtraOptionsForm($form, &$form_state) { }
+  public function submitExtraOptionsForm($form, FormStateInterface &$form_state) { }
 
   /**
    * Determine if a handler can be exposed.
@@ -442,43 +443,43 @@ public function exposedInfo() { }
   /**
    * Render our chunk of the exposed handler form when selecting
    */
-  public function buildExposedForm(&$form, &$form_state) { }
+  public function buildExposedForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Validate the exposed handler form
    */
-  public function validateExposed(&$form, &$form_state) { }
+  public function validateExposed(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Submit the exposed handler form
    */
-  public function submitExposed(&$form, &$form_state) { }
+  public function submitExposed(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Form for exposed handler options.
    */
-  public function buildExposeForm(&$form, &$form_state) { }
+  public function buildExposeForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Validate the options form.
    */
-  public function validateExposeForm($form, &$form_state) { }
+  public function validateExposeForm($form, FormStateInterface &$form_state) { }
 
   /**
    * Perform any necessary changes to the form exposes prior to storage.
    * There is no need for this function to actually store the data.
    */
-  public function submitExposeForm($form, &$form_state) { }
+  public function submitExposeForm($form, FormStateInterface &$form_state) { }
 
   /**
    * Shortcut to display the expose/hide button.
    */
-  public function showExposeButton(&$form, &$form_state) { }
+  public function showExposeButton(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Shortcut to display the exposed options form.
    */
-  public function showExposeForm(&$form, &$form_state) {
+  public function showExposeForm(&$form, FormStateInterface &$form_state) {
     if (empty($this->options['exposed'])) {
       return;
     }
@@ -904,7 +905,7 @@ public static function breakPhraseString($str, &$handler = NULL) {
   /**
    * Displays the Expose form.
    */
-  public function displayExposedForm($form, &$form_state) {
+  public function displayExposedForm($form, FormStateInterface &$form_state) {
     $item = &$this->options;
     // flip
     $item['exposed'] = empty($item['exposed']);
@@ -928,7 +929,7 @@ public function displayExposedForm($form, &$form_state) {
    * A submit handler that is used for storing temporary items when using
    * multi-step changes, such as ajax requests.
    */
-  public function submitTemporaryForm($form, &$form_state) {
+  public function submitTemporaryForm($form, FormStateInterface &$form_state) {
     // Run it through the handler's submit function.
     $this->submitOptionsForm($form['options'], $form_state);
     $item = $this->options;
diff --git a/core/modules/views/src/Plugin/views/PluginBase.php b/core/modules/views/src/Plugin/views/PluginBase.php
index f19520a..f7a80d7 100644
--- a/core/modules/views/src/Plugin/views/PluginBase.php
+++ b/core/modules/views/src/Plugin/views/PluginBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Plugin\PluginBase as ComponentPluginBase;
 use Drupal\Core\Render\Element;
@@ -216,7 +217,7 @@ public function destroy() {
   /**
    * Provide a form to edit options for this plugin.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     // Some form elements belong in a fieldset for presentation, but can't
     // be moved into one because of the form_state['values'] hierarchy. Those
     // elements can add a #fieldset => 'fieldset_name' property, and they'll
@@ -227,12 +228,12 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * Validate the options form.
    */
-  public function validateOptionsForm(&$form, &$form_state) { }
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Handle any special handling on the validate form.
    */
-  public function submitOptionsForm(&$form, &$form_state) { }
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Add anything to the query that we might need to.
@@ -336,10 +337,10 @@ 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) {
+  public function globalTokenForm(&$form, FormStateInterface &$form_state) {
     $token_items = array();
 
     foreach ($this->getAvailableGlobalTokens() as $type => $tokens) {
diff --git a/core/modules/views/src/Plugin/views/area/AreaPluginBase.php b/core/modules/views/src/Plugin/views/area/AreaPluginBase.php
index dcd3ad0..1f6e9c4 100644
--- a/core/modules/views/src/Plugin/views/area/AreaPluginBase.php
+++ b/core/modules/views/src/Plugin/views/area/AreaPluginBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\area;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\HandlerBase;
@@ -81,7 +82,7 @@ public function adminSummary() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     if ($form_state['type'] != 'empty') {
diff --git a/core/modules/views/src/Plugin/views/area/Entity.php b/core/modules/views/src/Plugin/views/area/Entity.php
index f762c03..df31d53 100644
--- a/core/modules/views/src/Plugin/views/area/Entity.php
+++ b/core/modules/views/src/Plugin/views/area/Entity.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\area;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ViewExecutable;
 
@@ -54,7 +55,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['view_mode'] = array(
diff --git a/core/modules/views/src/Plugin/views/area/HTTPStatusCode.php b/core/modules/views/src/Plugin/views/area/HTTPStatusCode.php
index 1118169..c8431a4 100644
--- a/core/modules/views/src/Plugin/views/area/HTTPStatusCode.php
+++ b/core/modules/views/src/Plugin/views/area/HTTPStatusCode.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\area;
 
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpFoundation\Response;
 
 /**
@@ -32,7 +33,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     // Get all possible status codes defined by symfony.
diff --git a/core/modules/views/src/Plugin/views/area/Result.php b/core/modules/views/src/Plugin/views/area/Result.php
index c675ed6..2e0b247 100644
--- a/core/modules/views/src/Plugin/views/area/Result.php
+++ b/core/modules/views/src/Plugin/views/area/Result.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Xss;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\style\DefaultSummary;
 
 /**
@@ -37,7 +38,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $item_list = array(
       '#theme' => 'item_list',
diff --git a/core/modules/views/src/Plugin/views/area/Text.php b/core/modules/views/src/Plugin/views/area/Text.php
index de89210..d4cdac1 100644
--- a/core/modules/views/src/Plugin/views/area/Text.php
+++ b/core/modules/views/src/Plugin/views/area/Text.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\area;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Views area text handler.
  *
@@ -29,7 +31,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['content'] = array(
@@ -45,7 +47,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     $form_state['values']['options']['format'] = $form_state['values']['options']['content']['format'];
     $form_state['values']['options']['content'] = $form_state['values']['options']['content']['value'];
     parent::submitOptionsForm($form, $form_state);
diff --git a/core/modules/views/src/Plugin/views/area/TextCustom.php b/core/modules/views/src/Plugin/views/area/TextCustom.php
index fcd798c..8ba6cc1 100644
--- a/core/modules/views/src/Plugin/views/area/TextCustom.php
+++ b/core/modules/views/src/Plugin/views/area/TextCustom.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\area;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Views area text handler.
  *
@@ -28,7 +30,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['content'] = array(
diff --git a/core/modules/views/src/Plugin/views/area/Title.php b/core/modules/views/src/Plugin/views/area/Title.php
index ef29f3f..7615d05 100644
--- a/core/modules/views/src/Plugin/views/area/Title.php
+++ b/core/modules/views/src/Plugin/views/area/Title.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\area;
 
+use Drupal\Core\Form\FormStateInterface;
 use \Drupal\Core\Utility\Title as UtilityTitle;
 
 /**
@@ -30,7 +31,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['title'] = array(
diff --git a/core/modules/views/src/Plugin/views/area/TokenizeAreaPluginBase.php b/core/modules/views/src/Plugin/views/area/TokenizeAreaPluginBase.php
index 6f0add5..712cfe5 100644
--- a/core/modules/views/src/Plugin/views/area/TokenizeAreaPluginBase.php
+++ b/core/modules/views/src/Plugin/views/area/TokenizeAreaPluginBase.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\area;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Tokenized base class for area handlers.
  *
@@ -31,7 +33,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     // Add tokenization form elements.
@@ -41,7 +43,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * Adds tokenization form elements.
    */
-  public function tokenForm(&$form, &$form_state) {
+  public function tokenForm(&$form, FormStateInterface &$form_state) {
     $form['tokenize'] = array(
       '#type' => 'checkbox',
       '#title' => t('Use replacement tokens from the first row'),
diff --git a/core/modules/views/src/Plugin/views/area/View.php b/core/modules/views/src/Plugin/views/area/View.php
index a0ec508..fdffd8f 100644
--- a/core/modules/views/src/Plugin/views/area/View.php
+++ b/core/modules/views/src/Plugin/views/area/View.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\area;
 
 use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Views;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -78,7 +79,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $view_display = $this->view->storage->id() . ':' . $this->view->current_display;
diff --git a/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php b/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
index 6328269..1a78a30 100644
--- a/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
+++ b/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\argument;
 
 use Drupal\Component\Utility\String as UtilityString;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\views\Plugin\views\PluginBase;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -150,7 +151,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $argument_text = $this->view->display_handler->getArgumentText();
@@ -343,7 +344,7 @@ public function buildOptionsForm(&$form, &$form_state) {
     );
   }
 
-  public function validateOptionsForm(&$form, &$form_state) {
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) {
     if (empty($form_state['values']['options'])) {
       return;
     }
@@ -372,7 +373,7 @@ public function validateOptionsForm(&$form, &$form_state) {
 
   }
 
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     if (empty($form_state['values']['options'])) {
       return;
     }
@@ -473,7 +474,7 @@ protected function defaultActions($which = NULL) {
    * Provide a form for selecting the default argument when the
    * default action is set to provide default argument.
    */
-  public function defaultArgumentForm(&$form, &$form_state) {
+  public function defaultArgumentForm(&$form, FormStateInterface &$form_state) {
     $plugins = Views::pluginManager('argument_default')->getDefinitions();
     $options = array();
 
@@ -538,7 +539,7 @@ public function defaultArgumentForm(&$form, &$form_state) {
    * Provide a form for selecting further summary options when the
    * default action is set to display one.
    */
-  public function defaultSummaryForm(&$form, &$form_state) {
+  public function defaultSummaryForm(&$form, FormStateInterface &$form_state) {
     $style_plugins = Views::pluginManager('style')->getDefinitions();
     $summary_plugins = array();
     $format_options = array();
diff --git a/core/modules/views/src/Plugin/views/argument/Date.php b/core/modules/views/src/Plugin/views/argument/Date.php
index 67c0055..7e00b27 100644
--- a/core/modules/views/src/Plugin/views/argument/Date.php
+++ b/core/modules/views/src/Plugin/views/argument/Date.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\argument;
 
 use Drupal\Core\Database\Database;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\node\NodeInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\Request;
@@ -49,7 +50,7 @@ class Date extends Formula {
   /**
    * Add an option to set the default value to the current date.
    */
-  public function defaultArgumentForm(&$form, &$form_state) {
+  public function defaultArgumentForm(&$form, FormStateInterface &$form_state) {
     parent::defaultArgumentForm($form, $form_state);
     $form['default_argument_type']['#options'] += array('date' => $this->t('Current date'));
     $form['default_argument_type']['#options'] += array('node_created' => $this->t("Current node's creation time"));
diff --git a/core/modules/views/src/Plugin/views/argument/ManyToOne.php b/core/modules/views/src/Plugin/views/argument/ManyToOne.php
index 3180862..2041e4b 100644
--- a/core/modules/views/src/Plugin/views/argument/ManyToOne.php
+++ b/core/modules/views/src/Plugin/views/argument/ManyToOne.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\argument;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ManyToOneHelper;
@@ -62,7 +63,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     // allow + for or, , for and
diff --git a/core/modules/views/src/Plugin/views/argument/Null.php b/core/modules/views/src/Plugin/views/argument/Null.php
index e4fdab6..d642c87 100644
--- a/core/modules/views/src/Plugin/views/argument/Null.php
+++ b/core/modules/views/src/Plugin/views/argument/Null.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\argument;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Argument handler that ignores the argument.
  *
@@ -26,7 +28,7 @@ protected function defineOptions() {
    * Override buildOptionsForm() so that only the relevant options
    * are displayed to the user.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['must_not_be'] = array(
       '#type' => 'checkbox',
diff --git a/core/modules/views/src/Plugin/views/argument/Numeric.php b/core/modules/views/src/Plugin/views/argument/Numeric.php
index 565b285..b8937d1 100644
--- a/core/modules/views/src/Plugin/views/argument/Numeric.php
+++ b/core/modules/views/src/Plugin/views/argument/Numeric.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\argument;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Basic argument handler for arguments that are numeric. Incorporates
  * break_phrase.
@@ -38,7 +40,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     // allow + for or, , for and
diff --git a/core/modules/views/src/Plugin/views/argument/String.php b/core/modules/views/src/Plugin/views/argument/String.php
index b606de7..8397940 100644
--- a/core/modules/views/src/Plugin/views/argument/String.php
+++ b/core/modules/views/src/Plugin/views/argument/String.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\argument;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ManyToOneHelper;
@@ -54,7 +55,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['glossary'] = array(
diff --git a/core/modules/views/src/Plugin/views/argument_default/ArgumentDefaultPluginBase.php b/core/modules/views/src/Plugin/views/argument_default/ArgumentDefaultPluginBase.php
index d478aa6..0ddc499 100644
--- a/core/modules/views/src/Plugin/views/argument_default/ArgumentDefaultPluginBase.php
+++ b/core/modules/views/src/Plugin/views/argument_default/ArgumentDefaultPluginBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\argument_default;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
 use Drupal\views\Plugin\views\PluginBase;
@@ -68,17 +69,17 @@ protected function defineOptions() { return array(); }
   /**
    * Provide the default form for setting options.
    */
-  public function buildOptionsForm(&$form, &$form_state) { }
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Provide the default form form for validating options
    */
-  public function validateOptionsForm(&$form, &$form_state) { }
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Provide the default form form for submitting options
    */
-  public function submitOptionsForm(&$form, &$form_state, &$options = array()) { }
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state, &$options = array()) { }
 
   /**
    * Determine if the administrator has the privileges to use this
diff --git a/core/modules/views/src/Plugin/views/argument_default/Fixed.php b/core/modules/views/src/Plugin/views/argument_default/Fixed.php
index 4dcb180..c8ab5da 100644
--- a/core/modules/views/src/Plugin/views/argument_default/Fixed.php
+++ b/core/modules/views/src/Plugin/views/argument_default/Fixed.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\argument_default;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * The fixed argument default handler.
  *
@@ -26,7 +28,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['argument'] = array(
       '#type' => 'textfield',
diff --git a/core/modules/views/src/Plugin/views/argument_default/QueryParameter.php b/core/modules/views/src/Plugin/views/argument_default/QueryParameter.php
index d8eb1ab..b508d7e 100644
--- a/core/modules/views/src/Plugin/views/argument_default/QueryParameter.php
+++ b/core/modules/views/src/Plugin/views/argument_default/QueryParameter.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\argument_default;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * A query parameter argument default handler.
  *
@@ -34,7 +36,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['query_param'] = array(
       '#type' => 'textfield',
diff --git a/core/modules/views/src/Plugin/views/argument_default/Raw.php b/core/modules/views/src/Plugin/views/argument_default/Raw.php
index afbd7af..bbba958 100644
--- a/core/modules/views/src/Plugin/views/argument_default/Raw.php
+++ b/core/modules/views/src/Plugin/views/argument_default/Raw.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\argument_default;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Path\AliasManagerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\Request;
@@ -68,7 +69,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['index'] = array(
       '#type' => 'select',
diff --git a/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php b/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php
index b5c852a..e887a25 100644
--- a/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php
+++ b/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\argument_validator;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
 use Drupal\views\Plugin\views\PluginBase;
@@ -64,17 +65,17 @@ protected function defineOptions() { return array(); }
   /**
    * Provide the default form for setting options.
    */
-  public function buildOptionsForm(&$form, &$form_state) { }
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Provide the default form form for validating options
    */
-  public function validateOptionsForm(&$form, &$form_state) { }
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Provide the default form form for submitting options
    */
-  public function submitOptionsForm(&$form, &$form_state, &$options = array()) { }
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state, &$options = array()) { }
 
   /**
    * Determine if the administrator has the privileges to use this plugin
diff --git a/core/modules/views/src/Plugin/views/argument_validator/Entity.php b/core/modules/views/src/Plugin/views/argument_validator/Entity.php
index a807cbc..f6b8d44 100644
--- a/core/modules/views/src/Plugin/views/argument_validator/Entity.php
+++ b/core/modules/views/src/Plugin/views/argument_validator/Entity.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -85,7 +86,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $entity_type_id = $this->definition['entity_type'];
@@ -149,7 +150,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function submitOptionsForm(&$form, &$form_state, &$options = array()) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state, &$options = array()) {
     // Filter out unused options so we don't store giant unnecessary arrays.
     $options['bundles'] = array_filter($options['bundles']);
   }
diff --git a/core/modules/views/src/Plugin/views/cache/Time.php b/core/modules/views/src/Plugin/views/cache/Time.php
index 054f545..928e4ed 100644
--- a/core/modules/views/src/Plugin/views/cache/Time.php
+++ b/core/modules/views/src/Plugin/views/cache/Time.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\cache;
 
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Simple caching of query results for Views displays.
@@ -37,7 +38,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $options = array(60, 300, 1800, 3600, 21600, 518400);
     $options = array_map('format_interval', array_combine($options, $options));
@@ -85,7 +86,7 @@ public function buildOptionsForm(&$form, &$form_state) {
     );
   }
 
-  public function validateOptionsForm(&$form, &$form_state) {
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) {
     $custom_fields = array('output_lifespan', 'results_lifespan');
     foreach ($custom_fields as $field) {
       if ($form_state['values']['cache_options'][$field] == 'custom' && !is_numeric($form_state['values']['cache_options'][$field . '_custom'])) {
diff --git a/core/modules/views/src/Plugin/views/display/Attachment.php b/core/modules/views/src/Plugin/views/display/Attachment.php
index 9673e55..f783446 100644
--- a/core/modules/views/src/Plugin/views/display/Attachment.php
+++ b/core/modules/views/src/Plugin/views/display/Attachment.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\display;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 
 /**
@@ -140,7 +141,7 @@ public function optionsSummary(&$categories, &$options) {
   /**
    * Provide the default form for setting options.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     // It is very important to call the parent function here:
     parent::buildOptionsForm($form, $form_state);
 
@@ -214,7 +215,7 @@ public function buildOptionsForm(&$form, &$form_state) {
    * Perform any necessary changes to the form values prior to storage.
    * There is no need for this function to actually store the data.
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     // It is very important to call the parent function here:
     parent::submitOptionsForm($form, $form_state);
     switch ($form_state['section']) {
diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
index 288a84b..86a8490 100644
--- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Theme\Registry;
@@ -1381,7 +1382,7 @@ public function optionsSummary(&$categories, &$options) {
   /**
    * Provide the default form for setting options.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     if ($this->defaultableSections($form_state['section'])) {
       views_ui_standard_display_dropdown($form, $form_state, $form_state['section']);
@@ -1873,7 +1874,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * Validate the options form.
    */
-  public function validateOptionsForm(&$form, &$form_state) {
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) {
     switch ($form_state['section']) {
       case 'display_title':
         if (empty($form_state['values']['display_title'])) {
@@ -1925,7 +1926,7 @@ public function validateOptionsForm(&$form, &$form_state) {
    * Perform any necessary changes to the form values prior to storage.
    * There is no need for this function to actually store the data.
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     // Not sure I like this being here, but it seems (?) like a logical place.
     $cache_plugin = $this->getPlugin('cache');
     if ($cache_plugin) {
@@ -2027,7 +2028,7 @@ public function submitOptionsForm(&$form, &$form_state) {
   /**
    * If override/revert was clicked, perform the proper toggle.
    */
-  public function optionsOverride($form, &$form_state) {
+  public function optionsOverride($form, FormStateInterface &$form_state) {
     $this->setOverride($form_state['section']);
   }
 
diff --git a/core/modules/views/src/Plugin/views/display/Feed.php b/core/modules/views/src/Plugin/views/display/Feed.php
index ed7a571..9cbd0e9 100644
--- a/core/modules/views/src/Plugin/views/display/Feed.php
+++ b/core/modules/views/src/Plugin/views/display/Feed.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\display;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Views;
 use Symfony\Component\HttpFoundation\Response;
@@ -193,7 +194,7 @@ public function optionsSummary(&$categories, &$options) {
   /**
    * Overrides \Drupal\views\Plugin\views\display\PathPluginBase::buildOptionsForm().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     // It is very important to call the parent function here.
     parent::buildOptionsForm($form, $form_state);
 
@@ -239,7 +240,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::submitOptionsForm().
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::submitOptionsForm($form, $form_state);
     switch ($form_state['section']) {
       case 'title':
diff --git a/core/modules/views/src/Plugin/views/display/Page.php b/core/modules/views/src/Plugin/views/display/Page.php
index 21a4de2..2fe5b81 100644
--- a/core/modules/views/src/Plugin/views/display/Page.php
+++ b/core/modules/views/src/Plugin/views/display/Page.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\display;
 
 use Drupal\Component\Utility\Xss;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 
@@ -148,7 +149,7 @@ public function optionsSummary(&$categories, &$options) {
   /**
    * Overrides \Drupal\views\Plugin\views\display\callbackPluginBase::buildOptionsForm().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     switch ($form_state['section']) {
@@ -377,7 +378,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * Overrides \Drupal\views\Plugin\views\display\callbackPluginBase::validateOptionsForm().
    */
-  public function validateOptionsForm(&$form, &$form_state) {
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::validateOptionsForm($form, $form_state);
 
     if ($form_state['section'] == 'menu') {
@@ -403,7 +404,7 @@ public function validateOptionsForm(&$form, &$form_state) {
   /**
    * Overrides \Drupal\views\Plugin\views\display\callbackPluginBase::submitOptionsForm().
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::submitOptionsForm($form, $form_state);
 
     switch ($form_state['section']) {
diff --git a/core/modules/views/src/Plugin/views/display/PathPluginBase.php b/core/modules/views/src/Plugin/views/display/PathPluginBase.php
index 44127ec..def21ea 100644
--- a/core/modules/views/src/Plugin/views/display/PathPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display/PathPluginBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\display;
 
 use Drupal\Core\Form\FormErrorInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\State\StateInterface;
 use Drupal\Core\Routing\RouteCompiler;
 use Drupal\Core\Routing\RouteProviderInterface;
@@ -379,7 +380,7 @@ public function optionsSummary(&$categories, &$options) {
   /**
    * Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::buildOptionsForm().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     switch ($form_state['section']) {
@@ -403,7 +404,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::validateOptionsForm().
    */
-  public function validateOptionsForm(&$form, &$form_state) {
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::validateOptionsForm($form, $form_state);
 
     if ($form_state['section'] == 'path') {
@@ -420,7 +421,7 @@ public function validateOptionsForm(&$form, &$form_state) {
   /**
    * Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::submitOptionsForm().
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::submitOptionsForm($form, $form_state);
 
     if ($form_state['section'] == 'path') {
diff --git a/core/modules/views/src/Plugin/views/display_extender/DisplayExtenderPluginBase.php b/core/modules/views/src/Plugin/views/display_extender/DisplayExtenderPluginBase.php
index 178014f..6b68652 100644
--- a/core/modules/views/src/Plugin/views/display_extender/DisplayExtenderPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display_extender/DisplayExtenderPluginBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\display_extender;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\PluginBase;
 
@@ -46,17 +47,17 @@ public function defineOptionsAlter(&$options) { }
   /**
    * Provide a form to edit options for this plugin.
    */
-  public function buildOptionsForm(&$form, &$form_state) { }
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Validate the options form.
    */
-  public function validateOptionsForm(&$form, &$form_state) { }
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Handle any special handling on the validate form.
    */
-  public function submitOptionsForm(&$form, &$form_state) { }
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Set up any variables on the view prior to execution.
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..7f4ce2a 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,8 @@
 namespace Drupal\views\Plugin\views\exposed_form;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormState;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Form\ViewsExposedForm;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -51,7 +53,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['submit_button'] = array(
       '#type' => 'textfield',
@@ -127,14 +129,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
@@ -199,7 +201,7 @@ public function postExecute() { }
    * @param $form_state
    *   The form state. Passed by reference.
    */
-  public function exposedFormAlter(&$form, &$form_state) {
+  public function exposedFormAlter(&$form, FormStateInterface &$form_state) {
     if (!empty($this->options['submit_button'])) {
       $form['actions']['submit']['#value'] = $this->options['submit_button'];
     }
@@ -274,7 +276,7 @@ public function exposedFormAlter(&$form, &$form_state) {
     }
   }
 
-  public function exposedFormValidate(&$form, &$form_state) {
+  public function exposedFormValidate(&$form, FormStateInterface &$form_state) {
     if (isset($form_state['pager_plugin'])) {
       $form_state['pager_plugin']->exposedFormValidate($form, $form_state);
     }
@@ -291,7 +293,7 @@ public function exposedFormValidate(&$form, &$form_state) {
    *   Nested array of keys to exclude of insert into
    *   $view->exposed_raw_input
    */
-  public function exposedFormSubmit(&$form, &$form_state, &$exclude) {
+  public function exposedFormSubmit(&$form, FormStateInterface &$form_state, &$exclude) {
     if (!empty($form_state['values']['op']) && $form_state['values']['op'] == $this->options['reset_button_label']) {
       $this->resetForm($form, $form_state);
     }
@@ -301,7 +303,7 @@ public function exposedFormSubmit(&$form, &$form_state, &$exclude) {
     }
   }
 
-  public function resetForm(&$form, &$form_state) {
+  public function resetForm(&$form, FormStateInterface &$form_state) {
     // _SESSION is not defined for users who are not logged in.
 
     // If filters are not overridden, store the 'remember' settings on the
diff --git a/core/modules/views/src/Plugin/views/exposed_form/InputRequired.php b/core/modules/views/src/Plugin/views/exposed_form/InputRequired.php
index 99f5ea4..f2bd87a 100644
--- a/core/modules/views/src/Plugin/views/exposed_form/InputRequired.php
+++ b/core/modules/views/src/Plugin/views/exposed_form/InputRequired.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\exposed_form;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Views;
 
 /**
@@ -30,7 +31,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['text_input_required'] = array(
@@ -43,7 +44,7 @@ public function buildOptionsForm(&$form, &$form_state) {
     );
   }
 
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     $form_state['values']['exposed_form_options']['text_input_required_format'] = $form_state['values']['exposed_form_options']['text_input_required']['format'];
     $form_state['values']['exposed_form_options']['text_input_required'] = $form_state['values']['exposed_form_options']['text_input_required']['value'];
     parent::submitOptionsForm($form, $form_state);
diff --git a/core/modules/views/src/Plugin/views/field/Boolean.php b/core/modules/views/src/Plugin/views/field/Boolean.php
index cf4ef77..4e6045a 100644
--- a/core/modules/views/src/Plugin/views/field/Boolean.php
+++ b/core/modules/views/src/Plugin/views/field/Boolean.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\field;
 
 use Drupal\Component\Utility\Xss as UtilityXss;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -61,7 +62,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
     $this->formats = array_merge($default_formats, $output_formats, $custom_format);
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     foreach ($this->formats as $key => $item) {
       $options[$key] = implode('/', $item);
     }
diff --git a/core/modules/views/src/Plugin/views/field/Counter.php b/core/modules/views/src/Plugin/views/field/Counter.php
index a8a4ffd..1e0d5b6 100644
--- a/core/modules/views/src/Plugin/views/field/Counter.php
+++ b/core/modules/views/src/Plugin/views/field/Counter.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 
 /**
@@ -32,7 +33,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['counter_start'] = array(
       '#type' => 'textfield',
       '#title' => t('Starting value'),
diff --git a/core/modules/views/src/Plugin/views/field/Custom.php b/core/modules/views/src/Plugin/views/field/Custom.php
index e3c347a..7cb044e 100644
--- a/core/modules/views/src/Plugin/views/field/Custom.php
+++ b/core/modules/views/src/Plugin/views/field/Custom.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 
 /**
@@ -38,7 +39,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     // Remove the checkbox
diff --git a/core/modules/views/src/Plugin/views/field/Date.php b/core/modules/views/src/Plugin/views/field/Date.php
index e7a9bd7..a6362b6 100644
--- a/core/modules/views/src/Plugin/views/field/Date.php
+++ b/core/modules/views/src/Plugin/views/field/Date.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\field;
 
 use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Datetime\Date as DateService;
@@ -79,7 +80,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
 
     $date_formats = array();
     foreach ($this->dateFormatStorage->loadMultiple() as $machine_name => $value) {
diff --git a/core/modules/views/src/Plugin/views/field/EntityLabel.php b/core/modules/views/src/Plugin/views/field/EntityLabel.php
index 60ad43e..28d24ca 100644
--- a/core/modules/views/src/Plugin/views/field/EntityLabel.php
+++ b/core/modules/views/src/Plugin/views/field/EntityLabel.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\field;
 
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\ResultRow;
 use Drupal\views\ViewExecutable;
@@ -85,7 +86,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['link_to_entity'] = array(
       '#title' => t('Link to entity'),
       '#description' => t('Make entity label a link to entity page.'),
diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
index 704a838..0de5b21 100644
--- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
+++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
@@ -11,6 +11,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Component\Utility\Xss;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\HandlerBase;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ResultRow;
@@ -478,7 +479,7 @@ protected function defineOptions() {
   /**
    * Performs some cleanup tasks on the options array before saving it.
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     $options = &$form_state['values']['options'];
     $types = array('element_type', 'element_label_type', 'element_wrapper_type');
     $classes = array_combine(array('element_class', 'element_label_class', 'element_wrapper_class'), $types);
@@ -505,7 +506,7 @@ public function submitOptionsForm(&$form, &$form_state) {
    * Default options form that provides the label widget that all fields
    * should have.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $label = $this->label();
diff --git a/core/modules/views/src/Plugin/views/field/FileSize.php b/core/modules/views/src/Plugin/views/field/FileSize.php
index e89a1a4..41d59ae 100644
--- a/core/modules/views/src/Plugin/views/field/FileSize.php
+++ b/core/modules/views/src/Plugin/views/field/FileSize.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 
 /**
@@ -26,7 +27,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['file_size_display'] = array(
       '#title' => t('File size display'),
diff --git a/core/modules/views/src/Plugin/views/field/Links.php b/core/modules/views/src/Plugin/views/field/Links.php
index f466bc6..a69774f 100644
--- a/core/modules/views/src/Plugin/views/field/Links.php
+++ b/core/modules/views/src/Plugin/views/field/Links.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * A abstract handler which provides a collection of links.
  *
@@ -36,7 +38,7 @@ public function defineOptions() {
   /**
    * Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     // Only show fields that precede this one.
     $field_options = $this->getPreviousFieldLabels();
diff --git a/core/modules/views/src/Plugin/views/field/MachineName.php b/core/modules/views/src/Plugin/views/field/MachineName.php
index e07da1f..ce94039 100644
--- a/core/modules/views/src/Plugin/views/field/MachineName.php
+++ b/core/modules/views/src/Plugin/views/field/MachineName.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\field;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 
 /**
@@ -52,7 +53,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['machine_name'] = array(
diff --git a/core/modules/views/src/Plugin/views/field/Numeric.php b/core/modules/views/src/Plugin/views/field/Numeric.php
index 7a4c994..fdb1306 100644
--- a/core/modules/views/src/Plugin/views/field/Numeric.php
+++ b/core/modules/views/src/Plugin/views/field/Numeric.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 
 /**
@@ -38,7 +39,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     if (!empty($this->definition['float'])) {
       $form['set_precision'] = array(
         '#type' => 'checkbox',
diff --git a/core/modules/views/src/Plugin/views/field/PrerenderList.php b/core/modules/views/src/Plugin/views/field/PrerenderList.php
index 4530423..eea08de 100644
--- a/core/modules/views/src/Plugin/views/field/PrerenderList.php
+++ b/core/modules/views/src/Plugin/views/field/PrerenderList.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Field handler to provide a list of items.
  *
@@ -40,7 +42,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['type'] = array(
       '#type' => 'radios',
       '#title' => t('Display type'),
diff --git a/core/modules/views/src/Plugin/views/field/Serialized.php b/core/modules/views/src/Plugin/views/field/Serialized.php
index aa933eb..0c54ac5 100644
--- a/core/modules/views/src/Plugin/views/field/Serialized.php
+++ b/core/modules/views/src/Plugin/views/field/Serialized.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\field;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 
 /**
@@ -27,7 +28,7 @@ protected function defineOptions() {
   }
 
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['format'] = array(
@@ -53,7 +54,7 @@ public function buildOptionsForm(&$form, &$form_state) {
     );
   }
 
-  public function validateOptionsForm(&$form, &$form_state) {
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) {
     // Require a key if the format is key.
     if ($form_state['values']['options']['format'] == 'key' && $form_state['values']['options']['key'] == '') {
       form_error($form['key'], $form_state, t('You have to enter a key if you want to display a key of the data.'));
diff --git a/core/modules/views/src/Plugin/views/field/TimeInterval.php b/core/modules/views/src/Plugin/views/field/TimeInterval.php
index 35eae0b..b0cf431 100644
--- a/core/modules/views/src/Plugin/views/field/TimeInterval.php
+++ b/core/modules/views/src/Plugin/views/field/TimeInterval.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 
 /**
@@ -26,7 +27,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['granularity'] = array(
diff --git a/core/modules/views/src/Plugin/views/field/Url.php b/core/modules/views/src/Plugin/views/field/Url.php
index 6b59c92..2eab9c5 100644
--- a/core/modules/views/src/Plugin/views/field/Url.php
+++ b/core/modules/views/src/Plugin/views/field/Url.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\field;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ResultRow;
 
 /**
@@ -29,7 +30,7 @@ protected function defineOptions() {
   /**
    * Provide link to the page being visited.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['display_as_link'] = array(
       '#title' => t('Display as link'),
       '#type' => 'checkbox',
diff --git a/core/modules/views/src/Plugin/views/filter/BooleanOperator.php b/core/modules/views/src/Plugin/views/filter/BooleanOperator.php
index 1158575..1bfc9f1 100644
--- a/core/modules/views/src/Plugin/views/filter/BooleanOperator.php
+++ b/core/modules/views/src/Plugin/views/filter/BooleanOperator.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\filter;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ViewExecutable;
 
@@ -131,7 +132,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  protected function valueForm(&$form, &$form_state) {
+  protected function valueForm(&$form, FormStateInterface &$form_state) {
     if (empty($this->value_options)) {
       // Initialize the array of possible values for this filter.
       $this->getValueOptions();
@@ -162,7 +163,7 @@ protected function valueForm(&$form, &$form_state) {
     }
   }
 
-  protected function valueValidate($form, &$form_state) {
+  protected function valueValidate($form, FormStateInterface &$form_state) {
     if (isset($form_state['values']['options']['value']) && $form_state['values']['options']['value'] == 'All' && !empty($form_state['values']['options']['expose']['required'])) {
       form_set_error('value', $form_state, t('You must select a value unless this is an non-required exposed filter.'));
     }
diff --git a/core/modules/views/src/Plugin/views/filter/Combine.php b/core/modules/views/src/Plugin/views/filter/Combine.php
index 3621378..8f3e52d 100644
--- a/core/modules/views/src/Plugin/views/filter/Combine.php
+++ b/core/modules/views/src/Plugin/views/filter/Combine.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\filter;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Filter handler which allows to search on multiple fields.
  *
@@ -28,7 +30,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $this->view->initStyle();
 
diff --git a/core/modules/views/src/Plugin/views/filter/Date.php b/core/modules/views/src/Plugin/views/filter/Date.php
index 52ea7ce..f514935 100644
--- a/core/modules/views/src/Plugin/views/filter/Date.php
+++ b/core/modules/views/src/Plugin/views/filter/Date.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\filter;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Filter to handle dates stored as a timestamp.
  *
@@ -28,7 +30,7 @@ protected function defineOptions() {
   /**
    * Add a type selector to the value form
    */
-  protected function valueForm(&$form, &$form_state) {
+  protected function valueForm(&$form, FormStateInterface &$form_state) {
     if (empty($form_state['exposed'])) {
       $form['value']['type'] = array(
         '#type' => 'radios',
@@ -43,7 +45,7 @@ protected function valueForm(&$form, &$form_state) {
     parent::valueForm($form, $form_state);
   }
 
-  public function validateOptionsForm(&$form, &$form_state) {
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::validateOptionsForm($form, $form_state);
 
     if (!empty($this->options['exposed']) && empty($form_state['values']['options']['expose']['required'])) {
@@ -54,7 +56,7 @@ public function validateOptionsForm(&$form, &$form_state) {
     $this->validateValidTime($form['value'], $form_state, $form_state['values']['options']['operator'], $form_state['values']['options']['value']);
   }
 
-  public function validateExposed(&$form, &$form_state) {
+  public function validateExposed(&$form, FormStateInterface &$form_state) {
     if (empty($this->options['exposed'])) {
       return;
     }
@@ -79,7 +81,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, FormStateInterface &$form_state, $operator, $value) {
     $operators = $this->operators();
 
     if ($operators[$operator]['values'] == 1) {
@@ -103,7 +105,7 @@ public function validateValidTime(&$form, array &$form_state, $operator, $value)
   /**
    * Validate the build group options form.
    */
-  protected function buildGroupValidate($form, &$form_state) {
+  protected function buildGroupValidate($form, FormStateInterface &$form_state) {
     // Special case to validate grouped date filters, this is because the
     // $group['value'] array contains the type of filter (date or offset)
     // and therefore the number of items the comparission has to be done
diff --git a/core/modules/views/src/Plugin/views/filter/Equality.php b/core/modules/views/src/Plugin/views/filter/Equality.php
index f0cda43..0efff8a 100644
--- a/core/modules/views/src/Plugin/views/filter/Equality.php
+++ b/core/modules/views/src/Plugin/views/filter/Equality.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\filter;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Simple filter to handle equal to / not equal to filters
  *
@@ -32,7 +34,7 @@ public function operatorOptions() {
   /**
    * Provide a simple textfield for equality
    */
-  protected function valueForm(&$form, &$form_state) {
+  protected function valueForm(&$form, FormStateInterface &$form_state) {
     $form['value'] = array(
       '#type' => 'textfield',
       '#title' => t('Value'),
diff --git a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
index 30d702d..a7e34c7 100644
--- a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
+++ b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\filter;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
 use Drupal\views\Plugin\views\HandlerBase;
 use Drupal\Component\Utility\String as UtilityString;
@@ -196,7 +197,7 @@ public function isAGroup() {
    * or to at least make sure all of the functions in this form
    * are called.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     if ($this->canExpose()) {
       $this->showExposeButton($form, $form_state);
@@ -237,7 +238,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * Simple validate handler
    */
-  public function validateOptionsForm(&$form, &$form_state) {
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) {
     $this->operatorValidate($form, $form_state);
     $this->valueValidate($form, $form_state);
     if (!empty($this->options['exposed']) && !$this->isAGroup()) {
@@ -251,7 +252,7 @@ public function validateOptionsForm(&$form, &$form_state) {
   /**
    * Simple submit handler
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     unset($form_state['values']['expose_button']); // don't store this.
     unset($form_state['values']['group_button']); // don't store this.
     if (!$this->isAGroup()) {
@@ -269,7 +270,7 @@ public function submitOptionsForm(&$form, &$form_state) {
   /**
    * Shortcut to display the operator form.
    */
-  public function showOperatorForm(&$form, &$form_state) {
+  public function showOperatorForm(&$form, FormStateInterface &$form_state) {
     $this->operatorForm($form, $form_state);
     $form['operator']['#prefix'] = '<div class="views-group-box views-left-30">';
     $form['operator']['#suffix'] = '</div>';
@@ -283,7 +284,7 @@ public function showOperatorForm(&$form, &$form_state) {
    *
    * @see buildOptionsForm()
    */
-  protected function operatorForm(&$form, &$form_state) {
+  protected function operatorForm(&$form, FormStateInterface &$form_state) {
     $options = $this->operatorOptions();
     if (!empty($options)) {
       $form['operator'] = array(
@@ -304,18 +305,18 @@ public function operatorOptions() { return array(); }
   /**
    * Validate the operator form.
    */
-  protected function operatorValidate($form, &$form_state) { }
+  protected function operatorValidate($form, FormStateInterface &$form_state) { }
 
   /**
    * Perform any necessary changes to the form values prior to storage.
    * There is no need for this function to actually store the data.
    */
-  public function operatorSubmit($form, &$form_state) { }
+  public function operatorSubmit($form, FormStateInterface &$form_state) { }
 
   /**
    * Shortcut to display the value form.
    */
-  protected function showValueForm(&$form, &$form_state) {
+  protected function showValueForm(&$form, FormStateInterface &$form_state) {
     $this->valueForm($form, $form_state);
     if (empty($this->no_operator)) {
       $form['value']['#prefix'] = '<div class="views-group-box views-right-70">' . (isset($form['value']['#prefix']) ? $form['value']['#prefix'] : '');
@@ -331,23 +332,25 @@ protected function showValueForm(&$form, &$form_state) {
    *
    * @see buildOptionsForm()
    */
-  protected function valueForm(&$form, &$form_state) { $form['value'] = array(); }
+  protected function valueForm(&$form, FormStateInterface &$form_state) {
+    $form['value'] = array();
+  }
 
   /**
    * Validate the options form.
    */
-  protected function valueValidate($form, &$form_state) { }
+  protected function valueValidate($form, FormStateInterface &$form_state) { }
 
   /**
    * Perform any necessary changes to the form values prior to storage.
    * There is no need for this function to actually store the data.
    */
-  protected function valueSubmit($form, &$form_state) { }
+  protected function valueSubmit($form, FormStateInterface &$form_state) { }
 
   /**
    * Shortcut to display the exposed options form.
    */
-  public function showBuildGroupForm(&$form, &$form_state) {
+  public function showBuildGroupForm(&$form, FormStateInterface &$form_state) {
     if (empty($this->options['is_grouped'])) {
       return;
     }
@@ -370,7 +373,7 @@ public function showBuildGroupForm(&$form, &$form_state) {
   /**
    * Shortcut to display the build_group/hide button.
    */
-  protected function showBuildGroupButton(&$form, &$form_state) {
+  protected function showBuildGroupButton(&$form, FormStateInterface &$form_state) {
 
     $form['group_button'] = array(
       '#prefix' => '<div class="views-grouped clearfix">',
@@ -422,7 +425,7 @@ protected function showBuildGroupButton(&$form, &$form_state) {
   /**
    * Displays the Build Group form.
    */
-  public function buildGroupForm($form, &$form_state) {
+  public function buildGroupForm($form, FormStateInterface &$form_state) {
     $item = &$this->options;
     // flip. If the filter was a group, set back to a standard filter.
     $item['is_grouped'] = empty($item['is_grouped']);
@@ -445,7 +448,7 @@ public function buildGroupForm($form, &$form_state) {
   /**
    * Shortcut to display the expose/hide button.
    */
-  public function showExposeButton(&$form, &$form_state) {
+  public function showExposeButton(&$form, FormStateInterface &$form_state) {
     $form['expose_button'] = array(
       '#prefix' => '<div class="views-expose clearfix">',
       '#suffix' => '</div>',
@@ -498,7 +501,7 @@ public function showExposeButton(&$form, &$form_state) {
    *
    * @see buildOptionsForm()
    */
-  public function buildExposeForm(&$form, &$form_state) {
+  public function buildExposeForm(&$form, FormStateInterface &$form_state) {
     $form['#theme'] = 'views_ui_expose_filter_form';
     // #flatten will move everything from $form['expose'][$key] to $form[$key]
     // prior to rendering. That's why the preRender for it needs to run first,
@@ -608,7 +611,7 @@ public function buildExposeForm(&$form, &$form_state) {
   /**
    * Validate the options form.
    */
-  public function validateExposeForm($form, &$form_state) {
+  public function validateExposeForm($form, FormStateInterface &$form_state) {
     if (empty($form_state['values']['options']['expose']['identifier'])) {
       form_error($form['expose']['identifier'], $form_state, t('The identifier is required if the filter is exposed.'));
     }
@@ -625,7 +628,7 @@ public function validateExposeForm($form, &$form_state) {
   /**
    * Validate the build group options form.
    */
-  protected function buildGroupValidate($form, &$form_state) {
+  protected function buildGroupValidate($form, FormStateInterface &$form_state) {
     if (!empty($form_state['values']['options']['group_info'])) {
       if (empty($form_state['values']['options']['group_info']['identifier'])) {
         form_error($form['group_info']['identifier'], $form_state, t('The identifier is required if the filter is exposed.'));
@@ -671,7 +674,7 @@ protected function buildGroupValidate($form, &$form_state) {
   /**
    * Save new group items, re-enumerates and remove groups marked to delete.
    */
-  protected function buildGroupSubmit($form, &$form_state) {
+  protected function buildGroupSubmit($form, FormStateInterface &$form_state) {
     $groups = array();
     uasort($form_state['values']['options']['group_info']['group_items'], array('Drupal\Component\Utility\SortArray', 'sortByWeightElement'));
     // Filter out removed items.
@@ -739,7 +742,7 @@ protected function buildGroupOptions() {
    * Build a form containing a group of operator | values to apply as a
    * single filter.
    */
-  public function groupForm(&$form, &$form_state) {
+  public function groupForm(&$form, FormStateInterface &$form_state) {
     if (!empty($this->options['group_info']['optional']) && !$this->multipleExposedInput()) {
       $groups = array('All' => t('- Any -'));
     }
@@ -783,7 +786,7 @@ public function groupForm(&$form, &$form_state) {
    *
    * You can override this if it doesn't do what you expect.
    */
-  public function buildExposedForm(&$form, &$form_state) {
+  public function buildExposedForm(&$form, FormStateInterface &$form_state) {
     if (empty($this->options['exposed'])) {
       return;
     }
@@ -829,7 +832,7 @@ public function buildExposedForm(&$form, &$form_state) {
    * Build the form to let users create the group of exposed filters.
    * This form is displayed when users click on button 'Build group'
    */
-  protected function buildExposedFiltersGroupForm(&$form, &$form_state) {
+  protected function buildExposedFiltersGroupForm(&$form, FormStateInterface &$form_state) {
     if (empty($this->options['exposed']) || empty($this->options['is_grouped'])) {
       return;
     }
@@ -1092,7 +1095,7 @@ protected function buildExposedFiltersGroupForm(&$form, &$form_state) {
   /**
    * Add a new group to the exposed filter groups.
    */
-  public function addGroupForm($form, &$form_state) {
+  public function addGroupForm($form, FormStateInterface &$form_state) {
     $item = &$this->options;
 
     // Add a new row.
diff --git a/core/modules/views/src/Plugin/views/filter/InOperator.php b/core/modules/views/src/Plugin/views/filter/InOperator.php
index 1902b3b..93fed6c 100644
--- a/core/modules/views/src/Plugin/views/filter/InOperator.php
+++ b/core/modules/views/src/Plugin/views/filter/InOperator.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\String as UtilityString;
 use Drupal\Component\Utility\Unicode;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ViewExecutable;
 
@@ -79,7 +80,7 @@ public function defaultExposeOptions() {
     $this->options['expose']['reduce'] = FALSE;
   }
 
-  public function buildExposeForm(&$form, &$form_state) {
+  public function buildExposeForm(&$form, FormStateInterface &$form_state) {
     parent::buildExposeForm($form, $form_state);
     $form['expose']['reduce'] = array(
       '#type' => 'checkbox',
@@ -165,7 +166,7 @@ protected function operatorValues($values = 1) {
     return $options;
   }
 
-  protected function valueForm(&$form, &$form_state) {
+  protected function valueForm(&$form, FormStateInterface &$form_state) {
     $form['value'] = array();
     $options = array();
 
@@ -295,7 +296,7 @@ public function acceptExposedInput($input) {
     return parent::acceptExposedInput($input);
   }
 
-  protected function valueSubmit($form, &$form_state) {
+  protected function valueSubmit($form, FormStateInterface &$form_state) {
     // Drupal's FAPI system automatically puts '0' in for any checkbox that
     // was not set, and the key to the checkbox if it is set.
     // Unfortunately, this means that if the key to that checkbox is 0,
diff --git a/core/modules/views/src/Plugin/views/filter/ManyToOne.php b/core/modules/views/src/Plugin/views/filter/ManyToOne.php
index a399964..da7b8bb 100644
--- a/core/modules/views/src/Plugin/views/filter/ManyToOne.php
+++ b/core/modules/views/src/Plugin/views/filter/ManyToOne.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\filter;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ManyToOneHelper;
@@ -107,7 +108,7 @@ function operators() {
   }
 
   protected $valueFormType = 'select';
-  protected function valueForm(&$form, &$form_state) {
+  protected function valueForm(&$form, FormStateInterface &$form_state) {
     parent::valueForm($form, $form_state);
 
     if (empty($form_state['exposed'])) {
diff --git a/core/modules/views/src/Plugin/views/filter/Numeric.php b/core/modules/views/src/Plugin/views/filter/Numeric.php
index 53b94fa..6b015fd 100644
--- a/core/modules/views/src/Plugin/views/filter/Numeric.php
+++ b/core/modules/views/src/Plugin/views/filter/Numeric.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\String as UtilityString;
 use Drupal\Core\Database\Database;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Simple filter to handle greater than/less than filters
@@ -139,7 +140,7 @@ protected function operatorValues($values = 1) {
   /**
    * Provide a simple textfield for equality
    */
-  protected function valueForm(&$form, &$form_state) {
+  protected function valueForm(&$form, FormStateInterface &$form_state) {
     $form['value']['#tree'] = TRUE;
 
     // We have to make some choices when creating this as an exposed
diff --git a/core/modules/views/src/Plugin/views/filter/String.php b/core/modules/views/src/Plugin/views/filter/String.php
index ea1b3fe..a093aea 100644
--- a/core/modules/views/src/Plugin/views/filter/String.php
+++ b/core/modules/views/src/Plugin/views/filter/String.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\String as UtilityString;
 use Drupal\Core\Database\Database;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Basic textfield filter to handle string filtering commands
@@ -183,7 +184,7 @@ protected function operatorValues($values = 1) {
   /**
    * Provide a simple textfield for equality
    */
-  protected function valueForm(&$form, &$form_state) {
+  protected function valueForm(&$form, FormStateInterface &$form_state) {
     // We have to make some choices when creating this as an exposed
     // filter form. For example, if the operator is locked and thus
     // not rendered, we can't render dependencies; instead we only
diff --git a/core/modules/views/src/Plugin/views/pager/Full.php b/core/modules/views/src/Plugin/views/pager/Full.php
index fda4c4e..df625d7 100644
--- a/core/modules/views/src/Plugin/views/pager/Full.php
+++ b/core/modules/views/src/Plugin/views/pager/Full.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\pager;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * The plugin to handle full pager.
  *
@@ -41,7 +43,7 @@ protected function defineOptions() {
   /**
    * Overrides \Drupal\views\Plugin\views\SqlBase::buildOptionsForm().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['quantity'] = array(
diff --git a/core/modules/views/src/Plugin/views/pager/None.php b/core/modules/views/src/Plugin/views/pager/None.php
index e5ccad3..115686a 100644
--- a/core/modules/views/src/Plugin/views/pager/None.php
+++ b/core/modules/views/src/Plugin/views/pager/None.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\pager;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 
@@ -51,7 +52,7 @@ protected function defineOptions() {
   /**
    * Provide the default form for setting options.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['offset'] = array(
       '#type' => 'textfield',
diff --git a/core/modules/views/src/Plugin/views/pager/PagerPluginBase.php b/core/modules/views/src/Plugin/views/pager/PagerPluginBase.php
index e056969..da54f33 100644
--- a/core/modules/views/src/Plugin/views/pager/PagerPluginBase.php
+++ b/core/modules/views/src/Plugin/views/pager/PagerPluginBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\pager;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\PluginBase;
 use Drupal\views\ViewExecutable;
 
@@ -119,12 +120,12 @@ public function getPagerId() {
   /**
    * Provide the default form form for validating options
    */
-  public function validateOptionsForm(&$form, &$form_state) { }
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Provide the default form form for submitting options
    */
-  public function submitOptionsForm(&$form, &$form_state) { }
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Return a string to display as the clickable title for the
@@ -216,11 +217,11 @@ public function hasMoreRecords() {
       && $this->total_items > (intval($this->current_page) + 1) * $this->getItemsPerPage();
   }
 
-  public function exposedFormAlter(&$form, &$form_state) { }
+  public function exposedFormAlter(&$form, FormStateInterface &$form_state) { }
 
-  public function exposedFormValidate(&$form, &$form_state) { }
+  public function exposedFormValidate(&$form, FormStateInterface &$form_state) { }
 
-  public function exposedFormSubmit(&$form, &$form_state, &$exclude) { }
+  public function exposedFormSubmit(&$form, FormStateInterface &$form_state, &$exclude) { }
 
   public function usesExposed() {
     return FALSE;
diff --git a/core/modules/views/src/Plugin/views/pager/Some.php b/core/modules/views/src/Plugin/views/pager/Some.php
index ded554f..d08efdb 100644
--- a/core/modules/views/src/Plugin/views/pager/Some.php
+++ b/core/modules/views/src/Plugin/views/pager/Some.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\pager;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Plugin for views without pagers.
  *
@@ -39,7 +41,7 @@ protected function defineOptions() {
   /**
    * Provide the default form for setting options.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $pager_text = $this->displayHandler->getPagerText();
     $form['items_per_page'] = array(
diff --git a/core/modules/views/src/Plugin/views/pager/SqlBase.php b/core/modules/views/src/Plugin/views/pager/SqlBase.php
index 7aeb69e..7a30bc8 100644
--- a/core/modules/views/src/Plugin/views/pager/SqlBase.php
+++ b/core/modules/views/src/Plugin/views/pager/SqlBase.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\pager;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * A common base class for sql based pager.
  */
@@ -42,7 +44,7 @@ protected function defineOptions() {
   /**
    * Provide the default form for setting options.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $pager_text = $this->displayHandler->getPagerText();
     $form['items_per_page'] = array(
@@ -176,7 +178,7 @@ public function buildOptionsForm(&$form, &$form_state) {
     );
   }
 
-  public function validateOptionsForm(&$form, &$form_state) {
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) {
     // Only accept integer values.
     $error = FALSE;
     $exposed_options = $form_state['values']['pager_options']['expose']['items_per_page_options'];
@@ -335,7 +337,7 @@ protected function isOffsetExposed() {
     return !empty($this->options['expose']['offset']);
   }
 
-  public function exposedFormAlter(&$form, &$form_state) {
+  public function exposedFormAlter(&$form, FormStateInterface &$form_state) {
     if ($this->itemsPerPageExposed()) {
       $options = explode(',', $this->options['expose']['items_per_page_options']);
       $sanitized_options = array();
@@ -366,7 +368,7 @@ public function exposedFormAlter(&$form, &$form_state) {
     }
   }
 
-  public function exposedFormValidate(&$form, &$form_state) {
+  public function exposedFormValidate(&$form, FormStateInterface &$form_state) {
     if (!empty($form_state['values']['offset']) && trim($form_state['values']['offset'])) {
       if (!is_numeric($form_state['values']['offset']) || $form_state['values']['offset'] < 0) {
         form_set_error('offset', $form_state, t('Offset must be an number greather or equal than 0.'));
diff --git a/core/modules/views/src/Plugin/views/query/QueryPluginBase.php b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php
index 0a9e7e9..6752eb4 100644
--- a/core/modules/views/src/Plugin/views/query/QueryPluginBase.php
+++ b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\query;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\PluginBase;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ViewExecutable;
@@ -108,9 +109,9 @@ public function addSignature(ViewExecutable $view) { }
    */
   public function getAggregationInfo() { }
 
-  public function validateOptionsForm(&$form, &$form_state) { }
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) { }
 
-  public function submitOptionsForm(&$form, &$form_state) { }
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   public function summaryTitle() {
     return t('Settings');
diff --git a/core/modules/views/src/Plugin/views/query/Sql.php b/core/modules/views/src/Plugin/views/query/Sql.php
index 6e2f188..a653eca 100644
--- a/core/modules/views/src/Plugin/views/query/Sql.php
+++ b/core/modules/views/src/Plugin/views/query/Sql.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Database\Database;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\Core\Database\DatabaseExceptionWrapper;
 use Drupal\views\Plugin\views\join\JoinPluginBase;
@@ -200,7 +201,7 @@ protected function defineOptions() {
   /**
    * Add settings for the ui.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['disable_sql_rewrite'] = array(
@@ -240,7 +241,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * Special submit handling.
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     $element = array('#parents' => array('query', 'options', 'query_tags'));
     $value = explode(',', NestedArray::getValue($form_state['values'], $element['#parents']));
     $value = array_filter(array_map('trim', $value));
diff --git a/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
index 7a85bbc..e0eac22 100644
--- a/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
+++ b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\relationship;
 
 use Drupal\Core\Database\Query\AlterableInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Views;
 
 /**
@@ -81,7 +82,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     // Get the sorts that apply to our base.
@@ -168,7 +169,7 @@ protected function getTemporaryView() {
   /**
    * When the form is submitted, make sure to clear the subquery string cache.
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     $cid = 'views_relationship_groupwise_max:' . $this->view->storage->id() . ':' . $this->view->current_display . ':' . $this->options['id'];
     \Drupal::cache('views_results')->delete($cid);
   }
diff --git a/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php b/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php
index 07f12ac..5963642 100644
--- a/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php
+++ b/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\relationship;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\HandlerBase;
@@ -104,7 +105,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     unset($form['admin_label']['#fieldset']);
diff --git a/core/modules/views/src/Plugin/views/row/EntityRow.php b/core/modules/views/src/Plugin/views/row/EntityRow.php
index c46d354..f1fcef0 100644
--- a/core/modules/views/src/Plugin/views/row/EntityRow.php
+++ b/core/modules/views/src/Plugin/views/row/EntityRow.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Core\DependencyInjection\Container;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ViewExecutable;
@@ -125,7 +126,7 @@ protected function defineOptions() {
   /**
    * Overrides Drupal\views\Plugin\views\row\RowPluginBase::buildOptionsForm().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['view_mode'] = array(
diff --git a/core/modules/views/src/Plugin/views/row/Fields.php b/core/modules/views/src/Plugin/views/row/Fields.php
index d49b213..0f0b579 100644
--- a/core/modules/views/src/Plugin/views/row/Fields.php
+++ b/core/modules/views/src/Plugin/views/row/Fields.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\row;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * The basic 'fields' row plugin
  *
@@ -45,7 +47,7 @@ protected function defineOptions() {
   /**
    * Provide a form for setting options.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $options = $this->displayHandler->getFieldLabels();
 
@@ -99,7 +101,7 @@ public function buildOptionsForm(&$form, &$form_state) {
    * Perform any necessary changes to the form values prior to storage.
    * There is no need for this function to actually store the data.
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     $form_state['values']['row_options']['inline'] = array_filter($form_state['values']['row_options']['inline']);
   }
 
diff --git a/core/modules/views/src/Plugin/views/row/OpmlFields.php b/core/modules/views/src/Plugin/views/row/OpmlFields.php
index 2274f66..42d8713 100644
--- a/core/modules/views/src/Plugin/views/row/OpmlFields.php
+++ b/core/modules/views/src/Plugin/views/row/OpmlFields.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\row;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Renders an OPML item based on fields.
  *
@@ -46,7 +48,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $initial_labels = array('' => $this->t('- None -'));
diff --git a/core/modules/views/src/Plugin/views/row/RowPluginBase.php b/core/modules/views/src/Plugin/views/row/RowPluginBase.php
index 5211136..fb4cb2a 100644
--- a/core/modules/views/src/Plugin/views/row/RowPluginBase.php
+++ b/core/modules/views/src/Plugin/views/row/RowPluginBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\row;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\PluginBase;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Views;
@@ -78,7 +79,7 @@ protected function defineOptions() {
   /**
    * Provide a form for setting options.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     if (isset($this->base_table)) {
       $executable = $form_state['view']->getExecutable();
@@ -127,13 +128,13 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * Validate the options form.
    */
-  public function validateOptionsForm(&$form, &$form_state) { }
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Perform any necessary changes to the form values prior to storage.
    * There is no need for this function to actually store the data.
    */
-  public function submitOptionsForm(&$form, &$form_state) { }
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) { }
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/views/src/Plugin/views/row/RssFields.php b/core/modules/views/src/Plugin/views/row/RssFields.php
index b59b72e..1321195 100644
--- a/core/modules/views/src/Plugin/views/row/RssFields.php
+++ b/core/modules/views/src/Plugin/views/row/RssFields.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\row;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Renders an RSS item based on fields.
  *
@@ -39,7 +41,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $initial_labels = array('' => t('- None -'));
diff --git a/core/modules/views/src/Plugin/views/sort/Date.php b/core/modules/views/src/Plugin/views/sort/Date.php
index 558321d..0fdb99b 100644
--- a/core/modules/views/src/Plugin/views/sort/Date.php
+++ b/core/modules/views/src/Plugin/views/sort/Date.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\sort;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Basic sort handler for dates.
  *
@@ -25,7 +27,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['granularity'] = array(
diff --git a/core/modules/views/src/Plugin/views/sort/MenuHierarchy.php b/core/modules/views/src/Plugin/views/sort/MenuHierarchy.php
index 2d8a5fc..49a0bba 100644
--- a/core/modules/views/src/Plugin/views/sort/MenuHierarchy.php
+++ b/core/modules/views/src/Plugin/views/sort/MenuHierarchy.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\sort;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Views;
 
 /**
@@ -28,7 +29,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['sort_within_level'] = array(
       '#type' => 'checkbox',
diff --git a/core/modules/views/src/Plugin/views/sort/Random.php b/core/modules/views/src/Plugin/views/sort/Random.php
index ebce478..6625dfc 100644
--- a/core/modules/views/src/Plugin/views/sort/Random.php
+++ b/core/modules/views/src/Plugin/views/sort/Random.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\sort;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Handle a random sort.
  *
@@ -25,7 +27,7 @@ public function query() {
     $this->query->addOrderBy('rand');
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['order']['#access'] = FALSE;
   }
diff --git a/core/modules/views/src/Plugin/views/sort/SortPluginBase.php b/core/modules/views/src/Plugin/views/sort/SortPluginBase.php
index dd6e72e..71b03f6 100644
--- a/core/modules/views/src/Plugin/views/sort/SortPluginBase.php
+++ b/core/modules/views/src/Plugin/views/sort/SortPluginBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\sort;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\HandlerBase;
 
 /**
@@ -77,7 +78,7 @@ public function adminSummary() {
   /**
    * Basic options for all sort criteria
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     if ($this->canExpose()) {
       $this->showExposeButton($form, $form_state);
@@ -93,7 +94,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * Shortcut to display the expose/hide button.
    */
-  public function showExposeButton(&$form, &$form_state) {
+  public function showExposeButton(&$form, FormStateInterface &$form_state) {
     $form['expose_button'] = array(
       '#prefix' => '<div class="views-expose clearfix">',
       '#suffix' => '</div>',
@@ -144,7 +145,7 @@ public function showExposeButton(&$form, &$form_state) {
   /**
    * Simple validate handler
    */
-  public function validateOptionsForm(&$form, &$form_state) {
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) {
     $this->sortValidate($form, $form_state);
     if (!empty($this->options['exposed'])) {
       $this->validateExposeForm($form, $form_state);
@@ -155,7 +156,7 @@ public function validateOptionsForm(&$form, &$form_state) {
   /**
    * Simple submit handler
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     unset($form_state['values']['expose_button']); // don't store this.
     $this->sortSubmit($form, $form_state);
     if (!empty($this->options['exposed'])) {
@@ -166,7 +167,7 @@ public function submitOptionsForm(&$form, &$form_state) {
   /**
    * Shortcut to display the value form.
    */
-  protected function showSortForm(&$form, &$form_state) {
+  protected function showSortForm(&$form, FormStateInterface &$form_state) {
     $options = $this->sortOptions();
     if (!empty($options)) {
       $form['order'] = array(
@@ -178,9 +179,9 @@ protected function showSortForm(&$form, &$form_state) {
     }
   }
 
-  protected function sortValidate(&$form, &$form_state) { }
+  protected function sortValidate(&$form, FormStateInterface &$form_state) { }
 
-  public function sortSubmit(&$form, &$form_state) { }
+  public function sortSubmit(&$form, FormStateInterface &$form_state) { }
 
   /**
    * Provide a list of options for the default sort form.
@@ -193,7 +194,7 @@ protected function sortOptions() {
     );
   }
 
-  public function buildExposeForm(&$form, &$form_state) {
+  public function buildExposeForm(&$form, FormStateInterface &$form_state) {
     // #flatten will move everything from $form['expose'][$key] to $form[$key]
     // prior to rendering. That's why the preRender for it needs to run first,
     // so that when the next preRender (the one for fieldsets) runs, it gets
diff --git a/core/modules/views/src/Plugin/views/style/DefaultSummary.php b/core/modules/views/src/Plugin/views/style/DefaultSummary.php
index 693c02a..dbbdc5b 100644
--- a/core/modules/views/src/Plugin/views/style/DefaultSummary.php
+++ b/core/modules/views/src/Plugin/views/style/DefaultSummary.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\style;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\style\StylePluginBase;
 
 /**
@@ -41,7 +42,7 @@ public function query() {
     }
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     $form['base_path'] = array(
       '#type' => 'textfield',
       '#title' => t('Base path'),
diff --git a/core/modules/views/src/Plugin/views/style/Grid.php b/core/modules/views/src/Plugin/views/style/Grid.php
index 11918f7..1793617 100644
--- a/core/modules/views/src/Plugin/views/style/Grid.php
+++ b/core/modules/views/src/Plugin/views/style/Grid.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\style;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Style plugin to render each item in a grid cell.
  *
@@ -47,7 +49,7 @@ protected function defineOptions() {
   /**
    * {@inheritdoc}
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['columns'] = array(
       '#type' => 'number',
diff --git a/core/modules/views/src/Plugin/views/style/HtmlList.php b/core/modules/views/src/Plugin/views/style/HtmlList.php
index 9d18903..5979f67 100644
--- a/core/modules/views/src/Plugin/views/style/HtmlList.php
+++ b/core/modules/views/src/Plugin/views/style/HtmlList.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\style;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Style plugin to render each item in an ordered or unordered list.
  *
@@ -52,7 +54,7 @@ protected function defineOptions() {
   /**
    * Render the given style.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['type'] = array(
       '#type' => 'radios',
diff --git a/core/modules/views/src/Plugin/views/style/Mapping.php b/core/modules/views/src/Plugin/views/style/Mapping.php
index 101d32f..e79147b 100644
--- a/core/modules/views/src/Plugin/views/style/Mapping.php
+++ b/core/modules/views/src/Plugin/views/style/Mapping.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\style;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Allows fields to be mapped to specific use cases.
  *
@@ -70,7 +72,7 @@ protected function defineOptions() {
   /**
    * Overrides Drupal\views\Plugin\views\style\StylePluginBase::buildOptionsForm().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     // Get the mapping.
diff --git a/core/modules/views/src/Plugin/views/style/Rss.php b/core/modules/views/src/Plugin/views/style/Rss.php
index 0a6f8cb..4ad2c1a 100644
--- a/core/modules/views/src/Plugin/views/style/Rss.php
+++ b/core/modules/views/src/Plugin/views/style/Rss.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\style;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * Default style plugin to render an RSS feed.
  *
@@ -72,7 +74,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['description'] = array(
diff --git a/core/modules/views/src/Plugin/views/style/StylePluginBase.php b/core/modules/views/src/Plugin/views/style/StylePluginBase.php
index c02cb1c..4beddbe 100644
--- a/core/modules/views/src/Plugin/views/style/StylePluginBase.php
+++ b/core/modules/views/src/Plugin/views/style/StylePluginBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\style;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\PluginBase;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\wizard\WizardInterface;
@@ -244,7 +245,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     // Only fields-based views can handle grouping.  Style plugins can also exclude
     // themselves from being groupable by setting their "usesGrouping" property
@@ -335,7 +336,7 @@ public function buildOptionsForm(&$form, &$form_state) {
     }
   }
 
-  public function validateOptionsForm(&$form, &$form_state) {
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) {
     // Don't run validation on style plugins without the grouping setting.
     if (isset($form_state['values']['style_options']['grouping'])) {
       // Don't save grouping if no field is specified.
@@ -352,12 +353,12 @@ 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.
    */
-  public function wizardForm(&$form, &$form_state, $type) {
+  public function wizardForm(&$form, FormStateInterface &$form_state, $type) {
   }
 
   /**
@@ -365,8 +366,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
@@ -375,7 +376,7 @@ public function wizardForm(&$form, &$form_state, $type) {
    * @param string $display_type
    *   The display type, either block or page.
    */
-  public function wizardSubmit(&$form, &$form_state, WizardInterface $wizard, &$display_options, $display_type) {
+  public function wizardSubmit(&$form, FormStateInterface &$form_state, WizardInterface $wizard, &$display_options, $display_type) {
   }
 
   /**
diff --git a/core/modules/views/src/Plugin/views/style/Table.php b/core/modules/views/src/Plugin/views/style/Table.php
index 789857e..4875937 100644
--- a/core/modules/views/src/Plugin/views/style/Table.php
+++ b/core/modules/views/src/Plugin/views/style/Table.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\style;
 
 use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\wizard\WizardInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\Request;
@@ -196,7 +197,7 @@ public function sanitizeColumns($columns, $fields = NULL) {
   /**
    * Render the given style.
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $handlers = $this->displayHandler->getHandlers('field');
     if (empty($handlers)) {
@@ -411,7 +412,7 @@ public function evenEmpty() {
     return parent::evenEmpty() || !empty($this->options['empty_table']);
   }
 
-  public function wizardSubmit(&$form, &$form_state, WizardInterface $wizard, &$display_options, $display_type) {
+  public function wizardSubmit(&$form, FormStateInterface &$form_state, WizardInterface $wizard, &$display_options, $display_type) {
     // If any of the displays use the table style, make sure that the fields
     // always have a labels by unsetting the override.
     foreach ($display_options['default']['fields'] as &$field) {
diff --git a/core/modules/views/src/Plugin/views/style/UnformattedSummary.php b/core/modules/views/src/Plugin/views/style/UnformattedSummary.php
index 3c7d47b..1217ced 100644
--- a/core/modules/views/src/Plugin/views/style/UnformattedSummary.php
+++ b/core/modules/views/src/Plugin/views/style/UnformattedSummary.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Plugin\views\style;
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * The default style plugin for summaries.
  *
@@ -29,7 +31,7 @@ protected function defineOptions() {
     return $options;
   }
 
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $form['inline'] = array(
       '#type' => 'checkbox',
diff --git a/core/modules/views/src/Plugin/views/wizard/WizardInterface.php b/core/modules/views/src/Plugin/views/wizard/WizardInterface.php
index 6e1a548..ea72aea 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..5117f74 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);
@@ -608,7 +609,7 @@ protected function buildFilters(&$form, &$form_state) {
    *
    * By default, this adds a "sorted by [date]" filter (when it is available).
    */
-  protected function buildSorts(&$form, &$form_state) {
+  protected function buildSorts(&$form, FormStateInterface &$form_state) {
     $sorts = array(
       'none' => t('Unsorted'),
     );
@@ -641,7 +642,7 @@ protected function buildSorts(&$form, &$form_state) {
    * @return \Drupal\views_ui\ViewUI
    *   The instantiated view UI object.
    */
-  protected function instantiateView($form, &$form_state) {
+  protected function instantiateView($form, FormStateInterface &$form_state) {
     // Build the basic view properties and create the view.
     $values = array(
       'id' => $form_state['values']['id'],
@@ -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, FormStateInterface &$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, FormStateInterface &$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, FormStateInterface &$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, FormStateInterface &$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/Handler/AreaEntityTest.php b/core/modules/views/src/Tests/Handler/AreaEntityTest.php
index ac62de1..f66a137 100644
--- a/core/modules/views/src/Tests/Handler/AreaEntityTest.php
+++ b/core/modules/views/src/Tests/Handler/AreaEntityTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Tests\Handler;
 
 use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Form\FormState;
 use Drupal\views\Tests\ViewTestBase;
 use Drupal\views\Views;
 
@@ -121,7 +122,7 @@ public function testEntityArea() {
 
     // Test the available view mode options.
     $form = array();
-    $form_state = array();
+    $form_state = new FormState();
     $form_state['type'] = 'header';
     $view->display_handler->getHandler('header', 'entity_entity_test')->buildOptionsForm($form, $form_state);
     $this->assertTrue(isset($form['view_mode']['#options']['test']), 'Ensure that the test view mode is available.');
diff --git a/core/modules/views/src/Tests/Plugin/RowEntityTest.php b/core/modules/views/src/Tests/Plugin/RowEntityTest.php
index e422d96..6111f42 100644
--- a/core/modules/views/src/Tests/Plugin/RowEntityTest.php
+++ b/core/modules/views/src/Tests/Plugin/RowEntityTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests\Plugin;
 
+use Drupal\Core\Form\FormState;
 use Drupal\views\Views;
 use Drupal\views\Tests\ViewUnitTestBase;
 
@@ -59,7 +60,7 @@ public function testEntityRow() {
 
     // Tests the available view mode options.
     $form = array();
-    $form_state = array();
+    $form_state = new FormState();
     $form_state['view'] = $view->storage;
     $view->rowPlugin->buildOptionsForm($form, $form_state);
 
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..a465a5e 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/tests/modules/views_test_data/src/Plugin/views/area/TestExample.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/area/TestExample.php
index 93254b8..3ef464b 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/area/TestExample.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/area/TestExample.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_test_data\Plugin\views\area;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\area\AreaPluginBase;
 
 /**
@@ -31,7 +32,7 @@ public function defineOptions() {
   /**
    * Overrides Drupal\views\Plugin\views\area\AreaPluginBase::buildOptionsForm()
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $this->globalTokenForm($form, $form_state);
   }
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display/DisplayTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display/DisplayTest.php
index 1447c67..b03b282 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display/DisplayTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display/DisplayTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\views_test_data\Plugin\views\display;
 
 use Drupal\Component\Utility\Xss;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 
 /**
@@ -74,7 +75,7 @@ public function optionsSummary(&$categories, &$options) {
   /**
    * Overrides Drupal\views\Plugin\views\display\DisplayPluginBase::buildOptionsForm().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     switch ($form_state['section']) {
@@ -93,7 +94,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * Overrides Drupal\views\Plugin\views\display\DisplayPluginBase::validateOptionsForm().
    */
-  public function validateOptionsForm(&$form, &$form_state) {
+  public function validateOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::validateOptionsForm($form, $form_state);
     watchdog('views', $form_state['values']['test_option']);
     switch ($form_state['section']) {
@@ -108,7 +109,7 @@ public function validateOptionsForm(&$form, &$form_state) {
   /**
    * Overrides Drupal\views\Plugin\views\display\DisplayPluginBase::submitOptionsForm().
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::submitOptionsForm($form, $form_state);
     switch ($form_state['section']) {
       case 'test_option':
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display_extender/DisplayExtenderTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display_extender/DisplayExtenderTest.php
index b13a2f8..05a797b 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display_extender/DisplayExtenderTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display_extender/DisplayExtenderTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_test_data\Plugin\views\display_extender;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\display_extender\DisplayExtenderPluginBase;
 
 /**
@@ -61,7 +62,7 @@ public function optionsSummary(&$categories, &$options) {
   /**
    * Overrides Drupal\views\Plugin\views\display_extender\DisplayExtenderPluginBase::buildOptionsForm().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     switch ($form_state['section']) {
       case 'test_extender_test_option':
         $form['#title'] .= t('Test option');
@@ -77,7 +78,7 @@ public function buildOptionsForm(&$form, &$form_state) {
   /**
    * Overrides Drupal\views\Plugin\views\display\DisplayExtenderPluginBase::submitOptionsForm().
    */
-  public function submitOptionsForm(&$form, &$form_state) {
+  public function submitOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::submitOptionsForm($form, $form_state);
     switch ($form_state['section']) {
       case 'test_extender_test_option':
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/filter/FilterTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/filter/FilterTest.php
index 3abcc16..6d3d02d 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/filter/FilterTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/filter/FilterTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_test_data\Plugin\views\filter;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\filter\FilterPluginBase;
 
 /**
@@ -31,7 +32,7 @@ protected function defineOptions() {
    *
    * @return array
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['test_enable'] = array(
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php
index 77a9607..82e8171 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_test_data\Plugin\views\query;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\query\QueryPluginBase;
 use Drupal\views\Plugin\views\join\JoinPluginBase;
 use Drupal\views\ViewExecutable;
@@ -39,7 +40,7 @@ protected function defineOptions() {
   /**
    * Implements \Drupal\views\Plugin\views\query\QueryPluginBase::buildOptionsForm().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['test_setting'] = array(
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/row/RowTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/row/RowTest.php
index e6edd02..43ed255 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/row/RowTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/row/RowTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_test_data\Plugin\views\row;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\row\RowPluginBase;
 
 /**
@@ -44,7 +45,7 @@ protected function defineOptions() {
   /**
    * Overrides Drupal\views\Plugin\views\row\RowPluginBase::buildOptionsForm().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['test_option'] = array(
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTest.php
index 02dd245..b1eef49 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_test_data\Plugin\views\style;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\style\StylePluginBase;
 
 /**
@@ -52,7 +53,7 @@ protected function defineOptions() {
   /**
    * Overrides Drupal\views\Plugin\views\style\StylePluginBase::buildOptionsForm().
    */
-  public function buildOptionsForm(&$form, &$form_state) {
+  public function buildOptionsForm(&$form, FormStateInterface &$form_state) {
     parent::buildOptionsForm($form, $form_state);
 
     $form['test_option'] = array(
diff --git a/core/modules/views/views.module b/core/modules/views/views.module
index 745d397..bba1bb2 100644
--- a/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -12,6 +12,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Database\Query\AlterableInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Routing\RouteMatchInterface;
@@ -917,7 +918,7 @@ function views_pre_render_views_form_views_form($element) {
  * Since the exposed form is a GET form, we don't want it to send a wide
  * variety of information.
  */
-function views_form_views_exposed_form_alter(&$form, &$form_state) {
+function views_form_views_exposed_form_alter(&$form, FormStateInterface &$form_state) {
   $form['form_build_id']['#access'] = FALSE;
   $form['form_token']['#access'] = FALSE;
   $form['form_id']['#access'] = FALSE;
@@ -1052,7 +1053,7 @@ function views_get_view_result($name, $display_id = NULL) {
 /**
  * Validation callback for query tags.
  */
-function views_element_validate_tags($element, &$form_state) {
+function views_element_validate_tags($element, FormStateInterface &$form_state) {
   $values = array_map('trim', explode(',', $element['#value']));
   foreach ($values as $value) {
     if (preg_match("/[^a-z_]/", $value)) {
diff --git a/core/modules/views_ui/admin.inc b/core/modules/views_ui/admin.inc
index e90ef35..1f6e31c 100644
--- a/core/modules/views_ui/admin.inc
+++ b/core/modules/views_ui/admin.inc
@@ -7,6 +7,7 @@
 
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Component\Utility\Tags;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Views;
 
@@ -120,7 +121,7 @@ function views_ui_add_ajax_trigger(&$wrapping_element, $trigger_key, $refresh_pa
 /**
  * Processes a non-JavaScript fallback submit button to limit its validation errors.
  */
-function views_ui_add_limited_validation($element, &$form_state) {
+function views_ui_add_limited_validation($element, FormStateInterface &$form_state) {
   // Retrieve the AJAX triggering element so we can determine its parents. (We
   // know it's at the same level of the complete form array as the submit
   // button, so all we have to do to find it is swap out the submit button's
@@ -158,7 +159,7 @@ function views_ui_add_limited_validation($element, &$form_state) {
  * be refreshed by AJAX, based on information stored in the corresponding
  * submit button form element.
  */
-function views_ui_add_ajax_wrapper($element, &$form_state) {
+function views_ui_add_ajax_wrapper($element, FormStateInterface &$form_state) {
   // Don't add the wrapper <div> if the same one was already inserted on this
   // form.
   if (empty($element['#views_ui_ajax_data']['duplicate_wrapper'])) {
@@ -202,7 +203,7 @@ function views_ui_ajax_update_form($form, $form_state) {
 /**
  * Non-Javascript fallback for updating the add view form.
  */
-function views_ui_nojs_submit($form, &$form_state) {
+function views_ui_nojs_submit($form, FormStateInterface &$form_state) {
   $form_state['rebuild'] = TRUE;
 }
 
@@ -220,7 +221,7 @@ function views_ui_nojs_submit($form, &$form_state) {
  *
  * @see taxonomy_autocomplete_validate()
  */
-function views_ui_taxonomy_autocomplete_validate($element, &$form_state) {
+function views_ui_taxonomy_autocomplete_validate($element, FormStateInterface &$form_state) {
   $value = array();
   if ($tags = $element['#value']) {
     // Get the machine names of the vocabularies we will search, keyed by the
@@ -261,7 +262,7 @@ function views_ui_taxonomy_autocomplete_validate($element, &$form_state) {
  * change whether this info is stored on the default display or on
  * the current display.
  */
-function views_ui_standard_display_dropdown(&$form, &$form_state, $section) {
+function views_ui_standard_display_dropdown(&$form, FormStateInterface &$form_state, $section) {
   $view = $form_state['view'];
   $display_id = $form_state['display_id'];
   $executable = $view->getExecutable();
@@ -352,7 +353,7 @@ function views_ui_build_form_path($form_state) {
  * @see _form_builder_handle_input_element()
  * @see _form_button_was_clicked()
  */
-function views_ui_form_button_was_clicked($element, &$form_state) {
+function views_ui_form_button_was_clicked($element, FormStateInterface &$form_state) {
   $process_input = empty($element['#disabled']) && ($form_state['programmed'] || ($form_state['process_input'] && (!isset($element['#access']) || $element['#access'])));
   if ($process_input && !isset($form_state['triggering_element']) && !empty($element['#is_button']) && isset($form_state['input'][$element['#name']]) && isset($element['#values']) && in_array($form_state['input'][$element['#name']], $element['#values'], TRUE)) {
     $form_state['triggering_element'] = $element;
diff --git a/core/modules/views_ui/src/Form/AdvancedSettingsForm.php b/core/modules/views_ui/src/Form/AdvancedSettingsForm.php
index 9ba103d..7e7b301 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..63c9da4 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..8896a02 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..2f458f1 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;
@@ -261,7 +262,7 @@ public function submitForm(array &$form, array &$form_state) {
   /**
    * Submit handler for removing an item from a view
    */
-  public function remove(&$form, &$form_state) {
+  public function remove(&$form, FormStateInterface &$form_state) {
     // Store the item back on the view
     list($was_defaulted, $is_defaulted) = $form_state['view']->getOverrideValues($form, $form_state);
     $executable = $form_state['view']->getExecutable();
diff --git a/core/modules/views_ui/src/Form/Ajax/ConfigHandlerExtra.php b/core/modules/views_ui/src/Form/Ajax/ConfigHandlerExtra.php
index 02ed828..71011d2 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..29d969a 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..cd3374a 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..16fa9e6 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..c1828df 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..b2409f2 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..e94cca0 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..0f0349a 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..84b21a0 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..94ca8e2 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..f08338a 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, FormStateInterface &$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..5362fa2 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..890b6e5 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..d8d260d 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, FormStateInterface &$form_state) {
     // Remove this view from cache so edits will be lost.
     $view = $this->entity;
     $this->tempStore->delete($view->id());
@@ -564,7 +565,7 @@ public function getDisplayDetails($view, $display) {
   /**
    * Submit handler to add a restore a removed display to a view.
    */
-  public function submitDisplayUndoDelete($form, &$form_state) {
+  public function submitDisplayUndoDelete($form, FormStateInterface &$form_state) {
     $view = $this->entity;
     // Create the new display
     $id = $form_state['display_id'];
@@ -585,7 +586,7 @@ public function submitDisplayUndoDelete($form, &$form_state) {
   /**
    * Submit handler to enable a disabled display.
    */
-  public function submitDisplayEnable($form, &$form_state) {
+  public function submitDisplayEnable($form, FormStateInterface &$form_state) {
     $view = $this->entity;
     $id = $form_state['display_id'];
     // setOption doesn't work because this would might affect upper displays
@@ -604,7 +605,7 @@ public function submitDisplayEnable($form, &$form_state) {
   /**
    * Submit handler to disable display.
    */
-  public function submitDisplayDisable($form, &$form_state) {
+  public function submitDisplayDisable($form, FormStateInterface &$form_state) {
     $view = $this->entity;
     $id = $form_state['display_id'];
     $view->getExecutable()->displayHandlers->get($id)->setOption('enabled', FALSE);
@@ -622,7 +623,7 @@ public function submitDisplayDisable($form, &$form_state) {
   /**
    * Submit handler to delete a display from a view.
    */
-  public function submitDisplayDelete($form, &$form_state) {
+  public function submitDisplayDelete($form, FormStateInterface &$form_state) {
     $view = $this->entity;
     $display_id = $form_state['display_id'];
 
@@ -764,7 +765,7 @@ public function renderDisplayTop(ViewUI $view) {
    * contextual link). This handler can be added to buttons whose form submission
    * should not yet redirect to the destination.
    */
-  public function submitDelayDestination($form, &$form_state) {
+  public function submitDelayDestination($form, FormStateInterface &$form_state) {
     $query = $this->requestStack->getCurrentRequest()->query;
     // @todo: Revisit this when http://drupal.org/node/1668866 is in.
     $destination = $query->get('destination');
@@ -787,7 +788,7 @@ public function submitDelayDestination($form, &$form_state) {
   /**
    * Submit handler to duplicate a display for a view.
    */
-  public function submitDisplayDuplicate($form, &$form_state) {
+  public function submitDisplayDuplicate($form, FormStateInterface &$form_state) {
     $view = $this->entity;
     $display_id = $this->displayID;
 
@@ -814,7 +815,7 @@ public function submitDisplayDuplicate($form, &$form_state) {
   /**
    * Submit handler to add a display to a view.
    */
-  public function submitDisplayAdd($form, &$form_state) {
+  public function submitDisplayAdd($form, FormStateInterface &$form_state) {
     $view = $this->entity;
     // Create the new display.
     $parents = $form_state['triggering_element']['#parents'];
@@ -836,7 +837,7 @@ public function submitDisplayAdd($form, &$form_state) {
   /**
    * Submit handler to Duplicate a display as another display type.
    */
-  public function submitDuplicateDisplayAsType($form, &$form_state) {
+  public function submitDuplicateDisplayAsType($form, FormStateInterface &$form_state) {
     $view = $this->entity;
     $display_id = $this->displayID;
 
diff --git a/core/modules/views_ui/src/ViewFormBase.php b/core/modules/views_ui/src/ViewFormBase.php
index 61b872f..aec2541 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..078ffb7 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(
@@ -126,7 +127,7 @@ protected function actions(array $form, array &$form_state) {
   /**
    * Form submission handler for the Preview button.
    */
-  public function submitPreview($form, &$form_state) {
+  public function submitPreview($form, FormStateInterface &$form_state) {
     // Rebuild the form with a pristine $view object.
     $view = $this->entity;
     // Attempt to load the view from temp store, otherwise create a new one.
diff --git a/core/modules/views_ui/src/ViewUI.php b/core/modules/views_ui/src/ViewUI.php
index 3b9cb81..a6daab3 100644
--- a/core/modules/views_ui/src/ViewUI.php
+++ b/core/modules/views_ui/src/ViewUI.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Timer;
 use Drupal\Component\Utility\Xss;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Views;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\views\ViewExecutable;
@@ -240,7 +241,7 @@ public function isUninstalling() {
    * to apply to the default display or to the current display, and dispatches
    * control appropriately.
    */
-  public function standardSubmit($form, &$form_state) {
+  public function standardSubmit($form, FormStateInterface &$form_state) {
     // Determine whether the values the user entered are intended to apply to
     // the current display or the default display.
 
@@ -295,7 +296,7 @@ public function standardSubmit($form, &$form_state) {
   /**
    * Submit handler for cancel button
    */
-  public function standardCancel($form, &$form_state) {
+  public function standardCancel($form, FormStateInterface &$form_state) {
     if (!empty($this->changed) && isset($this->form_cache)) {
       unset($this->form_cache);
       $this->cacheSet();
@@ -312,7 +313,7 @@ public function standardCancel($form, &$form_state) {
    * TODO: Is the hidden op operator still here somewhere, or is that part of the
    * docblock outdated?
    */
-  public function getStandardButtons(&$form, &$form_state, $form_id, $name = NULL) {
+  public function getStandardButtons(&$form, FormStateInterface &$form_state, $form_id, $name = NULL) {
     $form['actions'] = array(
       '#type' => 'actions',
     );
@@ -474,7 +475,7 @@ public function addFormToStack($key, $display_id, $type, $id = NULL, $top = FALS
   /**
    * Submit handler for adding new item(s) to a view.
    */
-  public function submitItemAdd($form, &$form_state) {
+  public function submitItemAdd($form, FormStateInterface &$form_state) {
     $type = $form_state['type'];
     $types = ViewExecutable::getHandlerTypes();
     $section = $types[$type]['plural'];
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..7542300 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..0a8af5f 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, FormStateInterface &$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, FormStateInterface &$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,9 @@ public static function create(ContainerInterface $container) {
 }
 
 namespace {
-  function test_form_id_custom_submit(array &$form, array &$form_state) {
+  use Drupal\Core\Form\FormStateInterface;
+
+  function test_form_id_custom_submit(array &$form, FormStateInterface &$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..d387ba9 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormTestBase.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormTestBase.php
@@ -9,7 +9,9 @@
 
 use Drupal\Core\Form\FormBuilder;
 use Drupal\Core\Form\FormInterface;
-use Drupal\Core\Session\AccountInterface;
+  use Drupal\Core\Form\FormState;
+  use Drupal\Core\Form\FormStateInterface;
+  use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RequestStack;
@@ -221,8 +223,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 +233,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, FormStateInterface &$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 +259,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 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;
   }
 
 }
diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme
index abf6c4f..92d1f7f 100644
--- a/core/themes/seven/seven.theme
+++ b/core/themes/seven/seven.theme
@@ -7,6 +7,7 @@
 
 use Drupal\Component\Utility\Xss;
 use Drupal\Component\Utility\String;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Implements hook_preprocess_HOOK() for page templates.
@@ -268,7 +269,7 @@ function seven_preprocess_maintenance_page(&$variables) {
  *
  * Changes vertical tabs to container and adds meta information.
  */
-function seven_form_node_form_alter(&$form, &$form_state) {
+function seven_form_node_form_alter(&$form, FormStateInterface &$form_state) {
   /** @var \Drupal\node\NodeInterface $node */
   $node = $form_state['controller']->getEntity();
 
