diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php
index 4bc6272..ce045d8 100644
--- a/core/lib/Drupal/Core/Form/FormBuilder.php
+++ b/core/lib/Drupal/Core/Form/FormBuilder.php
@@ -142,7 +142,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)) {
@@ -178,7 +178,7 @@ public function getForm($form_arg) {
   /**
    * {@inheritdoc}
    */
-  public function buildForm($form_id, FormStateInterface &$form_state) {
+  public function buildForm($form_id, FormStateInterface $form_state) {
     // Ensure the form ID is prepared.
     $form_id = $this->getFormId($form_id, $form_state);
 
@@ -284,7 +284,9 @@ 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,
+    array $old_form = NULL
+  ) {
     $form = $this->retrieveForm($form_id, $form_state);
     // All rebuilt forms will be cached.
     $form_state->setCached();
@@ -354,7 +356,7 @@ public function setCache($form_build_id, $form, FormStateInterface $form_state)
   /**
    * {@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();
@@ -387,7 +389,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);
 
@@ -434,7 +436,7 @@ public function retrieveForm($form_id, FormStateInterface &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function processForm($form_id, &$form, FormStateInterface &$form_state) {
+  public function processForm($form_id, array &$form, FormStateInterface $form_state) {
     $form_state->setValues([]);
 
     // With GET, these forms are always submitted if requested.
@@ -538,7 +540,7 @@ public function processForm($form_id, &$form, FormStateInterface &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function prepareForm($form_id, &$form, FormStateInterface &$form_state) {
+  public function prepareForm($form_id, array &$form, FormStateInterface $form_state) {
     $user = $this->currentUser();
 
     $form['#type'] = 'form';
@@ -648,7 +650,9 @@ public function prepareForm($form_id, &$form, FormStateInterface &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateForm($form_id, &$form, FormStateInterface &$form_state) {
+  public function validateForm($form_id, array &$form,
+    FormStateInterface $form_state
+  ) {
     $this->formValidator->validateForm($form_id, $form, $form_state);
   }
 
@@ -662,7 +666,9 @@ public function redirectForm(FormStateInterface $form_state) {
   /**
    * {@inheritdoc}
    */
-  public function executeValidateHandlers(&$form, FormStateInterface &$form_state) {
+  public function executeValidateHandlers(array &$form,
+    FormStateInterface $form_state
+  ) {
     $this->formValidator->executeValidateHandlers($form, $form_state);
   }
 
@@ -683,7 +689,10 @@ public function doSubmitForm(&$form, FormStateInterface &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function doBuildForm($form_id, &$element, FormStateInterface &$form_state) {
+  public function doBuildForm($form_id,
+    array &$element,
+    FormStateInterface $form_state
+  ) {
     // Initialize as unprocessed.
     $element['#processed'] = FALSE;
 
diff --git a/core/lib/Drupal/Core/Form/FormBuilderInterface.php b/core/lib/Drupal/Core/Form/FormBuilderInterface.php
index 5f8b452..7bb4a83 100644
--- a/core/lib/Drupal/Core/Form/FormBuilderInterface.php
+++ b/core/lib/Drupal/Core/Form/FormBuilderInterface.php
@@ -20,10 +20,10 @@
    * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the form.
    *
-   * @return string
-   *   The unique string identifying the desired form.
+   * @return string The unique string identifying the desired form.
+   * 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.
@@ -65,13 +65,11 @@ public function getForm($form_arg);
    * @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
-   *   may not return at all depending upon the $form_state flags that were set.
-   *
+   * @return array The rendered form. This function may also perform a redirect and hence
+   * The rendered form. This function may also perform a redirect and hence
    * @see self::redirectForm()
    */
-  public function buildForm($form_id, FormStateInterface &$form_state);
+  public function buildForm($form_id, FormStateInterface $form_state);
 
   /**
    * Constructs a new $form from the information in $form_state.
@@ -103,13 +101,14 @@ public function buildForm($form_id, FormStateInterface &$form_state);
    *   'rebuild_info' needs to be a separate top-level property next to
    *   'build_info', since the contained data must not be cached.
    *
-   * @return array
+   * @return array The newly built form.
    *   The newly built form.
    *
    * @see self::processForm()
    * @see \Drupal\system\FormAjaxController::content()
    */
-  public function rebuildForm($form_id, FormStateInterface &$form_state, $old_form = NULL);
+  public function rebuildForm($form_id, FormStateInterface $form_state, array $old_form = NULL
+  );
 
   /**
    * Retrieves, populates, and processes a form.
@@ -125,7 +124,7 @@ public function rebuildForm($form_id, FormStateInterface &$form_state, $old_form
    *   A form object to use to build the form, or the unique string identifying
    *   the desired form. If $form_arg is a string and a function with that
    *   name exists, it is called to build the form array.
-   * @param $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the form. Most important is the
    *   $form_state->getValues() collection, a tree of data used to simulate the
    *   incoming \Drupal::request()->request information from a user's form
@@ -134,7 +133,8 @@ public function rebuildForm($form_id, FormStateInterface &$form_state, $old_form
    *   checkbox or other control that browsers submit by not having a
    *   \Drupal::request()->request entry, include the key, but set the value to
    *   NULL.
-   * @param ...
+   *
+   * @internal param $ ...
    *   Any additional arguments are passed on to the functions called by
    *   self::submitForm(), including the unique form constructor function.
    *   For example, the node_edit form requires that a node object be passed
@@ -142,16 +142,16 @@ public function rebuildForm($form_id, FormStateInterface &$form_state, $old_form
    *   should not be included here, but rather placed directly in the
    *   $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) {
+   * @code
+   *   function mymodule_form($form, FormStateInterface $form_state, &$object) {
    *   }
-   *   @endcode
+   * @endcode
    *   would be called via self::submitForm() as follows:
-   *   @code
+   * @code
    *   $form_state->setValues($my_form_values);
    *   $form_state->addBuildInfo('args', [&$object]);
    *   \Drupal::formBuilder()->submitForm('mymodule_form', $form_state);
-   *   @endcode
+   * @endcode
    * For example:
    * @code
    * // register a new user
@@ -165,7 +165,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.
@@ -180,7 +180,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.
@@ -198,9 +198,9 @@ public function retrieveForm($form_id, FormStateInterface &$form_state);
    *   when displaying a multi-step form. Additional information, like the
    *   sanitized \Drupal::request()->request data, is also accumulated here.
    *
-   * @return \Symfony\Component\HttpFoundation\RedirectResponse|null
+   * @return null|\Symfony\Component\HttpFoundation\RedirectResponse
    */
-  public function processForm($form_id, &$form, FormStateInterface &$form_state);
+  public function processForm($form_id, array &$form, FormStateInterface $form_state);
 
   /**
    * Prepares a structured form array.
@@ -217,7 +217,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, array &$form, FormStateInterface $form_state);
 
   /**
    * Builds and processes all elements in the structured form array.
@@ -312,7 +312,9 @@ public function prepareForm($form_id, &$form, FormStateInterface &$form_state);
    *   as well as the sanitized \Drupal::request()->request data.
    *
    * @return array
+   *   A form array.
    */
-  public function doBuildForm($form_id, &$element, FormStateInterface &$form_state);
+  public function doBuildForm($form_id, array &$element, FormStateInterface $form_state
+  );
 
 }
diff --git a/core/lib/Drupal/Core/Form/FormValidator.php b/core/lib/Drupal/Core/Form/FormValidator.php
index ee2da65..415db40 100644
--- a/core/lib/Drupal/Core/Form/FormValidator.php
+++ b/core/lib/Drupal/Core/Form/FormValidator.php
@@ -66,7 +66,9 @@ public function __construct(RequestStack $request_stack, TranslationInterface $s
   /**
    * {@inheritdoc}
    */
-  public function executeValidateHandlers(&$form, FormStateInterface &$form_state) {
+  public function executeValidateHandlers(array &$form,
+    FormStateInterface $form_state
+  ) {
     // If there was a button pressed, use its handlers.
     $handlers = $form_state->getValidateHandlers();
     // Otherwise, check for a form-level handler.
@@ -75,14 +77,16 @@ 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, array &$form,
+    FormStateInterface $form_state
+  ) {
     // If this form is flagged to always validate, ensure that previous runs of
     // validation are ignored.
     if ($form_state->isValidationEnforced()) {
@@ -112,7 +116,7 @@ public function validateForm($form_id, &$form, FormStateInterface &$form_state)
     }
 
     // Recursively validate each form element.
-    $this->doValidateForm($form, $form_state, $form_id);
+    $this->validateFormElements($form, $form_state, $form_id);
     $this->finalizeValidation($form, $form_state, $form_id);
     $this->handleErrorsWithLimitedValidation($form, $form_state, $form_id);
   }
@@ -130,7 +134,7 @@ public function validateForm($form_id, &$form, 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(array &$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();
@@ -183,7 +187,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(array &$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.
@@ -197,7 +201,7 @@ protected function finalizeValidation(&$form, FormStateInterface &$form_state, $
    * and selected options were in the list of options given to the user. Then
    * calls user-defined validators.
    *
-   * @param $elements
+   * @param array $elements
    *   An associative array containing the structure of the form.
    * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the form. The current user-submitted data is stored
@@ -213,11 +217,11 @@ 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 validateFormElements(array &$elements, FormStateInterface $form_state, $form_id = NULL) {
     // Recurse through all children.
     foreach (Element::children($elements) as $key) {
       if (isset($elements[$key]) && $elements[$key]) {
-        $this->doValidateForm($elements[$key], $form_state);
+        $this->validateFormElements($elements[$key], $form_state);
       }
     }
 
@@ -259,7 +263,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));
         }
       }
 
@@ -308,7 +312,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(array &$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']))));
@@ -358,7 +362,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
@@ -405,7 +409,7 @@ protected function determineLimitValidationErrors(FormStateInterface &$form_stat
    * @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/FormValidatorInterface.php b/core/lib/Drupal/Core/Form/FormValidatorInterface.php
index 6f1cc52..a4a2ca6 100644
--- a/core/lib/Drupal/Core/Form/FormValidatorInterface.php
+++ b/core/lib/Drupal/Core/Form/FormValidatorInterface.php
@@ -18,14 +18,16 @@
    * Button-specific handlers are checked first. If none exist, the function
    * falls back to form-level handlers.
    *
-   * @param $form
+   * @param array $form
    *   An associative array containing the structure of the form.
-   * @param $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the form. If the user submitted the form by clicking
    *   a button with custom handler functions defined, those handlers will be
    *   stored here.
+   * @return
    */
-  public function executeValidateHandlers(&$form, FormStateInterface &$form_state);
+  public function executeValidateHandlers(array &$form, FormStateInterface $form_state
+  );
 
   /**
    * Validates user-submitted form data in the $form_state.
@@ -33,7 +35,7 @@ public function executeValidateHandlers(&$form, FormStateInterface &$form_state)
    * @param $form_id
    *   A unique string identifying the form for validation, submission,
    *   theming, and hook_form_alter functions.
-   * @param $form
+   * @param array $form
    *   An associative array containing the structure of the form, which is
    *   passed by reference. Form validation handlers are able to alter the form
    *   structure (like #process and #after_build callbacks during form building)
@@ -41,7 +43,7 @@ public function executeValidateHandlers(&$form, FormStateInterface &$form_state)
    *   structure, it is responsible for validating the values of changed form
    *   elements in $form_state->getValues() to prevent form submit handlers from
    *   receiving unvalidated values.
-   * @param $form_state
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current state of the form. The current user-submitted data is stored
    *   in $form_state->getValues(), though form validation functions are passed
    *   an explicit copy of the values for the sake of simplicity. Validation
@@ -51,7 +53,9 @@ public function executeValidateHandlers(&$form, FormStateInterface &$form_state)
    *   This technique is useful when validation requires file parsing,
    *   web service requests, or other expensive requests that should
    *   not be repeated in the submission step.
+   * @return
    */
-  public function validateForm($form_id, &$form, FormStateInterface &$form_state);
+  public function validateForm($form_id, array &$form, FormStateInterface $form_state
+  );
 
 }
