getValues() to prevent form submit handlers from * receiving non validated values. * @param $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 * handlers can also use $form_state to pass information on to submit * handlers. For example: * $form_state->set('data_for_submission', $data); * This technique is useful when validation requires file parsing, * web service requests, or other expensive requests that should * not be repeated in the submission step. */ public function validateForm($form_id, &$form, FormStateInterface &$form_state); /** * Sets a form_token error on the given form state. * * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. * * @return $this */ public function setInvalidTokenError(FormStateInterface $form_state); }