diff --git a/core/lib/Drupal/Core/Entity/EntityForm.php b/core/lib/Drupal/Core/Entity/EntityForm.php
index b4f6bd6..b8df16b 100644
--- a/core/lib/Drupal/Core/Entity/EntityForm.php
+++ b/core/lib/Drupal/Core/Entity/EntityForm.php
@@ -294,7 +294,7 @@ public function buildEntity(array $form, FormStateInterface $form_state) {
     // properties.
     if (isset($form['#entity_builders'])) {
       foreach ($form['#entity_builders'] as $function) {
-        call_user_func_array($form_state->prepareCallback($function), array($entity->getEntityTypeId(), $entity, &$form, &$form_state));
+        call_user_func_array($form_state->prepareCallback($function), array($entity->getEntityTypeId(), $entity, &$form, $form_state));
       }
     }
 
diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php
index 878967b..3695abe 100644
--- a/core/lib/Drupal/Core/Form/FormBuilder.php
+++ b/core/lib/Drupal/Core/Form/FormBuilder.php
@@ -179,7 +179,7 @@ public function __construct(FormValidatorInterface $form_validator, FormSubmitte
   /**
    * {@inheritdoc}
    */
-  public function getFormId($form_arg, FormStateInterface &$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)) {
@@ -360,7 +360,7 @@ public function buildForm($form_id, FormStateInterface &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function rebuildForm($form_id, FormStateInterface &$form_state, $old_form = NULL) {
+  public function rebuildForm($form_id, FormStateInterface $form_state, $old_form = NULL) {
     $form = $this->retrieveForm($form_id, $form_state);
 
     // Only GET and POST are valid form methods. If the form receives its input
@@ -451,7 +451,7 @@ public function deleteCache($form_build_id) {
   /**
    * {@inheritdoc}
    */
-  public function submitForm($form_arg, FormStateInterface &$form_state) {
+  public function submitForm($form_arg, FormStateInterface $form_state) {
     $build_info = $form_state->getBuildInfo();
     if (empty($build_info['args'])) {
       $args = func_get_args();
@@ -484,7 +484,7 @@ public function submitForm($form_arg, FormStateInterface &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function retrieveForm($form_id, FormStateInterface &$form_state) {
+  public function retrieveForm($form_id, FormStateInterface $form_state) {
     // Record the $form_id.
     $form_state->addBuildInfo('form_id', $form_id);
 
@@ -509,7 +509,7 @@ public function retrieveForm($form_id, FormStateInterface &$form_state) {
     // We need to pass $form_state by reference in order for forms to modify it,
     // since call_user_func_array() requires that referenced variables are
     // passed explicitly.
-    $args = array_merge(array($form, &$form_state), $args);
+    $args = array_merge(array($form, $form_state), $args);
 
     $form = call_user_func_array($callback, $args);
     // If the form returns a response, skip subsequent page construction by
@@ -531,7 +531,7 @@ public function retrieveForm($form_id, FormStateInterface &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function processForm($form_id, &$form, FormStateInterface &$form_state) {
+  public function processForm($form_id, &$form, FormStateInterface $form_state) {
     $form_state->setValues([]);
 
     // With GET, these forms are always submitted if requested.
@@ -672,7 +672,7 @@ public function renderFormTokenPlaceholder($placeholder) {
   /**
    * {@inheritdoc}
    */
-  public function prepareForm($form_id, &$form, FormStateInterface &$form_state) {
+  public function prepareForm($form_id, &$form, FormStateInterface $form_state) {
     $user = $this->currentUser();
 
     $form['#type'] = 'form';
@@ -854,7 +854,7 @@ public function setInvalidTokenError(FormStateInterface $form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm($form_id, &$form, FormStateInterface &$form_state) {
+  public function validateForm($form_id, &$form, FormStateInterface $form_state) {
     $this->formValidator->validateForm($form_id, $form, $form_state);
   }
 
@@ -868,28 +868,28 @@ public function redirectForm(FormStateInterface $form_state) {
   /**
    * {@inheritdoc}
    */
-  public function executeValidateHandlers(&$form, FormStateInterface &$form_state) {
+  public function executeValidateHandlers(&$form, FormStateInterface $form_state) {
     $this->formValidator->executeValidateHandlers($form, $form_state);
   }
 
   /**
    * {@inheritdoc}
    */
-  public function executeSubmitHandlers(&$form, FormStateInterface &$form_state) {
+  public function executeSubmitHandlers(&$form, FormStateInterface $form_state) {
     $this->formSubmitter->executeSubmitHandlers($form, $form_state);
   }
 
   /**
    * {@inheritdoc}
    */
-  public function doSubmitForm(&$form, FormStateInterface &$form_state) {
+  public function doSubmitForm(&$form, FormStateInterface $form_state) {
     throw new \LogicException('Use FormBuilderInterface::processForm() instead.');
   }
 
   /**
    * {@inheritdoc}
    */
-  public function doBuildForm($form_id, &$element, FormStateInterface &$form_state) {
+  public function doBuildForm($form_id, &$element, FormStateInterface $form_state) {
     // Initialize as unprocessed.
     $element['#processed'] = FALSE;
 
@@ -978,7 +978,7 @@ public function doBuildForm($form_id, &$element, FormStateInterface &$form_state
     if (isset($element['#process']) && !$element['#processed']) {
       foreach ($element['#process'] as $callback) {
         $complete_form = &$form_state->getCompleteForm();
-        $element = call_user_func_array($form_state->prepareCallback($callback), array(&$element, &$form_state, &$complete_form));
+        $element = call_user_func_array($form_state->prepareCallback($callback), array(&$element, $form_state, &$complete_form));
       }
       $element['#processed'] = TRUE;
     }
@@ -1049,7 +1049,7 @@ public function doBuildForm($form_id, &$element, FormStateInterface &$form_state
     // after normal input parsing has been completed.
     if (isset($element['#after_build']) && !isset($element['#after_build_done'])) {
       foreach ($element['#after_build'] as $callback) {
-        $element = call_user_func_array($form_state->prepareCallback($callback), array($element, &$form_state));
+        $element = call_user_func_array($form_state->prepareCallback($callback), array($element, $form_state));
       }
       $element['#after_build_done'] = TRUE;
     }
@@ -1146,7 +1146,7 @@ protected function valueCallableIsSafe(callable $value_callable) {
   /**
    * Adds the #name and #value properties of an input element before rendering.
    */
-  protected function handleInputElement($form_id, &$element, FormStateInterface &$form_state) {
+  protected function handleInputElement($form_id, &$element, FormStateInterface $form_state) {
     if (!isset($element['#name'])) {
       $name = array_shift($element['#parents']);
       $element['#name'] = $name;
@@ -1235,7 +1235,7 @@ protected function handleInputElement($form_id, &$element, FormStateInterface &$
           // Skip all value callbacks except safe ones like text if the CSRF
           // token was invalid.
           if (!$form_state->hasInvalidToken() || $this->valueCallableIsSafe($value_callable)) {
-            $element['#value'] = call_user_func_array($value_callable, array(&$element, $input, &$form_state));
+            $element['#value'] = call_user_func_array($value_callable, array(&$element, $input, $form_state));
           }
           else {
             $input = NULL;
@@ -1254,7 +1254,7 @@ protected function handleInputElement($form_id, &$element, FormStateInterface &$
       if (!isset($element['#value'])) {
         // Call #type_value without a second argument to request default_value
         // handling.
-        $element['#value'] = call_user_func_array($value_callable, array(&$element, FALSE, &$form_state));
+        $element['#value'] = call_user_func_array($value_callable, array(&$element, FALSE, $form_state));
 
         // Final catch. If we haven't set a value yet, use the explicit default
         // value. Avoid image buttons (which come with garbage value), so we
@@ -1311,7 +1311,7 @@ protected function handleInputElement($form_id, &$element, FormStateInterface &$
    * 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, FormStateInterface &$form_state) {
+  protected function elementTriggeredScriptedSubmission($element, FormStateInterface $form_state) {
     $input = $form_state->getUserInput();
     if (!empty($input['_triggering_element_name']) && $element['#name'] == $input['_triggering_element_name']) {
       if (empty($input['_triggering_element_value']) || $input['_triggering_element_value'] == $element['#value']) {
@@ -1341,7 +1341,7 @@ protected function elementTriggeredScriptedSubmission($element, FormStateInterfa
    * to know which button was clicked should get that information from
    * $form_state->getTriggeringElement().
    */
-  protected function buttonWasClicked($element, FormStateInterface &$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
diff --git a/core/lib/Drupal/Core/Form/FormBuilderInterface.php b/core/lib/Drupal/Core/Form/FormBuilderInterface.php
index ca79437..def905b 100644
--- a/core/lib/Drupal/Core/Form/FormBuilderInterface.php
+++ b/core/lib/Drupal/Core/Form/FormBuilderInterface.php
@@ -33,7 +33,7 @@
    * @return string
    *   The unique string identifying the desired form.
    */
-  public function getFormId($form_arg, FormStateInterface &$form_state);
+  public function getFormId($form_arg, FormStateInterface $form_state);
 
   /**
    * Gets a renderable form array.
@@ -124,7 +124,7 @@ public function buildForm($form_id, FormStateInterface &$form_state);
    *
    * @see self::processForm()
    */
-  public function rebuildForm($form_id, FormStateInterface &$form_state, $old_form = NULL);
+  public function rebuildForm($form_id, FormStateInterface $form_state, $old_form = NULL);
 
   /**
    * Retrieves, populates, and processes a form.
@@ -158,7 +158,7 @@ public function rebuildForm($form_id, FormStateInterface &$form_state, $old_form
    *   $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, FormStateInterface &$form_state, &$object) {
+   *   function mymodule_form($form, FormStateInterface $form_state, &$object) {
    *   }
    *   @endcode
    *   would be called via self::submitForm() as follows:
@@ -180,7 +180,7 @@ public function rebuildForm($form_id, FormStateInterface &$form_state, $old_form
    * \Drupal::formBuilder()->submitForm('user_register_form', $form_state);
    * @endcode
    */
-  public function submitForm($form_arg, FormStateInterface &$form_state);
+  public function submitForm($form_arg, FormStateInterface $form_state);
 
   /**
    * Retrieves the structured array that defines a given form.
@@ -195,7 +195,7 @@ public function submitForm($form_arg, FormStateInterface &$form_state);
    *
    * @return mixed|\Symfony\Component\HttpFoundation\Response
    */
-  public function retrieveForm($form_id, FormStateInterface &$form_state);
+  public function retrieveForm($form_id, FormStateInterface $form_state);
 
   /**
    * Processes a form submission.
@@ -215,7 +215,7 @@ public function retrieveForm($form_id, FormStateInterface &$form_state);
    *
    * @return \Symfony\Component\HttpFoundation\RedirectResponse|null
    */
-  public function processForm($form_id, &$form, FormStateInterface &$form_state);
+  public function processForm($form_id, &$form, FormStateInterface $form_state);
 
   /**
    * Prepares a structured form array.
@@ -232,7 +232,7 @@ public function processForm($form_id, &$form, FormStateInterface &$form_state);
    *   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, FormStateInterface &$form_state);
+  public function prepareForm($form_id, &$form, FormStateInterface $form_state);
 
   /**
    * Builds and processes all elements in the structured form array.
@@ -328,6 +328,6 @@ public function prepareForm($form_id, &$form, FormStateInterface &$form_state);
    *
    * @return array
    */
-  public function doBuildForm($form_id, &$element, FormStateInterface &$form_state);
+  public function doBuildForm($form_id, &$element, FormStateInterface $form_state);
 
 }
diff --git a/core/lib/Drupal/Core/Form/FormErrorHandler.php b/core/lib/Drupal/Core/Form/FormErrorHandler.php
index 921ab10..b37918b 100644
--- a/core/lib/Drupal/Core/Form/FormErrorHandler.php
+++ b/core/lib/Drupal/Core/Form/FormErrorHandler.php
@@ -53,7 +53,7 @@ protected function displayErrorMessages(array $form, FormStateInterface $form_st
    * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the form.
    */
-  protected function setElementErrorsFromFormState(array &$elements, FormStateInterface &$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]) {
diff --git a/core/lib/Drupal/Core/Form/FormSubmitter.php b/core/lib/Drupal/Core/Form/FormSubmitter.php
index a467924..cc29413 100644
--- a/core/lib/Drupal/Core/Form/FormSubmitter.php
+++ b/core/lib/Drupal/Core/Form/FormSubmitter.php
@@ -42,7 +42,7 @@ public function __construct(RequestStack $request_stack, UrlGeneratorInterface $
   /**
    * {@inheritdoc}
    */
-  public function doSubmitForm(&$form, FormStateInterface &$form_state) {
+  public function doSubmitForm(&$form, FormStateInterface $form_state) {
     if (!$form_state->isSubmitted()) {
       return;
     }
@@ -87,7 +87,7 @@ public function doSubmitForm(&$form, FormStateInterface &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function executeSubmitHandlers(&$form, FormStateInterface &$form_state) {
+  public function executeSubmitHandlers(&$form, FormStateInterface $form_state) {
     // If there was a button pressed, use its handlers.
     $handlers = $form_state->getSubmitHandlers();
     // Otherwise, check for a form-level handler.
@@ -108,7 +108,7 @@ public function executeSubmitHandlers(&$form, FormStateInterface &$form_state) {
         $batch['has_form_submits'] = TRUE;
       }
       else {
-        call_user_func_array($form_state->prepareCallback($callback), array(&$form, &$form_state));
+        call_user_func_array($form_state->prepareCallback($callback), array(&$form, $form_state));
       }
     }
   }
diff --git a/core/lib/Drupal/Core/Form/FormSubmitterInterface.php b/core/lib/Drupal/Core/Form/FormSubmitterInterface.php
index a230953..52c1aa7 100644
--- a/core/lib/Drupal/Core/Form/FormSubmitterInterface.php
+++ b/core/lib/Drupal/Core/Form/FormSubmitterInterface.php
@@ -19,7 +19,7 @@
    *   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, FormStateInterface &$form_state);
+  public function doSubmitForm(&$form, FormStateInterface $form_state);
 
   /**
    * Executes custom submission handlers for a given form.
@@ -34,7 +34,7 @@ public function doSubmitForm(&$form, FormStateInterface &$form_state);
    *   a button with custom handler functions defined, those handlers will be
    *   stored here.
    */
-  public function executeSubmitHandlers(&$form, FormStateInterface &$form_state);
+  public function executeSubmitHandlers(&$form, FormStateInterface $form_state);
 
   /**
    * Redirects the user to a URL after a form has been processed.
diff --git a/core/lib/Drupal/Core/Form/FormValidator.php b/core/lib/Drupal/Core/Form/FormValidator.php
index dbefe00..2dd849f 100644
--- a/core/lib/Drupal/Core/Form/FormValidator.php
+++ b/core/lib/Drupal/Core/Form/FormValidator.php
@@ -71,7 +71,7 @@ public function __construct(RequestStack $request_stack, TranslationInterface $s
   /**
    * {@inheritdoc}
    */
-  public function executeValidateHandlers(&$form, FormStateInterface &$form_state) {
+  public function executeValidateHandlers(&$form, FormStateInterface $form_state) {
     // If there was a button pressed, use its handlers.
     $handlers = $form_state->getValidateHandlers();
     // Otherwise, check for a form-level handler.
@@ -80,14 +80,14 @@ public function executeValidateHandlers(&$form, FormStateInterface &$form_state)
     }
 
     foreach ($handlers as $callback) {
-      call_user_func_array($form_state->prepareCallback($callback), array(&$form, &$form_state));
+      call_user_func_array($form_state->prepareCallback($callback), array(&$form, $form_state));
     }
   }
 
   /**
    * {@inheritdoc}
    */
-  public function validateForm($form_id, &$form, FormStateInterface &$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 ($form_state->isValidationEnforced()) {
@@ -144,7 +144,7 @@ public function setInvalidTokenError(FormStateInterface $form_state) {
    * @param string $form_id
    *   The unique string identifying the form.
    */
-  protected function handleErrorsWithLimitedValidation(&$form, FormStateInterface &$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.
     $triggering_element = $form_state->getTriggeringElement();
@@ -197,7 +197,7 @@ protected function handleErrorsWithLimitedValidation(&$form, FormStateInterface
    * @param string $form_id
    *   The unique string identifying the form.
    */
-  protected function finalizeValidation(&$form, FormStateInterface &$form_state, $form_id) {
+  protected function finalizeValidation(&$form, FormStateInterface $form_state, $form_id) {
     // Delegate handling of form errors to a service.
     $this->formErrorHandler->handleFormErrors($form, $form_state);
 
@@ -228,7 +228,7 @@ protected function finalizeValidation(&$form, FormStateInterface &$form_state, $
    *   A unique string identifying the form for validation, submission,
    *   theming, and hook_form_alter functions.
    */
-  protected function doValidateForm(&$elements, FormStateInterface &$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]) {
@@ -274,7 +274,7 @@ protected function doValidateForm(&$elements, FormStateInterface &$form_state, $
       elseif (isset($elements['#element_validate'])) {
         foreach ($elements['#element_validate'] as $callback) {
           $complete_form = &$form_state->getCompleteForm();
-          call_user_func_array($form_state->prepareCallback($callback), array(&$elements, &$form_state, &$complete_form));
+          call_user_func_array($form_state->prepareCallback($callback), array(&$elements, $form_state, &$complete_form));
         }
       }
 
@@ -323,7 +323,7 @@ protected function doValidateForm(&$elements, FormStateInterface &$form_state, $
    *   web service requests, or other expensive requests that should
    *   not be repeated in the submission step.
    */
-  protected function performRequiredValidation(&$elements, FormStateInterface &$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']) {
       $form_state->setError($elements, $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']))));
@@ -373,7 +373,7 @@ protected function performRequiredValidation(&$elements, FormStateInterface &$fo
    *
    * @return array|null
    */
-  protected function determineLimitValidationErrors(FormStateInterface &$form_state) {
+  protected function determineLimitValidationErrors(FormStateInterface $form_state) {
     // While this element is being validated, it may be desired that some
     // calls to \Drupal\Core\Form\FormStateInterface::setErrorByName() be
     // suppressed and not result in a form error, so that a button that
diff --git a/core/lib/Drupal/Core/Form/FormValidatorInterface.php b/core/lib/Drupal/Core/Form/FormValidatorInterface.php
index b7e2423..80f6853 100644
--- a/core/lib/Drupal/Core/Form/FormValidatorInterface.php
+++ b/core/lib/Drupal/Core/Form/FormValidatorInterface.php
@@ -20,7 +20,7 @@
    *   a button with custom handler functions defined, those handlers will be
    *   stored here.
    */
-  public function executeValidateHandlers(&$form, FormStateInterface &$form_state);
+  public function executeValidateHandlers(&$form, FormStateInterface $form_state);
 
   /**
    * Validates user-submitted form data in the $form_state.
@@ -47,7 +47,7 @@ public function executeValidateHandlers(&$form, FormStateInterface &$form_state)
    *   web service requests, or other expensive requests that should
    *   not be repeated in the submission step.
    */
-  public function validateForm($form_id, &$form, FormStateInterface &$form_state);
+  public function validateForm($form_id, &$form, FormStateInterface $form_state);
 
   /**
    * Sets a form_token error on the given form state.
diff --git a/core/modules/automated_cron/automated_cron.module b/core/modules/automated_cron/automated_cron.module
index 6b8c4d2..47bbabb 100644
--- a/core/modules/automated_cron/automated_cron.module
+++ b/core/modules/automated_cron/automated_cron.module
@@ -31,7 +31,7 @@ function automated_cron_help($route_name, RouteMatchInterface $route_match) {
 /**
  * Implements hook_form_FORM_ID_alter() for the system_cron_settings() form.
  */
-function automated_cron_form_system_cron_settings_alter(&$form, &$form_state) {
+function automated_cron_form_system_cron_settings_alter(&$form, $form_state) {
   $automated_cron_settings = \Drupal::config('automated_cron.settings');
 
   $options = [3600, 10800, 21600, 43200, 86400, 604800];
diff --git a/core/modules/file/src/Element/ManagedFile.php b/core/modules/file/src/Element/ManagedFile.php
index f465b18..a3cd1a9 100644
--- a/core/modules/file/src/Element/ManagedFile.php
+++ b/core/modules/file/src/Element/ManagedFile.php
@@ -169,7 +169,7 @@ public static function valueCallback(&$element, $input, FormStateInterface $form
    * @return \Drupal\Core\Ajax\AjaxResponse
    *   The ajax response of the ajax upload.
    */
-  public static function uploadAjaxCallback(&$form, FormStateInterface &$form_state, Request $request) {
+  public static function uploadAjaxCallback(&$form, FormStateInterface $form_state, Request $request) {
     /** @var \Drupal\Core\Render\RendererInterface $renderer */
     $renderer = \Drupal::service('renderer');
 
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 7114a29..45cb09f 100644
--- a/core/modules/system/tests/modules/form_test/form_test.module
+++ b/core/modules/system/tests/modules/form_test/form_test.module
@@ -97,7 +97,7 @@ function form_test_user_register_form_rebuild($form, FormStateInterface $form_st
 /**
  * Implements hook_form_FORM_ID_alter() for form_test_vertical_tabs_access_form().
  */
-function form_test_form_form_test_vertical_tabs_access_form_alter(&$form, &$form_state, $form_id) {
+function form_test_form_form_test_vertical_tabs_access_form_alter(&$form, $form_state, $form_id) {
   $form['vertical_tabs1']['#access'] = FALSE;
   $form['vertical_tabs2']['#access'] = FALSE;
   $form['tabs3']['#access'] = TRUE;
diff --git a/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php
index 81a98ae..16cab24 100644
--- a/core/modules/user/src/AccountForm.php
+++ b/core/modules/user/src/AccountForm.php
@@ -299,7 +299,7 @@ public function alterPreferredLangcodeDescription(array $element) {
    * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the form.
    */
-  public function syncUserLangcode($entity_type_id, UserInterface $user, array &$form, FormStateInterface &$form_state) {
+  public function syncUserLangcode($entity_type_id, UserInterface $user, array &$form, FormStateInterface $form_state) {
     $user->getUntranslated()->langcode = $user->preferred_langcode;
   }
 
diff --git a/core/modules/user/tests/modules/user_form_test/user_form_test.module b/core/modules/user/tests/modules/user_form_test/user_form_test.module
index 1dc2a32..1939f33 100644
--- a/core/modules/user/tests/modules/user_form_test/user_form_test.module
+++ b/core/modules/user/tests/modules/user_form_test/user_form_test.module
@@ -8,7 +8,7 @@
 /**
  * Implements hook_form_FORM_ID_alter() for user_cancel_form().
  */
-function user_form_test_form_user_cancel_form_alter(&$form, &$form_state) {
+function user_form_test_form_user_cancel_form_alter(&$form, $form_state) {
   $form['user_cancel_confirm']['#default_value'] = FALSE;
   $form['access']['#value'] = \Drupal::currentUser()->hasPermission('cancel other accounts');
 }
diff --git a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
index 93bd049..24ab184 100644
--- a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
+++ b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
@@ -190,7 +190,7 @@ public function getForm(ViewEntityInterface $view, $display_id, $js) {
    *   - A render array with the title in #title and the rendered form in the
    *   #markup array.
    */
-  protected function ajaxFormWrapper($form_class, FormStateInterface &$form_state) {
+  protected function ajaxFormWrapper($form_class, FormStateInterface $form_state) {
     /** @var \Drupal\Core\Render\RendererInterface $renderer */
     $renderer = \Drupal::service('renderer');
 
@@ -208,7 +208,7 @@ protected function ajaxFormWrapper($form_class, FormStateInterface &$form_state)
     // Builds the form in a render context in order to ensure that cacheable
     // metadata is bubbled up.
     $render_context = new RenderContext();
-    $callable = function () use ($form_class, &$form_state) {
+    $callable = function () use ($form_class, $form_state) {
       return \Drupal::formBuilder()->buildForm($form_class, $form_state);
     };
     $form = $renderer->executeInRenderContext($render_context, $callable);
