diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc index f924725..d779bd9 100644 --- a/core/includes/ajax.inc +++ b/core/includes/ajax.inc @@ -66,7 +66,7 @@ * return \Drupal::formBuilder()->getForm('ajax_example_simplest'); * } * - * function ajax_example_simplest($form, FormStateInterface &$form_state) { + * function ajax_example_simplest($form, FormStateInterface $form_state) { * $form = array(); * $form['changethis'] = array( * '#type' => 'select', @@ -238,7 +238,7 @@ * * @see ajax_pre_render_element() */ -function ajax_process_form($element, FormStateInterface &$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 f250b19..044417c 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -52,7 +52,7 @@ * return 'example_form'; * } * - * public function buildForm(array $form, FormStateInterface &$form_state) { + * public function buildForm(array $form, FormStateInterface $form_state) { * // Create a $form API array. * $form['phone_number'] = array( * '#type' => 'tel', @@ -61,11 +61,11 @@ * return $form; * } * - * public function validateForm(array &$form, FormStateInterface &$form_state) { + * public function validateForm(array &$form, FormStateInterface $form_state) { * // Validate submitted form data. * } * - * public function submitForm(array &$form, FormStateInterface &$form_state) { + * public function submitForm(array &$form, FormStateInterface $form_state) { * // Handle submitted form data. * } * } @@ -90,7 +90,7 @@ * $extra = '612-123-4567'; * $form = \Drupal::formBuilder()->getForm('Drupal\mymodule\Form\ExampleForm', $extra); * ... - * public function buildForm(array $form, FormStateInterface &$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'), @@ -141,7 +141,7 @@ * * @see \Drupal\Core\Form\FormBuilderInterface::buildForm(). */ -function drupal_build_form($form_id, FormStateInterface &$form_state) { +function drupal_build_form($form_id, FormStateInterface $form_state) { return \Drupal::formBuilder()->buildForm($form_id, $form_state); } @@ -153,7 +153,7 @@ function drupal_build_form($form_id, FormStateInterface &$form_state) { * * @see \Drupal\Core\Form\FormBuilderInterface::getCache(). */ -function form_get_cache($form_build_id, FormStateInterface &$form_state) { +function form_get_cache($form_build_id, FormStateInterface $form_state) { return \Drupal::formBuilder()->getCache($form_build_id, $form_state); } @@ -200,7 +200,7 @@ function form_set_cache($form_build_id, $form, $form_state) { * * @see module_load_include() */ -function form_load_include(FormStateInterface &$form_state, $type, $module, $name = NULL) { +function form_load_include(FormStateInterface $form_state, $type, $module, $name = NULL) { if (!isset($name)) { $name = $module; } @@ -226,7 +226,7 @@ function form_load_include(FormStateInterface &$form_state, $type, $module, $nam * * @see \Drupal\Core\Form\FormBuilderInterface::submitForm(). */ -function drupal_form_submit($form_arg, FormStateInterface &$form_state) { +function drupal_form_submit($form_arg, FormStateInterface $form_state) { \Drupal::formBuilder()->submitForm($form_arg, $form_state); } @@ -238,7 +238,7 @@ function drupal_form_submit($form_arg, FormStateInterface &$form_state) { * * @see \Drupal\Core\Form\FormBuilderInterface::retrieveForm(). */ -function drupal_retrieve_form($form_id, FormStateInterface &$form_state) { +function drupal_retrieve_form($form_id, FormStateInterface $form_state) { return \Drupal::formBuilder()->retrieveForm($form_id, $form_state); } @@ -250,7 +250,7 @@ function drupal_retrieve_form($form_id, FormStateInterface &$form_state) { * * @see \Drupal\Core\Form\FormBuilderInterface::processForm(). */ -function drupal_process_form($form_id, &$form, FormStateInterface &$form_state) { +function drupal_process_form($form_id, &$form, FormStateInterface $form_state) { \Drupal::formBuilder()->processForm($form_id, $form, $form_state); } @@ -276,7 +276,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, FormStateInterface &$form_state) { +function form_execute_handlers($type, &$form, FormStateInterface $form_state) { if ($type == 'submit') { \Drupal::service('form_submitter')->executeSubmitHandlers($form, $form_state); } @@ -293,7 +293,7 @@ function form_execute_handlers($type, &$form, FormStateInterface &$form_state) { * * @see \Drupal\Core\Form\FormErrorInterface::setErrorByName(). */ -function form_set_error($name, FormStateInterface &$form_state, $message = '') { +function form_set_error($name, FormStateInterface $form_state, $message = '') { \Drupal::formBuilder()->setErrorByName($name, $form_state, $message); } @@ -305,7 +305,7 @@ function form_set_error($name, FormStateInterface &$form_state, $message = '') { * * @see \Drupal\Core\Form\FormErrorInterface::getErrors() */ -function form_get_errors(FormStateInterface &$form_state) { +function form_get_errors(FormStateInterface $form_state) { return \Drupal::formBuilder()->getErrors($form_state); } @@ -317,7 +317,7 @@ function form_get_errors(FormStateInterface &$form_state) { * * @see \Drupal\Core\Form\FormErrorInterface::getError(). */ -function form_get_error($element, FormStateInterface &$form_state) { +function form_get_error($element, FormStateInterface $form_state) { return \Drupal::formBuilder()->getError($element, $form_state); } @@ -329,7 +329,7 @@ function form_get_error($element, FormStateInterface &$form_state) { * * @see \Drupal\Core\Form\FormErrorInterface::setError(). */ -function form_error(&$element, FormStateInterface &$form_state, $message = '') { +function form_error(&$element, FormStateInterface $form_state, $message = '') { \Drupal::formBuilder()->setError($element, $form_state, $message); } @@ -341,7 +341,7 @@ function form_error(&$element, FormStateInterface &$form_state, $message = '') { * * @see \Drupal\Core\Form\FormBuilderInterface::doBuildForm(). */ -function form_builder($form_id, &$element, FormStateInterface &$form_state) { +function form_builder($form_id, &$element, FormStateInterface $form_state) { return \Drupal::formBuilder()->doBuildForm($form_id, $element, $form_state); } @@ -362,7 +362,7 @@ function form_builder($form_id, &$element, FormStateInterface &$form_state) { * @param $form_state * The current state of the form, including submitted form values. */ -function form_state_values_clean(FormStateInterface &$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']); @@ -745,7 +745,7 @@ function form_type_token_value($element, $input = FALSE) { * * @see \Drupal\Core\Form\FormBuilderInterface::setValue(). */ -function form_set_value($element, $value, FormStateInterface &$form_state) { +function form_set_value($element, $value, FormStateInterface $form_state) { \Drupal::formBuilder()->setValue($element, $value, $form_state); } @@ -1386,7 +1386,7 @@ function form_process_checkboxes($element) { * @return * The processed element. */ -function form_process_actions($element, FormStateInterface &$form_state) { +function form_process_actions($element, FormStateInterface $form_state) { $element['#attributes']['class'][] = 'form-actions'; return $element; } @@ -1451,7 +1451,7 @@ function form_pre_render_actions_dropbutton(array $element) { * * @see form_validate_pattern() */ -function form_process_pattern($element, FormStateInterface &$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'; @@ -1471,7 +1471,7 @@ function form_process_pattern($element, FormStateInterface &$form_state) { * * @see form_process_pattern() */ -function form_validate_pattern($element, FormStateInterface &$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. @@ -1499,7 +1499,7 @@ function form_validate_pattern($element, FormStateInterface &$form_state) { * @return * The processed element. */ -function form_process_container($element, FormStateInterface &$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'); @@ -1703,7 +1703,7 @@ function form_process_tableselect($element) { * @see form_process_tableselect() * @see theme_tableselect() */ -function form_process_table($element, FormStateInterface &$form_state) { +function form_process_table($element, FormStateInterface $form_state) { if ($element['#tableselect']) { if ($element['#multiple']) { $value = is_array($element['#value']) ? $element['#value'] : array(); @@ -1823,7 +1823,7 @@ function form_process_table($element, FormStateInterface &$form_state) { * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ -function form_validate_table($element, FormStateInterface &$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'])) { @@ -1871,7 +1871,7 @@ function form_validate_table($element, FormStateInterface &$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, FormStateInterface &$form_state) { +function form_process_machine_name($element, FormStateInterface $form_state) { // We need to pass the langcode to the client. $language = \Drupal::languageManager()->getCurrentLanguage(); @@ -1955,7 +1955,7 @@ function form_process_machine_name($element, FormStateInterface &$form_state) { * * Note that #maxlength is validated by _form_validate() already. */ -function form_validate_machine_name(&$element, FormStateInterface &$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.')); @@ -2001,7 +2001,7 @@ function form_validate_machine_name(&$element, FormStateInterface &$form_state) * @return * The processed element. */ -function form_process_group(&$element, FormStateInterface &$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 @@ -2125,7 +2125,7 @@ function form_pre_render_group($element) { * @return * The processed element. */ -function form_process_vertical_tabs($element, FormStateInterface &$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( @@ -2220,7 +2220,7 @@ function template_preprocess_vertical_tabs(&$variables) { * @return array * The form element. */ -function form_process_autocomplete($element, FormStateInterface &$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(); @@ -2380,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, FormStateInterface &$form_state) { +function form_validate_email(&$element, FormStateInterface $form_state) { $value = trim($element['#value']); form_set_value($element, $value, $form_state); @@ -2451,7 +2451,7 @@ function form_pre_render_range($element) { * * Note that #required is validated by _form_validate() already. */ -function form_validate_number(&$element, FormStateInterface &$form_state) { +function form_validate_number(&$element, FormStateInterface $form_state) { $value = $element['#value']; if ($value === '') { return; @@ -2559,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, FormStateInterface &$form_state) { +function form_validate_url(&$element, FormStateInterface $form_state) { $value = trim($element['#value']); form_set_value($element, $value, $form_state); @@ -2571,7 +2571,7 @@ function form_validate_url(&$element, FormStateInterface &$form_state) { /** * Form element validation handler for #type 'color'. */ -function form_validate_color(&$element, FormStateInterface &$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/lib/Drupal/Core/Action/ConfigurableActionBase.php b/core/lib/Drupal/Core/Action/ConfigurableActionBase.php index eee01a9..e036880 100644 --- a/core/lib/Drupal/Core/Action/ConfigurableActionBase.php +++ b/core/lib/Drupal/Core/Action/ConfigurableActionBase.php @@ -50,7 +50,7 @@ public function setConfiguration(array $configuration) { /** * {@inheritdoc} */ - public function validateConfigurationForm(array &$form, FormStateInterface &$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 cc8aada..c982cf3 100644 --- a/core/lib/Drupal/Core/Condition/ConditionPluginBase.php +++ b/core/lib/Drupal/Core/Condition/ConditionPluginBase.php @@ -47,7 +47,7 @@ public function isNegated() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form['negate'] = array( '#type' => 'checkbox', '#title' => $this->t('Negate the condition.'), @@ -59,13 +59,13 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function validateConfigurationForm(array &$form, FormStateInterface &$form_state) { + public function validateConfigurationForm(array &$form, FormStateInterface $form_state) { } /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 c255a75..ef02177 100644 --- a/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php +++ b/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php @@ -103,7 +103,7 @@ public function render() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form[$this->entitiesKey] = array( '#type' => 'table', '#header' => $this->buildHeader(), @@ -139,14 +139,14 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$form_state) { + public function validateForm(array &$form, FormStateInterface $form_state) { // No validation. } /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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/Display/VariantBase.php b/core/lib/Drupal/Core/Display/VariantBase.php index f624533..b39d9b3 100644 --- a/core/lib/Drupal/Core/Display/VariantBase.php +++ b/core/lib/Drupal/Core/Display/VariantBase.php @@ -101,7 +101,7 @@ public function calculateDependencies() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form['label'] = array( '#type' => 'textfield', '#title' => $this->t('Label'), @@ -115,13 +115,13 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function validateConfigurationForm(array &$form, FormStateInterface &$form_state) { + public function validateConfigurationForm(array &$form, FormStateInterface $form_state) { } /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 828e387..fc5bd8e 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php @@ -54,7 +54,7 @@ public function getFormName() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form = parent::buildForm($form, $form_state); $form['#title'] = $this->getQuestion(); @@ -73,7 +73,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { // Do not attach fields to the confirm form. return $form; } @@ -81,7 +81,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$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 6e656d9..d2fc480 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityForm.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityForm.php @@ -48,7 +48,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$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; @@ -57,7 +57,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$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); @@ -71,7 +71,7 @@ public function validate(array $form, FormStateInterface &$form_state) { /** * Initialize the form state and the entity before the first form build. */ - protected function init(FormStateInterface &$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); @@ -86,7 +86,7 @@ protected function init(FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function getFormLangcode(FormStateInterface &$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 @@ -99,14 +99,14 @@ public function getFormLangcode(FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function isDefaultFormLangcode(FormStateInterface &$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, FormStateInterface &$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); @@ -123,14 +123,14 @@ protected function copyFormValuesToEntity(EntityInterface $entity, array $form, /** * {@inheritdoc} */ - public function getFormDisplay(FormStateInterface &$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, FormStateInterface &$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 5078b2e..4d5cf4d 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityFormInterface.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityFormInterface.php @@ -24,7 +24,7 @@ * @return \Drupal\Core\Entity\Display\EntityFormDisplayInterface. * The current form display. */ - public function getFormDisplay(FormStateInterface &$form_state); + public function getFormDisplay(FormStateInterface $form_state); /** * Sets the form display. @@ -37,6 +37,6 @@ public function getFormDisplay(FormStateInterface &$form_state); * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - public function setFormDisplay(EntityFormDisplayInterface $form_display, FormStateInterface &$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 d471027..4ecc887 100644 --- a/core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php +++ b/core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php @@ -97,7 +97,7 @@ * @param \Drupal\Core\Form\FormStateInterface $form_state * The form state. */ - public function buildForm(ContentEntityInterface $entity, array &$form, FormStateInterface &$form_state); + public function buildForm(ContentEntityInterface $entity, array &$form, FormStateInterface $form_state); /** * Validates submitted widget values and sets the corresponding form errors. @@ -126,7 +126,7 @@ public function buildForm(ContentEntityInterface $entity, array &$form, FormStat * @param \Drupal\Core\Form\FormStateInterface $form_state * The form state. */ - public function validateFormValues(ContentEntityInterface $entity, array &$form, FormStateInterface &$form_state); + public function validateFormValues(ContentEntityInterface $entity, array &$form, FormStateInterface $form_state); /** * Extracts field values from the submitted widget values into the entity. @@ -148,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, FormStateInterface &$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 6a9cd27..d01d4af 100644 --- a/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php +++ b/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php @@ -57,7 +57,7 @@ public function getFormName() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form = parent::buildForm($form, $form_state); $form['#title'] = $this->getQuestion(); @@ -76,7 +76,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$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 90d8008..f929a95 100644 --- a/core/lib/Drupal/Core/Entity/EntityForm.php +++ b/core/lib/Drupal/Core/Entity/EntityForm.php @@ -88,7 +88,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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'])) { @@ -110,13 +110,13 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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(FormStateInterface &$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; @@ -134,7 +134,7 @@ protected function init(FormStateInterface &$form_state) { * * @see \Drupal\Core\Entity\EntityForm::build() */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $entity = $this->entity; // Add a process callback. @@ -157,7 +157,7 @@ public function form(array $form, FormStateInterface &$form_state) { * * @see \Drupal\Core\Entity\EntityForm::form() */ - public function processForm($element, FormStateInterface &$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(); @@ -168,7 +168,7 @@ public function processForm($element, FormStateInterface &$form_state, $form) { /** * Returns the action form element for the current entity form. */ - protected function actionsElement(array $form, FormStateInterface &$form_state) { + protected function actionsElement(array $form, FormStateInterface $form_state) { $element = $this->actions($form, $form_state); if (isset($element['delete'])) { @@ -205,7 +205,7 @@ protected function actionsElement(array $form, FormStateInterface &$form_state) * @todo Consider introducing a 'preview' action here, since it is used by * many entity types. */ - protected function actions(array $form, FormStateInterface &$form_state) { + protected function actions(array $form, FormStateInterface $form_state) { // @todo Rename the action key from submit to save. $actions['submit'] = array( '#type' => 'submit', @@ -243,7 +243,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$form_state) { + public function validate(array $form, FormStateInterface $form_state) { $this->updateFormLangcode($form_state); // @todo Remove this. // Execute legacy global validation handlers. @@ -265,7 +265,7 @@ public function validate(array $form, FormStateInterface &$form_state) { * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - public function submit(array $form, FormStateInterface &$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); @@ -280,21 +280,21 @@ public function submit(array $form, FormStateInterface &$form_state) { * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - public function save(array $form, FormStateInterface &$form_state) { + public function save(array $form, FormStateInterface $form_state) { // @todo Perform common save operations. } /** * {@inheritdoc} */ - public function getFormLangcode(FormStateInterface &$form_state) { + public function getFormLangcode(FormStateInterface $form_state) { return $this->entity->language()->id; } /** * {@inheritdoc} */ - public function isDefaultFormLangcode(FormStateInterface &$form_state) { + public function isDefaultFormLangcode(FormStateInterface $form_state) { // The entity is not translatable, this is always the default language. return TRUE; } @@ -305,7 +305,7 @@ public function isDefaultFormLangcode(FormStateInterface &$form_state) { * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - protected function updateFormLangcode(FormStateInterface &$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']; @@ -315,7 +315,7 @@ protected function updateFormLangcode(FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function buildEntity(array $form, FormStateInterface &$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 @@ -348,7 +348,7 @@ public function buildEntity(array $form, FormStateInterface &$form_state) { * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - protected function copyFormValuesToEntity(EntityInterface $entity, array $form, FormStateInterface &$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. @@ -385,7 +385,7 @@ protected function prepareEntity() {} * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - protected function prepareInvokeAll($hook, FormStateInterface &$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/EntityFormInterface.php b/core/lib/Drupal/Core/Entity/EntityFormInterface.php index be29cbc..31f485a 100644 --- a/core/lib/Drupal/Core/Entity/EntityFormInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityFormInterface.php @@ -26,7 +26,7 @@ * @return string * The form language code. */ - public function getFormLangcode(FormStateInterface &$form_state); + public function getFormLangcode(FormStateInterface $form_state); /** * Checks whether the current form language matches the entity one. @@ -37,7 +37,7 @@ public function getFormLangcode(FormStateInterface &$form_state); * @return boolean * Returns TRUE if the entity form language matches the entity one. */ - public function isDefaultFormLangcode(FormStateInterface &$form_state); + public function isDefaultFormLangcode(FormStateInterface $form_state); /** * Sets the operation for this form. @@ -103,7 +103,7 @@ public function setEntity(EntityInterface $entity); * @return \Drupal\Core\Entity\EntityInterface * An updated copy of the form's entity object. */ - public function buildEntity(array $form, FormStateInterface &$form_state); + public function buildEntity(array $form, FormStateInterface $form_state); /** * Validates the submitted form values of the entity form. @@ -113,7 +113,7 @@ public function buildEntity(array $form, FormStateInterface &$form_state); * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - public function validate(array $form, FormStateInterface &$form_state); + public function validate(array $form, FormStateInterface $form_state); /** * Updates the form's entity by processing this submission's values. @@ -127,7 +127,7 @@ public function validate(array $form, FormStateInterface &$form_state); * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - public function submit(array $form, FormStateInterface &$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 5b0db97..ec58a7a 100644 --- a/core/lib/Drupal/Core/Field/FieldItemBase.php +++ b/core/lib/Drupal/Core/Field/FieldItemBase.php @@ -245,14 +245,14 @@ public function deleteRevision() { } /** * {@inheritdoc} */ - public function settingsForm(array &$form, FormStateInterface &$form_state, $has_data) { + public function settingsForm(array &$form, FormStateInterface $form_state, $has_data) { return array(); } /** * {@inheritdoc} */ - public function instanceSettingsForm(array $form, FormStateInterface &$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 168ffc4..76fb44e 100644 --- a/core/lib/Drupal/Core/Field/FieldItemInterface.php +++ b/core/lib/Drupal/Core/Field/FieldItemInterface.php @@ -254,7 +254,7 @@ public static function defaultInstanceSettings(); * @return * The form definition for the field settings. */ - public function settingsForm(array &$form, FormStateInterface &$form_state, $has_data); + public function settingsForm(array &$form, FormStateInterface $form_state, $has_data); /** * Returns a form for the instance-level settings. @@ -270,6 +270,6 @@ public function settingsForm(array &$form, FormStateInterface &$form_state, $has * @return array * The form definition for the field instance settings. */ - public function instanceSettingsForm(array $form, FormStateInterface &$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 f14b6e2..726572f 100644 --- a/core/lib/Drupal/Core/Field/FieldItemList.php +++ b/core/lib/Drupal/Core/Field/FieldItemList.php @@ -302,7 +302,7 @@ public function getConstraints() { /** * {@inheritdoc} */ - public function defaultValuesForm(array &$form, FormStateInterface &$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); @@ -317,7 +317,7 @@ public function defaultValuesForm(array &$form, FormStateInterface &$form_state) /** * {@inheritdoc} */ - public function defaultValuesFormValidate(array $element, array &$form, FormStateInterface &$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); @@ -332,7 +332,7 @@ public function defaultValuesFormValidate(array $element, array &$form, FormStat /** * {@inheritdoc} */ - public function defaultValuesFormSubmit(array $element, array &$form, FormStateInterface &$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); @@ -355,7 +355,7 @@ public static function processDefaultValue($default_value, ContentEntityInterfac * @return \Drupal\Core\Field\WidgetInterface * A Widget object. */ - protected function defaultValueWidget(FormStateInterface &$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 c87a8e4..ddfe26b 100644 --- a/core/lib/Drupal/Core/Field/FieldItemListInterface.php +++ b/core/lib/Drupal/Core/Field/FieldItemListInterface.php @@ -195,7 +195,7 @@ public function view($display_options = array()); * @return array * The form definition for the field instance default value. */ - public function defaultValuesForm(array &$form, FormStateInterface &$form_state); + public function defaultValuesForm(array &$form, FormStateInterface $form_state); /** * Validates the submitted default value. @@ -210,7 +210,7 @@ public function defaultValuesForm(array &$form, FormStateInterface &$form_state) * @param \Drupal\Core\Form\FormStateInterface $form_state * The form state of the (entire) configuration form. */ - public function defaultValuesFormValidate(array $element, array &$form, FormStateInterface &$form_state); + public function defaultValuesFormValidate(array $element, array &$form, FormStateInterface $form_state); /** * Processes the submitted default value. @@ -228,7 +228,7 @@ public function defaultValuesFormValidate(array $element, array &$form, FormStat * @return array * The field instance default value. */ - public function defaultValuesFormSubmit(array $element, array &$form, FormStateInterface &$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 46c14f8..a3ad53e 100644 --- a/core/lib/Drupal/Core/Field/FormatterBase.php +++ b/core/lib/Drupal/Core/Field/FormatterBase.php @@ -108,7 +108,7 @@ public function view(FieldItemListInterface $items) { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 6d21574..8596e6b 100644 --- a/core/lib/Drupal/Core/Field/FormatterInterface.php +++ b/core/lib/Drupal/Core/Field/FormatterInterface.php @@ -31,7 +31,7 @@ * @return array * The form elements for the formatter settings. */ - public function settingsForm(array $form, FormStateInterface &$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 6145621..0e43ac1 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/DecimalFormatter.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/DecimalFormatter.php @@ -42,7 +42,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 4b23469..dc0fe82 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php @@ -19,7 +19,7 @@ /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 e334b81..6819f79 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php @@ -65,7 +65,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition) /** * {@inheritdoc} */ - public function settingsForm(array &$form, FormStateInterface &$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 6cf377c..3f371fb 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php @@ -64,7 +64,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition) /** * {@inheritdoc} */ - public function settingsForm(array &$form, FormStateInterface &$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 014171a..28846bb 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/NumericItemBase.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/NumericItemBase.php @@ -30,7 +30,7 @@ public static function defaultInstanceSettings() { /** * {@inheritdoc} */ - public function instanceSettingsForm(array $form, FormStateInterface &$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 71b5013..3069af3 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/BooleanCheckboxWidget.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/BooleanCheckboxWidget.php @@ -37,7 +37,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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'), @@ -62,7 +62,7 @@ public function settingsSummary() { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$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 696fbd4..ce60ebc 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EmailDefaultWidget.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EmailDefaultWidget.php @@ -36,7 +36,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$form_state) { + public function settingsForm(array $form, FormStateInterface $form_state) { $element['placeholder'] = array( '#type' => 'textfield', '#title' => t('Placeholder'), @@ -66,7 +66,7 @@ public function settingsSummary() { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$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 63f755b..0f5020c 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/NumberWidget.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/NumberWidget.php @@ -39,7 +39,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$form_state) { + public function settingsForm(array $form, FormStateInterface $form_state) { $element['placeholder'] = array( '#type' => 'textfield', '#title' => t('Placeholder'), @@ -69,7 +69,7 @@ public function settingsSummary() { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$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(); @@ -114,7 +114,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen /** * {@inheritdoc} */ - public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface &$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 e9af7df..8658dd0 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php @@ -37,7 +37,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$form_state) { + public function settingsForm(array $form, FormStateInterface $form_state) { $element['rows'] = array( '#type' => 'number', '#title' => t('Rows'), @@ -72,7 +72,7 @@ public function settingsSummary() { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$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 4a7979f..853e661 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringWidget.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringWidget.php @@ -37,7 +37,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$form_state) { + public function settingsForm(array $form, FormStateInterface $form_state) { $element['size'] = array( '#type' => 'number', '#title' => t('Size of textfield'), @@ -72,7 +72,7 @@ public function settingsSummary() { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$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 5df36a2..8be947c 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/UriWidget.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/UriWidget.php @@ -37,7 +37,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$form_state) { + public function settingsForm(array $form, FormStateInterface $form_state) { $element['size'] = array( '#type' => 'number', '#title' => $this->t('Size of URI field'), @@ -72,7 +72,7 @@ public function settingsSummary() { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$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 507125d..89f501c 100644 --- a/core/lib/Drupal/Core/Field/WidgetBase.php +++ b/core/lib/Drupal/Core/Field/WidgetBase.php @@ -59,7 +59,7 @@ public function __construct($plugin_id, $plugin_definition, FieldDefinitionInter /** * {@inheritdoc} */ - public function form(FieldItemListInterface $items, array &$form, FormStateInterface &$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']; @@ -141,7 +141,7 @@ public function form(FieldItemListInterface $items, array &$form, FormStateInter * - AHAH-'add more' button * - table display and drag-n-drop value reordering */ - protected function formMultipleElements(FieldItemListInterface $items, array &$form, FormStateInterface &$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']; @@ -239,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, FormStateInterface &$form_state) { + public static function afterBuild(array $element, FormStateInterface $form_state) { $parents = $element['#field_parents']; $field_name = $element['#field_name']; @@ -253,7 +253,7 @@ public static function afterBuild(array $element, FormStateInterface &$form_stat /** * Submission handler for the "Add another item" button. */ - public static function addMoreSubmit(array $form, FormStateInterface &$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. @@ -297,7 +297,7 @@ public static function addMoreAjax(array $form, FormStateInterface $form_state) /** * Generates the form element for a single copy of the widget. */ - protected function formSingleElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$form_state) { + protected function formSingleElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { $entity = $items->getEntity(); $element += array( @@ -328,7 +328,7 @@ protected function formSingleElement(FieldItemListInterface $items, $delta, arra /** * {@inheritdoc} */ - public function extractFormValues(FieldItemListInterface $items, array $form, FormStateInterface &$form_state) { + public function extractFormValues(FieldItemListInterface $items, array $form, FormStateInterface $form_state) { $field_name = $this->fieldDefinition->getName(); // Extract the values from $form_state['values']. @@ -373,7 +373,7 @@ public function extractFormValues(FieldItemListInterface $items, array $form, Fo /** * {@inheritdoc} */ - public function flagErrors(FieldItemListInterface $items, ConstraintViolationListInterface $violations, array $form, FormStateInterface &$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); @@ -442,14 +442,14 @@ public function flagErrors(FieldItemListInterface $items, ConstraintViolationLis /** * {@inheritdoc} */ - public static function getWidgetState(array $parents, $field_name, FormStateInterface &$form_state) { + 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, FormStateInterface &$form_state, array $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); } @@ -474,7 +474,7 @@ protected static function getWidgetStateParents(array $parents, $field_name) { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$form_state) { + public function settingsForm(array $form, FormStateInterface $form_state) { return array(); } @@ -488,14 +488,14 @@ public function settingsSummary() { /** * {@inheritdoc} */ - public function errorElement(array $element, ConstraintViolationInterface $error, array $form, FormStateInterface &$form_state) { + public function errorElement(array $element, ConstraintViolationInterface $error, array $form, FormStateInterface $form_state) { return $element; } /** * {@inheritdoc} */ - public function massageFormValues(array $values, array $form, FormStateInterface &$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 26c1cbd..27a8baf 100644 --- a/core/lib/Drupal/Core/Field/WidgetBaseInterface.php +++ b/core/lib/Drupal/Core/Field/WidgetBaseInterface.php @@ -41,7 +41,7 @@ * @return array * The form element array created for this field. */ - public function form(FieldItemListInterface $items, array &$form, FormStateInterface &$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. @@ -55,7 +55,7 @@ public function form(FieldItemListInterface $items, array &$form, FormStateInter * @param \Drupal\Core\Form\FormStateInterface $form_state * The form state. */ - public function extractFormValues(FieldItemListInterface $items, array $form, FormStateInterface &$form_state); + public function extractFormValues(FieldItemListInterface $items, array $form, FormStateInterface $form_state); /** * Reports field-level validation errors against actual form elements. @@ -70,7 +70,7 @@ public function extractFormValues(FieldItemListInterface $items, array $form, Fo * @param \Drupal\Core\Form\FormStateInterface $form_state * The form state. */ - public function flagErrors(FieldItemListInterface $items, ConstraintViolationListInterface $violations, array $form, FormStateInterface &$form_state); + public function flagErrors(FieldItemListInterface $items, ConstraintViolationListInterface $violations, array $form, FormStateInterface $form_state); /** * Retrieves processing information about the widget from $form_state. @@ -90,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, FormStateInterface &$form_state); + public static function getWidgetState(array $parents, $field_name, FormStateInterface $form_state); /** * Stores processing information about the widget in $form_state. @@ -107,6 +107,6 @@ public static function getWidgetState(array $parents, $field_name, FormStateInte * The array of data to store. See getWidgetState() for the structure and * content of the array. */ - public static function setWidgetState(array $parents, $field_name, FormStateInterface &$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 4575907..307d8c1 100644 --- a/core/lib/Drupal/Core/Field/WidgetInterface.php +++ b/core/lib/Drupal/Core/Field/WidgetInterface.php @@ -37,7 +37,7 @@ * @return array * The form definition for the widget settings. */ - public function settingsForm(array $form, FormStateInterface &$form_state); + public function settingsForm(array $form, FormStateInterface $form_state); /** * Returns a short summary for the current widget settings. @@ -107,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, FormStateInterface &$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. @@ -130,7 +130,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen * 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, FormStateInterface &$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. @@ -151,6 +151,6 @@ public function errorElement(array $element, ConstraintViolationInterface $viola * @return array * An array of field values, keyed by delta. */ - public function massageFormValues(array $values, array $form, FormStateInterface &$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 1249e72..818f345 100644 --- a/core/lib/Drupal/Core/FileTransfer/Form/FileTransferAuthorizeForm.php +++ b/core/lib/Drupal/Core/FileTransfer/Form/FileTransferAuthorizeForm.php @@ -26,7 +26,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { // If possible, we want to post this form securely via HTTPS. $form['#https'] = TRUE; @@ -139,7 +139,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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') { @@ -169,7 +169,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 5091c13..f58bc11 100644 --- a/core/lib/Drupal/Core/Form/ConfigFormBase.php +++ b/core/lib/Drupal/Core/Form/ConfigFormBase.php @@ -38,7 +38,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form['actions']['#type'] = 'actions'; $form['actions']['submit'] = array( '#type' => 'submit', @@ -55,7 +55,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 cb0eb7e..2896690 100644 --- a/core/lib/Drupal/Core/Form/ConfirmFormBase.php +++ b/core/lib/Drupal/Core/Form/ConfirmFormBase.php @@ -43,7 +43,7 @@ public function getFormName() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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 d583014..85470e7 100644 --- a/core/lib/Drupal/Core/Form/FormBase.php +++ b/core/lib/Drupal/Core/Form/FormBase.php @@ -61,7 +61,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$form_state) { + public function validateForm(array &$form, FormStateInterface $form_state) { // Validation is optional. } @@ -198,7 +198,7 @@ protected function errorHandler() { * * @return $this */ - protected function setFormError($name, FormStateInterface &$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/FormInterface.php b/core/lib/Drupal/Core/Form/FormInterface.php index 8d6d50f..1da569f 100644 --- a/core/lib/Drupal/Core/Form/FormInterface.php +++ b/core/lib/Drupal/Core/Form/FormInterface.php @@ -31,7 +31,7 @@ public function getFormId(); * @return array * The form structure. */ - public function buildForm(array $form, FormStateInterface &$form_state); + public function buildForm(array $form, FormStateInterface $form_state); /** * Form validation handler. @@ -41,7 +41,7 @@ public function buildForm(array $form, FormStateInterface &$form_state); * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - public function validateForm(array &$form, FormStateInterface &$form_state); + public function validateForm(array &$form, FormStateInterface $form_state); /** * Form submission handler. @@ -51,6 +51,6 @@ public function validateForm(array &$form, FormStateInterface &$form_state); * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - public function submitForm(array &$form, FormStateInterface &$form_state); + public function submitForm(array &$form, FormStateInterface $form_state); } diff --git a/core/lib/Drupal/Core/ImageToolkit/ImageToolkitInterface.php b/core/lib/Drupal/Core/ImageToolkit/ImageToolkitInterface.php index 5f9500a..b50331a 100644 --- a/core/lib/Drupal/Core/ImageToolkit/ImageToolkitInterface.php +++ b/core/lib/Drupal/Core/ImageToolkit/ImageToolkitInterface.php @@ -58,7 +58,7 @@ public function settingsForm(); * * @see system_image_toolkit_settings_submit() */ - public function settingsFormSubmit($form, FormStateInterface &$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 620046a..a5c0737 100644 --- a/core/lib/Drupal/Core/Installer/Form/SelectLanguageForm.php +++ b/core/lib/Drupal/Core/Installer/Form/SelectLanguageForm.php @@ -29,7 +29,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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']; } @@ -97,7 +97,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $install /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 5db953b..e16c10e 100644 --- a/core/lib/Drupal/Core/Installer/Form/SelectProfileForm.php +++ b/core/lib/Drupal/Core/Installer/Form/SelectProfileForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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(); @@ -88,7 +88,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $install /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 74a609e..491a1d9 100644 --- a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php +++ b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php @@ -89,7 +89,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form['#title'] = $this->t('Configure site'); // Warn about settings.php permissions risk @@ -228,7 +228,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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); } @@ -237,7 +237,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 727a01b..1020620 100644 --- a/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php +++ b/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php @@ -27,7 +27,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $conf_path = './' . conf_path(FALSE); $settings_file = $conf_path . '/settings.php'; @@ -115,7 +115,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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(); @@ -135,7 +135,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 fd05354..993c841 100644 --- a/core/lib/Drupal/Core/Plugin/PluginFormInterface.php +++ b/core/lib/Drupal/Core/Plugin/PluginFormInterface.php @@ -27,7 +27,7 @@ * @return array * The form structure. */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state); + public function buildConfigurationForm(array $form, FormStateInterface $form_state); /** * Form validation handler. @@ -37,7 +37,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - public function validateConfigurationForm(array &$form, FormStateInterface &$form_state); + public function validateConfigurationForm(array &$form, FormStateInterface $form_state); /** * Form submission handler. @@ -47,6 +47,6 @@ public function validateConfigurationForm(array &$form, FormStateInterface &$for * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 e071443..574ec6c 100644 --- a/core/lib/Drupal/Core/Update/Form/UpdateScriptSelectionForm.php +++ b/core/lib/Drupal/Core/Update/Form/UpdateScriptSelectionForm.php @@ -25,7 +25,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $count = 0; $incompatible_count = 0; $form['start'] = array( @@ -128,7 +128,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 9bf1fa7..6d8e4aa 100644 --- a/core/modules/action/src/ActionAddForm.php +++ b/core/modules/action/src/ActionAddForm.php @@ -55,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, FormStateInterface &$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 ddcd2b4..23b7f07 100644 --- a/core/modules/action/src/ActionFormBase.php +++ b/core/modules/action/src/ActionFormBase.php @@ -54,7 +54,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $this->plugin = $this->entity->getPlugin(); return parent::buildForm($form, $form_state); } @@ -62,7 +62,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form['label'] = array( '#type' => 'textfield', '#title' => $this->t('Label'), @@ -114,7 +114,7 @@ public function exists($id) { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$form_state) { + protected function actions(array $form, FormStateInterface $form_state) { $actions = parent::actions($form, $form_state); unset($actions['delete']); return $actions; @@ -123,7 +123,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$form_state) { + public function validate(array $form, FormStateInterface $form_state) { parent::validate($form, $form_state); if ($this->plugin instanceof PluginFormInterface) { @@ -134,7 +134,7 @@ public function validate(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$form_state) { + public function submit(array $form, FormStateInterface $form_state) { parent::submit($form, $form_state); if ($this->plugin instanceof PluginFormInterface) { @@ -146,7 +146,7 @@ public function submit(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 1e748c8..81c08f4 100644 --- a/core/modules/action/src/Form/ActionAdminManageForm.php +++ b/core/modules/action/src/Form/ActionAdminManageForm.php @@ -54,7 +54,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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')) { @@ -88,7 +88,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 8b45c48..3c300c3 100644 --- a/core/modules/action/src/Form/ActionDeleteForm.php +++ b/core/modules/action/src/Form/ActionDeleteForm.php @@ -40,7 +40,7 @@ public function getCancelRoute() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 7e426f3..a9a00a9 100644 --- a/core/modules/action/src/Plugin/Action/EmailAction.php +++ b/core/modules/action/src/Plugin/Action/EmailAction.php @@ -115,7 +115,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form['recipient'] = array( '#type' => 'textfield', '#title' => t('Recipient'), @@ -144,7 +144,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function validateConfigurationForm(array &$form, FormStateInterface &$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]'))); @@ -154,7 +154,7 @@ public function validateConfigurationForm(array &$form, FormStateInterface &$for /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 8f196b1..40ba621 100644 --- a/core/modules/action/src/Plugin/Action/GotoAction.php +++ b/core/modules/action/src/Plugin/Action/GotoAction.php @@ -95,7 +95,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form['url'] = array( '#type' => 'textfield', '#title' => t('URL'), @@ -109,7 +109,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 47f5d92..ece48fa 100644 --- a/core/modules/action/src/Plugin/Action/MessageAction.php +++ b/core/modules/action/src/Plugin/Action/MessageAction.php @@ -69,7 +69,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form['message'] = array( '#type' => 'textarea', '#title' => t('Message'), @@ -84,7 +84,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 09fb223..6d9d3ea 100644 --- a/core/modules/aggregator/src/FeedForm.php +++ b/core/modules/aggregator/src/FeedForm.php @@ -22,7 +22,7 @@ class FeedForm extends ContentEntityForm { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$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. @@ -42,7 +42,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$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'); @@ -61,7 +61,7 @@ public function validate(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 27056ae..cd1272c 100644 --- a/core/modules/aggregator/src/Form/FeedDeleteForm.php +++ b/core/modules/aggregator/src/Form/FeedDeleteForm.php @@ -40,7 +40,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 91921c2..b5021be 100644 --- a/core/modules/aggregator/src/Form/FeedItemsDeleteForm.php +++ b/core/modules/aggregator/src/Form/FeedItemsDeleteForm.php @@ -40,7 +40,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 8c9a8fc..89068dd 100644 --- a/core/modules/aggregator/src/Form/OpmlFeedAdd.php +++ b/core/modules/aggregator/src/Form/OpmlFeedAdd.php @@ -67,7 +67,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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)); @@ -102,7 +102,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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)) { @@ -113,7 +113,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 b5f3270..3177742 100644 --- a/core/modules/aggregator/src/Form/SettingsForm.php +++ b/core/modules/aggregator/src/Form/SettingsForm.php @@ -99,7 +99,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('aggregator.settings'); // Global aggregator settings. @@ -188,7 +188,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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) { @@ -199,7 +199,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 aaacab4..eb6ad36 100644 --- a/core/modules/aggregator/src/Plugin/AggregatorPluginSettingsBase.php +++ b/core/modules/aggregator/src/Plugin/AggregatorPluginSettingsBase.php @@ -36,7 +36,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function validateConfigurationForm(array &$form, FormStateInterface &$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 01e8753..38f4756 100644 --- a/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php +++ b/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php @@ -117,7 +117,7 @@ protected function blockAccess(AccountInterface $account) { /** * {@inheritdoc} */ - public function blockForm($form, FormStateInterface &$form_state) { + public function blockForm($form, FormStateInterface $form_state) { $feeds = $this->feedStorage->loadMultiple(); $options = array(); foreach ($feeds as $feed) { @@ -142,7 +142,7 @@ public function blockForm($form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function blockSubmit($form, FormStateInterface &$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 d404988..07414eb 100644 --- a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php +++ b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php @@ -94,7 +94,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$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); @@ -150,7 +150,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 102ba9c..9ab50bf 100644 --- a/core/modules/aggregator/src/Plugin/views/field/TitleLink.php +++ b/core/modules/aggregator/src/Plugin/views/field/TitleLink.php @@ -46,7 +46,7 @@ protected function defineOptions() { /** * {@inheritdoc} */ - public function buildOptionsForm(&$form, FormStateInterface &$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 4729114..ff59828 100644 --- a/core/modules/aggregator/src/Plugin/views/row/Rss.php +++ b/core/modules/aggregator/src/Plugin/views/row/Rss.php @@ -52,7 +52,7 @@ protected function defineOptions() { /** * {@inheritdoc} */ - public function buildOptionsForm(&$form, FormStateInterface &$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 aeffd18..b4f5fd5 100644 --- a/core/modules/aggregator/tests/modules/aggregator_test/src/Plugin/aggregator/processor/TestProcessor.php +++ b/core/modules/aggregator/tests/modules/aggregator_test/src/Plugin/aggregator/processor/TestProcessor.php @@ -67,7 +67,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $processors = $this->configFactory->get('aggregator.settings')->get('processors'); $info = $this->getPluginDefinition(); @@ -91,7 +91,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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/ban/src/Form/BanAdmin.php b/core/modules/ban/src/Form/BanAdmin.php index ba237ce..bd87ba8 100644 --- a/core/modules/ban/src/Form/BanAdmin.php +++ b/core/modules/ban/src/Form/BanAdmin.php @@ -55,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, FormStateInterface &$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(); @@ -104,7 +104,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $default /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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.')); @@ -120,7 +120,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 b47f7ac..c3f6c74 100644 --- a/core/modules/ban/src/Form/BanDelete.php +++ b/core/modules/ban/src/Form/BanDelete.php @@ -79,7 +79,7 @@ public function getCancelRoute() { * @param string $ban_id * The IP address record ID to unban. */ - public function buildForm(array $form, FormStateInterface &$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(); } @@ -89,7 +89,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $ban_id /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 83560fb..b263995 100644 --- a/core/modules/block/src/BlockBase.php +++ b/core/modules/block/src/BlockBase.php @@ -208,7 +208,7 @@ protected function blockAccess(AccountInterface $account) { * * @see \Drupal\block\BlockBase::blockForm() */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $definition = $this->getPluginDefinition(); $form['provider'] = array( '#type' => 'value', @@ -333,7 +333,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function blockForm($form, FormStateInterface &$form_state) { + public function blockForm($form, FormStateInterface $form_state) { return array(); } @@ -345,7 +345,7 @@ public function blockForm($form, FormStateInterface &$form_state) { * * @see \Drupal\block\BlockBase::blockValidate() */ - public function validateConfigurationForm(array &$form, FormStateInterface &$form_state) { + public function validateConfigurationForm(array &$form, FormStateInterface $form_state) { // Remove the admin_label form item element value so it will not persist. unset($form_state['values']['admin_label']); @@ -366,7 +366,7 @@ public function validateConfigurationForm(array &$form, FormStateInterface &$for /** * {@inheritdoc} */ - public function blockValidate($form, FormStateInterface &$form_state) {} + public function blockValidate($form, FormStateInterface $form_state) {} /** * {@inheritdoc} @@ -376,7 +376,7 @@ public function blockValidate($form, FormStateInterface &$form_state) {} * * @see \Drupal\block\BlockBase::blockSubmit() */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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']; @@ -397,7 +397,7 @@ public function submitConfigurationForm(array &$form, FormStateInterface &$form_ /** * {@inheritdoc} */ - public function blockSubmit($form, FormStateInterface &$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 6c672b7..de7aa10 100644 --- a/core/modules/block/src/BlockForm.php +++ b/core/modules/block/src/BlockForm.php @@ -54,7 +54,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $entity = $this->entity; // Store theme settings in $form_state for use below. @@ -127,7 +127,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * Handles switching the available regions based on the selected theme. */ - public function themeSwitch($form, FormStateInterface &$form_state) { + public function themeSwitch($form, FormStateInterface $form_state) { $form['region']['#options'] = system_region_list($form_state['values']['theme'], REGIONS_VISIBLE); return $form['region']; } @@ -135,7 +135,7 @@ public function themeSwitch($form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$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; @@ -144,7 +144,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$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 @@ -159,7 +159,7 @@ public function validate(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$form_state) { + public function submit(array $form, FormStateInterface $form_state) { parent::submit($form, $form_state); $entity = $this->entity; diff --git a/core/modules/block/src/BlockListBuilder.php b/core/modules/block/src/BlockListBuilder.php index 644af01..1b26b9f 100644 --- a/core/modules/block/src/BlockListBuilder.php +++ b/core/modules/block/src/BlockListBuilder.php @@ -134,7 +134,7 @@ public function getFormId() { * * Form constructor for the main block administration form. */ - public function buildForm(array $form, FormStateInterface &$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'); @@ -389,7 +389,7 @@ public function getDefaultOperations(EntityInterface $entity) { /** * Implements \Drupal\Core\Form\FormInterface::validateForm(). */ - public function validateForm(array &$form, FormStateInterface &$form_state) { + public function validateForm(array &$form, FormStateInterface $form_state) { // No validation. } @@ -398,7 +398,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { * * Form submission handler for the main block administration form. */ - public function submitForm(array &$form, FormStateInterface &$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 0914f0e..05d0ce5 100644 --- a/core/modules/block/src/BlockPluginInterface.php +++ b/core/modules/block/src/BlockPluginInterface.php @@ -95,7 +95,7 @@ public function setConfigurationValue($key, $value); * @return array $form * The renderable form array representing the entire configuration form. */ - public function blockForm($form, FormStateInterface &$form_state); + public function blockForm($form, FormStateInterface $form_state); /** * Adds block type-specific validation for the block form. @@ -112,7 +112,7 @@ public function blockForm($form, FormStateInterface &$form_state); * @see \Drupal\block\BlockPluginInterface::blockForm() * @see \Drupal\block\BlockPluginInterface::blockSubmit() */ - public function blockValidate($form, FormStateInterface &$form_state); + public function blockValidate($form, FormStateInterface $form_state); /** * Adds block type-specific submission handling for the block form. @@ -129,7 +129,7 @@ public function blockValidate($form, FormStateInterface &$form_state); * @see \Drupal\block\BlockPluginInterface::blockForm() * @see \Drupal\block\BlockPluginInterface::blockValidate() */ - public function blockSubmit($form, FormStateInterface &$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 6d7d203..89ebef3 100644 --- a/core/modules/block/src/Form/BlockDeleteForm.php +++ b/core/modules/block/src/Form/BlockDeleteForm.php @@ -40,7 +40,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 5e6cb3a..0e2e968 100644 --- a/core/modules/block/src/Plugin/views/display/Block.php +++ b/core/modules/block/src/Plugin/views/display/Block.php @@ -141,7 +141,7 @@ public function optionsSummary(&$categories, &$options) { /** * Provide the default form for setting options. */ - public function buildOptionsForm(&$form, FormStateInterface &$form_state) { + public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); switch ($form_state['section']) { @@ -202,7 +202,7 @@ public function buildOptionsForm(&$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, FormStateInterface &$form_state) { + public function submitOptionsForm(&$form, FormStateInterface $form_state) { parent::submitOptionsForm($form, $form_state); switch ($form_state['section']) { case 'block_description': @@ -231,7 +231,7 @@ public function submitOptionsForm(&$form, FormStateInterface &$form_state) { * * @see \Drupal\views\Plugin\Block\ViewsBlock::blockForm() */ - public function blockForm(ViewsBlock $block, array &$form, FormStateInterface &$form_state) { + public function blockForm(ViewsBlock $block, array &$form, FormStateInterface $form_state) { $allow_settings = array_filter($this->getOption('allow')); $block_configuration = $block->getConfiguration(); @@ -273,7 +273,7 @@ public function blockForm(ViewsBlock $block, array &$form, FormStateInterface &$ * * @see \Drupal\views\Plugin\Block\ViewsBlock::blockValidate() */ - public function blockValidate(ViewsBlock $block, array $form, FormStateInterface &$form_state) { + public function blockValidate(ViewsBlock $block, array $form, FormStateInterface $form_state) { } /** @@ -288,7 +288,7 @@ public function blockValidate(ViewsBlock $block, array $form, FormStateInterface * * * @see \Drupal\views\Plugin\Block\ViewsBlock::blockSubmit() */ - public function blockSubmit(ViewsBlock $block, $form, FormStateInterface &$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/tests/modules/block_test/src/Plugin/Block/TestBlockInstantiation.php b/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestBlockInstantiation.php index 544d7b8..255ba63 100644 --- a/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestBlockInstantiation.php +++ b/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestBlockInstantiation.php @@ -40,7 +40,7 @@ protected function blockAccess(AccountInterface $account) { /** * {@inheritdoc} */ - public function blockForm($form, FormStateInterface &$form_state) { + public function blockForm($form, FormStateInterface $form_state) { $form['display_message'] = array( '#type' => 'textfield', '#title' => t('Display message'), @@ -52,7 +52,7 @@ public function blockForm($form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function blockSubmit($form, FormStateInterface &$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 67f7971..1524f42 100644 --- a/core/modules/block_content/src/BlockContentForm.php +++ b/core/modules/block_content/src/BlockContentForm.php @@ -84,7 +84,7 @@ protected function prepareEntity() { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $block = $this->entity; $account = $this->currentUser(); @@ -175,7 +175,7 @@ public function form(array $form, FormStateInterface &$form_state) { * form state's entity with the current step's values before proceeding to the * next step. */ - public function submit(array $form, FormStateInterface &$form_state) { + public function submit(array $form, FormStateInterface $form_state) { // Build the block object from the submitted values. $block = parent::submit($form, $form_state); @@ -190,7 +190,7 @@ public function submit(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$form_state) { + public function save(array $form, FormStateInterface $form_state) { $block = $this->entity; $insert = $block->isNew(); $block->save(); @@ -237,7 +237,7 @@ public function save(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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 deaf1bf..ca7a6d9 100644 --- a/core/modules/block_content/src/BlockContentTranslationHandler.php +++ b/core/modules/block_content/src/BlockContentTranslationHandler.php @@ -19,7 +19,7 @@ class BlockContentTranslationHandler extends ContentTranslationHandler { /** * {@inheritdoc} */ - public function entityFormAlter(array &$form, FormStateInterface &$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 6532e59..025d673 100644 --- a/core/modules/block_content/src/BlockContentTypeForm.php +++ b/core/modules/block_content/src/BlockContentTypeForm.php @@ -19,7 +19,7 @@ class BlockContentTypeForm extends EntityForm { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form = parent::form($form, $form_state); $block_type = $this->entity; @@ -88,7 +88,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * Overrides \Drupal\Core\Entity\EntityForm::save(). */ - public function save(array $form, FormStateInterface &$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 7d5e22b..3326dcf 100644 --- a/core/modules/block_content/src/Form/BlockContentDeleteForm.php +++ b/core/modules/block_content/src/Form/BlockContentDeleteForm.php @@ -40,7 +40,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $instances = $this->entity->getInstances(); $form['message'] = array( @@ -54,7 +54,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 e9c9199..34ae5b9 100644 --- a/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php +++ b/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php @@ -68,7 +68,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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 = '
' . 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())) . '
'; @@ -83,7 +83,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 3dd7626..8a5a409 100644 --- a/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php +++ b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php @@ -121,7 +121,7 @@ public function defaultConfiguration() { * * Adds body and description fields to the block configuration form. */ - public function blockForm($form, FormStateInterface &$form_state) { + public function blockForm($form, FormStateInterface $form_state) { $form['block_content']['view_mode'] = array( '#type' => 'select', '#options' => $this->entityManager->getViewModeOptions('block_content'), @@ -136,7 +136,7 @@ public function blockForm($form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function blockSubmit($form, FormStateInterface &$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 e8c2781..6064160 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -159,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, FormStateInterface &$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'); @@ -194,7 +194,7 @@ function book_form_node_form_alter(&$form, FormStateInterface &$form_state, $for * * @todo: Remove this in favor of an entity field. */ -function book_node_builder($entity_type, NodeInterface $entity, &$form, FormStateInterface &$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. @@ -215,7 +215,7 @@ function book_node_builder($entity_type, NodeInterface $entity, &$form, FormStat * @see book_form_update() * @see book_form_node_form_alter() */ -function book_pick_book_nojs_submit($form, FormStateInterface &$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; @@ -310,7 +310,7 @@ function book_node_predelete(EntityInterface $node) { /** * Implements hook_node_prepare_form(). */ -function book_node_prepare_form(NodeInterface $node, $operation, FormStateInterface &$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 7c3c787..45f9adf 100644 --- a/core/modules/book/src/BookManager.php +++ b/core/modules/book/src/BookManager.php @@ -169,7 +169,7 @@ protected function findChildrenRelativeDepth(array $book_link) { /** * {@inheritdoc} */ - public function addFormElements(array $form, FormStateInterface &$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 0db041e..72ca61e 100644 --- a/core/modules/book/src/BookManagerInterface.php +++ b/core/modules/book/src/BookManagerInterface.php @@ -216,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, FormStateInterface &$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 0ccebe9..9a342f0 100644 --- a/core/modules/book/src/Form/BookAdminEditForm.php +++ b/core/modules/book/src/Form/BookAdminEditForm.php @@ -69,7 +69,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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); @@ -84,7 +84,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, NodeInte /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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.')); } @@ -93,7 +93,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 38978ea..82a07aa 100644 --- a/core/modules/book/src/Form/BookOutlineForm.php +++ b/core/modules/book/src/Form/BookOutlineForm.php @@ -65,7 +65,7 @@ public function getBaseFormID() { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form['#title'] = $this->entity->label(); if (!isset($this->entity->book)) { @@ -88,7 +88,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$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'); @@ -101,7 +101,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { * * @see book_remove_button_submit() */ - public function submit(array $form, FormStateInterface &$form_state) { + public function submit(array $form, FormStateInterface $form_state) { $form_state['redirect_route'] = array( 'route_name' => 'node.view', 'route_parameters' => array( @@ -133,7 +133,7 @@ public function submit(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function delete(array $form, FormStateInterface &$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 3ac3ce2..16a719d 100644 --- a/core/modules/book/src/Form/BookRemoveForm.php +++ b/core/modules/book/src/Form/BookRemoveForm.php @@ -62,7 +62,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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); } @@ -104,7 +104,7 @@ public function getCancelRoute() { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 c597929..4a7535e 100644 --- a/core/modules/book/src/Form/BookSettingsForm.php +++ b/core/modules/book/src/Form/BookSettingsForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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( @@ -51,7 +51,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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')))); @@ -63,7 +63,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 bfa99b7..51d0a0d 100644 --- a/core/modules/book/src/Plugin/Block/BookNavigationBlock.php +++ b/core/modules/book/src/Plugin/Block/BookNavigationBlock.php @@ -85,7 +85,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - function blockForm($form, FormStateInterface &$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'), @@ -104,7 +104,7 @@ function blockForm($form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function blockSubmit($form, FormStateInterface &$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 a77f790..a5084fd 100644 --- a/core/modules/ckeditor/src/CKEditorPluginConfigurableInterface.php +++ b/core/modules/ckeditor/src/CKEditorPluginConfigurableInterface.php @@ -45,6 +45,6 @@ * @return array|FALSE * A render array for the settings form, or FALSE if there is none. */ - public function settingsForm(array $form, FormStateInterface &$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 80dd726..289c906 100644 --- a/core/modules/ckeditor/src/CKEditorPluginManager.php +++ b/core/modules/ckeditor/src/CKEditorPluginManager.php @@ -153,7 +153,7 @@ public function getButtons() { * @param \Drupal\editor\Entity\Editor $editor * A configured text editor object. */ - public function injectPluginSettingsForm(array &$form, FormStateInterface &$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 7040fd0..4a1329c 100644 --- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php +++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php @@ -67,7 +67,7 @@ public function getButtons() { * @see \Drupal\editor\Form\EditorImageDialog * @see editor_image_upload_settings_form() */ - public function settingsForm(array $form, FormStateInterface &$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'; @@ -84,7 +84,7 @@ public function settingsForm(array $form, FormStateInterface &$form_state, Edito * @see \Drupal\editor\Form\EditorImageDialog * @see editor_image_upload_settings_form() */ - function validateImageUploadSettings(array $element, FormStateInterface &$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 a501145..963436d 100644 --- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php +++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php @@ -67,7 +67,7 @@ public function getButtons() { /** * Implements \Drupal\ckeditor\Plugin\CKEditorPluginConfigurableInterface::settingsForm(). */ - public function settingsForm(array $form, FormStateInterface &$form_state, Editor $editor) { + public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor) { // Defaults. $config = array('styles' => ''); $settings = $editor->getSettings(); @@ -95,7 +95,7 @@ public function settingsForm(array $form, FormStateInterface &$form_state, Edito /** * #element_validate handler for the "styles" element in settingsForm(). */ - public function validateStylesValue(array $element, FormStateInterface &$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 f8e5761..b377f73 100644 --- a/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php +++ b/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php @@ -128,7 +128,7 @@ public function getDefaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$form_state, EditorEntity $editor) { + public function settingsForm(array $form, FormStateInterface $form_state, EditorEntity $editor) { $settings = $editor->getSettings(); $ckeditor_settings_toolbar = array( @@ -235,7 +235,7 @@ public function settingsForm(array $form, FormStateInterface &$form_state, Edito /** * {@inheritdoc} */ - public function settingsFormSubmit(array $form, FormStateInterface &$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 8216e5b..4c43cb7 100644 --- a/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextualAndButton.php +++ b/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextualAndButton.php @@ -62,7 +62,7 @@ function getFile() { /** * Implements \Drupal\ckeditor\Plugin\CKEditorPluginConfigurableInterface::settingsForm(). */ - function settingsForm(array $form, FormStateInterface &$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 fb2854a..1f03e18 100644 --- a/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -45,7 +45,7 @@ function color_theme() { /** * Implements hook_form_FORM_ID_alter(). */ -function color_form_system_theme_settings_alter(&$form, FormStateInterface &$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', @@ -167,7 +167,7 @@ function color_get_palette($theme, $default = FALSE) { * @see color_scheme_form_validate() * @see color_scheme_form_submit() */ -function color_scheme_form($complete_form, FormStateInterface &$form_state, $theme) { +function color_scheme_form($complete_form, FormStateInterface $form_state, $theme) { $base = drupal_get_path('module', 'color'); $info = color_get_info($theme); @@ -330,7 +330,7 @@ function color_valid_hexadecimal_string($color) { * * @see color_scheme_form_submit() */ -function color_scheme_form_validate($form, FormStateInterface &$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)) { @@ -344,7 +344,7 @@ function color_scheme_form_validate($form, FormStateInterface &$form_state) { * * @see color_scheme_form_validate() */ -function color_scheme_form_submit($form, FormStateInterface &$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 6970521..ac007a3 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -870,13 +870,13 @@ function comment_user_predelete($account) { * * @param \Drupal\comment\CommentInterface $comment * The comment entity to preview. - * @param Drupal\Core\Form\FormStateInterface &$form_state + * @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, FormStateInterface &$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 95ad19a..9701e49 100644 --- a/core/modules/comment/src/CommentForm.php +++ b/core/modules/comment/src/CommentForm.php @@ -57,7 +57,7 @@ public function __construct(EntityManagerInterface $entity_manager, AccountInter /** * {@inheritdoc} */ - protected function init(FormStateInterface &$form_state) { + protected function init(FormStateInterface $form_state) { $comment = $this->entity; // Make the comment inherit the current content language unless specifically @@ -73,7 +73,7 @@ protected function init(FormStateInterface &$form_state) { /** * Overrides Drupal\Core\Entity\EntityForm::form(). */ - public function form(array $form, FormStateInterface &$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()); @@ -219,7 +219,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * Overrides Drupal\Core\Entity\EntityForm::actions(). */ - protected function actions(array $form, FormStateInterface &$form_state) { + protected function actions(array $form, FormStateInterface $form_state) { $element = parent::actions($form, $form_state); /* @var \Drupal\comment\CommentInterface $comment */ $comment = $this->entity; @@ -256,7 +256,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * Overrides Drupal\Core\Entity\EntityForm::validate(). */ - public function validate(array $form, FormStateInterface &$form_state) { + public function validate(array $form, FormStateInterface $form_state) { parent::validate($form, $form_state); $entity = $this->entity; @@ -290,7 +290,7 @@ public function validate(array $form, FormStateInterface &$form_state) { /** * Overrides EntityForm::buildEntity(). */ - public function buildEntity(array $form, FormStateInterface &$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()); @@ -305,7 +305,7 @@ public function buildEntity(array $form, FormStateInterface &$form_state) { /** * Overrides Drupal\Core\Entity\EntityForm::submit(). */ - public function submit(array $form, FormStateInterface &$form_state) { + public function submit(array $form, FormStateInterface $form_state) { /** @var \Drupal\comment\CommentInterface $comment */ $comment = parent::submit($form, $form_state); @@ -349,7 +349,7 @@ public function submit(array $form, FormStateInterface &$form_state) { * @param $form_state * The current state of the form. */ - public function preview(array &$form, FormStateInterface &$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'); @@ -359,7 +359,7 @@ public function preview(array &$form, FormStateInterface &$form_state) { /** * Overrides Drupal\Core\Entity\EntityForm::save(). */ - public function save(array $form, FormStateInterface &$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 1c8c46c..332e911 100644 --- a/core/modules/comment/src/CommentTypeForm.php +++ b/core/modules/comment/src/CommentTypeForm.php @@ -59,7 +59,7 @@ public function __construct(EntityManagerInterface $entity_manager, LoggerInterf /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form = parent::form($form, $form_state); $comment_type = $this->entity; @@ -133,7 +133,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 da90976..7b633d9 100644 --- a/core/modules/comment/src/Form/CommentAdminOverview.php +++ b/core/modules/comment/src/Form/CommentAdminOverview.php @@ -101,7 +101,7 @@ public function getFormID() { * @return array * The form structure. */ - public function buildForm(array $form, FormStateInterface &$form_state, $type = 'new') { + public function buildForm(array $form, FormStateInterface $form_state, $type = 'new') { // Build an 'Update options' form. $form['options'] = array( @@ -251,7 +251,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $type = /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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) { @@ -262,7 +262,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 849b942..1cc1143 100644 --- a/core/modules/comment/src/Form/CommentTypeDeleteForm.php +++ b/core/modules/comment/src/Form/CommentTypeDeleteForm.php @@ -112,7 +112,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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 = ''; @@ -141,7 +141,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 6d768fc..4f49a44 100644 --- a/core/modules/comment/src/Form/ConfirmDeleteMultiple.php +++ b/core/modules/comment/src/Form/ConfirmDeleteMultiple.php @@ -83,7 +83,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $edit = $form_state['input']; $form['comments'] = array( @@ -117,7 +117,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 b66f0de..c241589 100644 --- a/core/modules/comment/src/Form/DeleteForm.php +++ b/core/modules/comment/src/Form/DeleteForm.php @@ -47,7 +47,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 0efccd8..87ec9e7 100644 --- a/core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php +++ b/core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php @@ -50,7 +50,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form['keywords'] = array( '#title' => t('Keywords'), '#type' => 'textarea', @@ -63,7 +63,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 cc26a8d..e140bc3 100644 --- a/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php +++ b/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php @@ -233,7 +233,7 @@ public function viewElements(FieldItemListInterface $items) { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 6a651e9..57e41d8 100644 --- a/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php +++ b/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php @@ -99,7 +99,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition) /** * {@inheritdoc} */ - public function instanceSettingsForm(array $form, FormStateInterface &$form_state) { + public function instanceSettingsForm(array $form, FormStateInterface $form_state) { $element = array(); $settings = $this->getSettings(); @@ -189,7 +189,7 @@ public function isEmpty() { /** * {@inheritdoc} */ - public function settingsForm(array &$form, FormStateInterface &$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 42d409f6..0f6d44b 100644 --- a/core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php +++ b/core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php @@ -28,7 +28,7 @@ class CommentWidget extends WidgetBase { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$form_state) { + public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { $entity = $items->getEntity(); $element['status'] = array( @@ -87,7 +87,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen /** * {@inheritdoc} */ - public function massageFormValues(array $values, array $form, FormStateInterface &$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 2f92860..25c001d 100644 --- a/core/modules/comment/src/Plugin/views/field/Comment.php +++ b/core/modules/comment/src/Plugin/views/field/Comment.php @@ -61,7 +61,7 @@ protected function defineOptions() { /** * Provide link-to-comment option */ - public function buildOptionsForm(&$form, FormStateInterface &$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 9286e3f..c1dae39 100644 --- a/core/modules/comment/src/Plugin/views/field/EntityLink.php +++ b/core/modules/comment/src/Plugin/views/field/EntityLink.php @@ -33,7 +33,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 89f9ce2..4a3842e 100644 --- a/core/modules/comment/src/Plugin/views/field/Link.php +++ b/core/modules/comment/src/Plugin/views/field/Link.php @@ -66,7 +66,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 c1783f4..7637143 100644 --- a/core/modules/comment/src/Plugin/views/field/LinkEdit.php +++ b/core/modules/comment/src/Plugin/views/field/LinkEdit.php @@ -26,7 +26,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 1be0d2b..748291b 100644 --- a/core/modules/comment/src/Plugin/views/field/NodeNewComments.php +++ b/core/modules/comment/src/Plugin/views/field/NodeNewComments.php @@ -83,7 +83,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 3113d15..b526dbc 100644 --- a/core/modules/comment/src/Plugin/views/field/Username.php +++ b/core/modules/comment/src/Plugin/views/field/Username.php @@ -40,7 +40,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 8c6e048..5256b56 100644 --- a/core/modules/comment/src/Plugin/views/row/CommentRow.php +++ b/core/modules/comment/src/Plugin/views/row/CommentRow.php @@ -32,7 +32,7 @@ protected function defineOptions() { /** * {@inheritdoc} */ - public function buildOptionsForm(&$form, FormStateInterface &$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 350c0fa..d24eefe 100644 --- a/core/modules/comment/src/Plugin/views/row/Rss.php +++ b/core/modules/comment/src/Plugin/views/row/Rss.php @@ -37,7 +37,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 3ef86f5..5227f39 100644 --- a/core/modules/comment/src/Plugin/views/wizard/Comment.php +++ b/core/modules/comment/src/Plugin/views/wizard/Comment.php @@ -74,7 +74,7 @@ protected function rowStyleOptions() { return $options; } - protected function buildFormStyle(array &$form, FormStateInterface &$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 @@ -102,7 +102,7 @@ protected function buildFormStyle(array &$form, FormStateInterface &$form_state, /** * {@inheritdoc} */ - protected function pageDisplayOptions(array $form, FormStateInterface &$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(); @@ -113,7 +113,7 @@ protected function pageDisplayOptions(array $form, FormStateInterface &$form_sta /** * Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::blockDisplayOptions(). */ - protected function blockDisplayOptions(array $form, FormStateInterface &$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 5cc7f64..e76a56c 100644 --- a/core/modules/config/src/Form/ConfigExportForm.php +++ b/core/modules/config/src/Form/ConfigExportForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form['description'] = array( '#markup' => '' . $this->t('Use the export button below to download your site configuration.') . '
', ); @@ -39,7 +39,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 07b8bd1..00315e1 100644 --- a/core/modules/config/src/Form/ConfigImportForm.php +++ b/core/modules/config/src/Form/ConfigImportForm.php @@ -54,7 +54,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form['description'] = array( '#markup' => '' . $this->t('Use the upload button below.') . '
', ); @@ -74,7 +74,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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(); @@ -87,7 +87,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 f415a19..28d1069 100644 --- a/core/modules/config/src/Form/ConfigSingleExportForm.php +++ b/core/modules/config/src/Form/ConfigSingleExportForm.php @@ -75,7 +75,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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; @@ -135,7 +135,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $config_ /** * Handles switching the configuration type selector. */ - public function updateConfigurationType($form, FormStateInterface &$form_state) { + public function updateConfigurationType($form, FormStateInterface $form_state) { $form['config_name']['#options'] = $this->findConfiguration($form_state['values']['config_type']); return $form['config_name']; } @@ -143,7 +143,7 @@ public function updateConfigurationType($form, FormStateInterface &$form_state) /** * Handles switching the export textarea. */ - public function updateExport($form, FormStateInterface &$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']); @@ -199,7 +199,7 @@ protected function findConfiguration($config_type) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 2289e5a..4de92c9 100644 --- a/core/modules/config/src/Form/ConfigSingleImportForm.php +++ b/core/modules/config/src/Form/ConfigSingleImportForm.php @@ -115,7 +115,7 @@ public function getQuestion() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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); @@ -178,7 +178,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$form_state) { + public function validateForm(array &$form, FormStateInterface $form_state) { // The confirmation step needs no additional validation. if ($this->data) { return; @@ -233,7 +233,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 ea1fce6..a93c0ff 100644 --- a/core/modules/config/src/Form/ConfigSync.php +++ b/core/modules/config/src/Form/ConfigSync.php @@ -153,7 +153,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form['actions'] = array('#type' => 'actions'); $form['actions']['submit'] = array( '#type' => 'submit', @@ -271,7 +271,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 c99c9aa..cbe4c6f 100644 --- a/core/modules/config/tests/config_test/src/ConfigTestForm.php +++ b/core/modules/config/tests/config_test/src/ConfigTestForm.php @@ -18,7 +18,7 @@ class ConfigTestForm extends EntityForm { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form = parent::form($form, $form_state); $entity = $this->entity; @@ -70,7 +70,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 f471b25..8c5258f 100644 --- a/core/modules/config/tests/config_test/src/Form/ConfigTestDeleteForm.php +++ b/core/modules/config/tests/config_test/src/Form/ConfigTestDeleteForm.php @@ -40,7 +40,7 @@ public function getCancelRoute() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 dd99b62..1930c3b 100644 --- a/core/modules/config_translation/src/Form/ConfigTranslationAddForm.php +++ b/core/modules/config_translation/src/Form/ConfigTranslationAddForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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(), @@ -37,7 +37,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, Request /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 c54f6b7..beac37f 100644 --- a/core/modules/config_translation/src/Form/ConfigTranslationDeleteForm.php +++ b/core/modules/config_translation/src/Form/ConfigTranslationDeleteForm.php @@ -116,7 +116,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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); @@ -134,7 +134,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, Request /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 14f6a98..91e4797 100644 --- a/core/modules/config_translation/src/Form/ConfigTranslationEditForm.php +++ b/core/modules/config_translation/src/Form/ConfigTranslationEditForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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(), @@ -37,7 +37,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, Request /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 82af14f..29ed2c9 100644 --- a/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php +++ b/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php @@ -156,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, FormStateInterface &$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); @@ -215,7 +215,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, Request /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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/tests/modules/config_translation_test/config_translation_test.module b/core/modules/config_translation/tests/modules/config_translation_test/config_translation_test.module index b54d261..582be7c 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 @@ -48,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, FormStateInterface &$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; } @@ -61,7 +61,7 @@ function config_translation_test_form_config_translation_form_alter(&$form, Form * * @see \Drupal\config_translation\Form\ConfigTranslationAddForm */ -function config_translation_test_form_config_translation_add_form_alter(&$form, FormStateInterface &$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; } @@ -78,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, FormStateInterface &$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 bbafe09..bee5dcf 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -163,7 +163,7 @@ function contact_mail($key, &$message, $params) { * * @see \Drupal\user\ProfileForm::form() */ -function contact_form_user_form_alter(&$form, FormStateInterface &$form_state) { +function contact_form_user_form_alter(&$form, FormStateInterface $form_state) { $form['contact'] = array( '#type' => 'details', '#title' => t('Contact settings'), @@ -186,7 +186,7 @@ function contact_form_user_form_alter(&$form, FormStateInterface &$form_state) { /** * Submit callback for the user profile form to save the contact page setting. */ -function contact_user_profile_form_submit($form, FormStateInterface &$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']); @@ -200,7 +200,7 @@ function contact_user_profile_form_submit($form, FormStateInterface &$form_state * * @see user_admin_settings() */ -function contact_form_user_admin_settings_alter(&$form, FormStateInterface &$form_state) { +function contact_form_user_admin_settings_alter(&$form, FormStateInterface $form_state) { $form['contact'] = array( '#type' => 'details', '#title' => t('Contact settings'), @@ -222,7 +222,7 @@ function contact_form_user_admin_settings_alter(&$form, FormStateInterface &$for * * @see contact_form_user_admin_settings_alter() */ -function contact_form_user_admin_settings_submit($form, FormStateInterface &$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 ff25a51..df91084 100644 --- a/core/modules/contact/src/CategoryForm.php +++ b/core/modules/contact/src/CategoryForm.php @@ -19,7 +19,7 @@ class CategoryForm extends EntityForm { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form = parent::form($form, $form_state); $category = $this->entity; @@ -73,7 +73,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$form_state) { + public function validate(array $form, FormStateInterface $form_state) { parent::validate($form, $form_state); // Validate and each email recipient. @@ -91,7 +91,7 @@ public function validate(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 a8e18f9..7b3e8a0 100644 --- a/core/modules/contact/src/Form/CategoryDeleteForm.php +++ b/core/modules/contact/src/Form/CategoryDeleteForm.php @@ -40,7 +40,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 4274a79..30ac410 100644 --- a/core/modules/contact/src/MessageForm.php +++ b/core/modules/contact/src/MessageForm.php @@ -73,7 +73,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $user = $this->currentUser(); $message = $this->entity; $form = parent::form($form, $form_state, $message); @@ -151,7 +151,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function actions(array $form, FormStateInterface &$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( @@ -170,7 +170,7 @@ public function actions(array $form, FormStateInterface &$form_state) { /** * Form submission handler for the 'preview' action. */ - public function preview(array $form, FormStateInterface &$form_state) { + public function preview(array $form, FormStateInterface $form_state) { $message = $this->entity; $message->preview = TRUE; $form_state['rebuild'] = TRUE; @@ -179,7 +179,7 @@ public function preview(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$form_state) { + public function save(array $form, FormStateInterface $form_state) { $user = $this->currentUser(); $language_interface = $this->languageManager->getCurrentLanguage(); @@ -272,7 +272,7 @@ public function save(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - protected function init(FormStateInterface &$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 017dc6a..a84d6b9 100644 --- a/core/modules/contact/src/Plugin/views/field/ContactLink.php +++ b/core/modules/contact/src/Plugin/views/field/ContactLink.php @@ -85,7 +85,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - public function buildOptionsForm(&$form, FormStateInterface &$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 a362ada..9b33f0e 100644 --- a/core/modules/content_translation/content_translation.admin.inc +++ b/core/modules/content_translation/content_translation.admin.inc @@ -61,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, FormStateInterface &$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')) { @@ -255,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, FormStateInterface &$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) { @@ -285,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, FormStateInterface &$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 871447a..21282bb 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -459,7 +459,7 @@ function content_translation_permission() { /** * Implements hook_form_alter(). */ -function content_translation_form_alter(array &$form, FormStateInterface &$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; @@ -645,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, FormStateInterface &$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); @@ -726,7 +726,7 @@ function content_translation_element_info_alter(&$type) { * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ -function content_translation_enable_widget($entity_type, $bundle, array &$form, FormStateInterface &$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(); @@ -746,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, FormStateInterface &$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']]; @@ -773,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, FormStateInterface &$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'])) { @@ -794,7 +794,7 @@ function content_translation_language_configuration_element_validate($element, F * * @see content_translation_language_configuration_element_validate() */ -function content_translation_language_configuration_element_submit(array $form, FormStateInterface &$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']; @@ -809,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, FormStateInterface &$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 4c613f0..d14a945 100644 --- a/core/modules/content_translation/src/ContentTranslationHandler.php +++ b/core/modules/content_translation/src/ContentTranslationHandler.php @@ -83,7 +83,7 @@ public function getSourceLangcode($form_state) { /** * {@inheritdoc} */ - public function entityFormAlter(array &$form, FormStateInterface &$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; @@ -372,7 +372,7 @@ protected function addTranslatabilityClue(&$element) { * * @see \Drupal\content_translation\ContentTranslationHandler::entityFormAlter() */ - public function entityFormEntityBuild($entity_type, EntityInterface $entity, array $form, FormStateInterface &$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); @@ -411,7 +411,7 @@ public function entityFormEntityBuild($entity_type, EntityInterface $entity, arr * * Validates the submitted content translation metadata. */ - function entityFormValidate($form, FormStateInterface &$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. @@ -430,7 +430,7 @@ function entityFormValidate($form, FormStateInterface &$form_state) { * * Takes care of the source language change. */ - public function entityFormSourceChange($form, FormStateInterface &$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']; @@ -446,7 +446,7 @@ public function entityFormSourceChange($form, FormStateInterface &$form_state) { * * Takes care of entity deletion. */ - function entityFormDelete($form, FormStateInterface &$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) { @@ -459,7 +459,7 @@ function entityFormDelete($form, FormStateInterface &$form_state) { * * Takes care of content translation deletion. */ - function entityFormDeleteTranslation($form, FormStateInterface &$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 342766b..67c4d0d 100644 --- a/core/modules/content_translation/src/ContentTranslationHandlerInterface.php +++ b/core/modules/content_translation/src/ContentTranslationHandlerInterface.php @@ -67,6 +67,6 @@ public function retranslate(EntityInterface $entity, $langcode = NULL); * @param \Drupal\Core\Entity\EntityInterface $entity * The entity being created or edited. */ - public function entityFormAlter(array &$form, FormStateInterface &$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 2343846..99bec46 100644 --- a/core/modules/content_translation/src/Form/ContentTranslationDeleteForm.php +++ b/core/modules/content_translation/src/Form/ContentTranslationDeleteForm.php @@ -40,7 +40,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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); @@ -70,7 +70,7 @@ public function getCancelRoute() { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 3ca637f..9d234ab 100644 --- a/core/modules/content_translation/src/Plugin/views/field/TranslationLink.php +++ b/core/modules/content_translation/src/Plugin/views/field/TranslationLink.php @@ -33,7 +33,7 @@ protected function defineOptions() { /** * Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::buildOptionsForm(). */ - public function buildOptionsForm(&$form, FormStateInterface &$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 1474154..dd8c990 100644 --- a/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php +++ b/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php @@ -38,7 +38,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 2445ad9..e70bad3 100644 --- a/core/modules/datetime/datetime.module +++ b/core/modules/datetime/datetime.module @@ -123,7 +123,7 @@ function datetime_theme() { * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ -function datetime_datetime_widget_validate(&$element, FormStateInterface &$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); @@ -161,7 +161,7 @@ function datetime_datetime_widget_validate(&$element, FormStateInterface &$form_ * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ -function datetime_datelist_widget_validate(&$element, FormStateInterface &$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); @@ -359,7 +359,7 @@ function template_preprocess_datetime_wrapper(&$variables) { * @return array * The form element whose value has been processed. */ -function datetime_datetime_form_process($element, FormStateInterface &$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; @@ -531,7 +531,7 @@ function form_type_datetime_value($element, $input = FALSE) { * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ -function datetime_datetime_validate($element, FormStateInterface &$form_state) { +function datetime_datetime_validate($element, FormStateInterface $form_state) { $input_exists = FALSE; $input = NestedArray::getValue($form_state['values'], $element['#parents'], $input_exists); @@ -679,7 +679,7 @@ function datetime_format_example($format) { * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ -function datetime_datelist_form_process($element, FormStateInterface &$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(); @@ -794,7 +794,7 @@ function datetime_datelist_form_process($element, FormStateInterface &$form_stat * * @return array */ -function form_type_datelist_value($element, $input = FALSE, FormStateInterface &$form_state) { +function form_type_datelist_value($element, $input = FALSE, FormStateInterface $form_state) { $parts = $element['#date_part_order']; $increment = $element['#date_increment']; @@ -873,7 +873,7 @@ function form_type_datelist_value($element, $input = FALSE, FormStateInterface & * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ -function datetime_datelist_validate($element, FormStateInterface &$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) { @@ -1000,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, FormStateInterface &$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(); @@ -1012,7 +1012,7 @@ function datetime_form_node_form_alter(&$form, FormStateInterface &$form_state, /** * Implements hook_node_prepare_form(). */ -function datetime_node_prepare_form(NodeInterface $node, $operation, FormStateInterface &$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 58ae1b8..c4bf7de 100644 --- a/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php +++ b/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php @@ -163,7 +163,7 @@ function dateFormat($date) { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 1f6f2ef..4ed473b 100644 --- a/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeFieldItemList.php +++ b/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeFieldItemList.php @@ -26,7 +26,7 @@ class DateTimeFieldItemList extends FieldItemList { /** * {@inheritdoc} */ - public function defaultValuesForm(array &$form, FormStateInterface &$form_state) { + public function defaultValuesForm(array &$form, FormStateInterface $form_state) { if (empty($this->getFieldDefinition()->default_value_function)) { $default_value = $this->getFieldDefinition()->default_value; @@ -49,12 +49,12 @@ public function defaultValuesForm(array &$form, FormStateInterface &$form_state) /** * {@inheritdoc} */ - public function defaultValuesFormValidate(array $element, array &$form, FormStateInterface &$form_state) { } + public function defaultValuesFormValidate(array $element, array &$form, FormStateInterface $form_state) { } /** * {@inheritdoc} */ - public function defaultValuesFormSubmit(array $element, array &$form, FormStateInterface &$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 0ec4fa1..992af1e 100644 --- a/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php +++ b/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php @@ -84,7 +84,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition) /** * {@inheritdoc} */ - public function settingsForm(array &$form, FormStateInterface &$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 8815ebc..6d05a06 100644 --- a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php +++ b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php @@ -38,7 +38,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$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'); @@ -123,7 +123,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen /** * {@inheritdoc} */ - function settingsForm(array $form, FormStateInterface &$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 85b84a2..a411eb4 100644 --- a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php +++ b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php @@ -61,7 +61,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$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 d1c17a1..f05d0c9 100644 --- a/core/modules/dblog/dblog.module +++ b/core/modules/dblog/dblog.module @@ -113,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, FormStateInterface &$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 da08a3c..e100156 100644 --- a/core/modules/dblog/src/Form/DblogClearLogConfirmForm.php +++ b/core/modules/dblog/src/Form/DblogClearLogConfirmForm.php @@ -68,7 +68,7 @@ public function getCancelRoute() { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 6556820..f3781d4 100644 --- a/core/modules/dblog/src/Form/DblogClearLogForm.php +++ b/core/modules/dblog/src/Form/DblogClearLogForm.php @@ -54,7 +54,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form['dblog_clear'] = array( '#type' => 'details', '#title' => $this->t('Clear log messages'), @@ -70,7 +70,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 7682484..aae5784 100644 --- a/core/modules/dblog/src/Form/DblogFilterForm.php +++ b/core/modules/dblog/src/Form/DblogFilterForm.php @@ -25,7 +25,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $filters = dblog_filters(); $form['filters'] = array( @@ -68,7 +68,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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.')); } @@ -77,7 +77,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$form_state) { + public function submitForm(array &$form, FormStateInterface $form_state) { $filters = dblog_filters(); foreach ($filters as $name => $filter) { if (isset($form_state['values'][$name])) { @@ -89,7 +89,7 @@ public function submitForm(array &$form, FormStateInterface &$form_state) { /** * Resets the filter form. */ - public function resetForm(array &$form, FormStateInterface &$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 8e28bb5..6c94184 100644 --- a/core/modules/dblog/src/Plugin/views/field/DblogMessage.php +++ b/core/modules/dblog/src/Plugin/views/field/DblogMessage.php @@ -47,7 +47,7 @@ protected function defineOptions() { /** * {@inheritdoc} */ - public function buildOptionsForm(&$form, FormStateInterface &$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 ad6e80c..4f0589b 100644 --- a/core/modules/editor/editor.module +++ b/core/modules/editor/editor.module @@ -92,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, FormStateInterface &$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); @@ -169,7 +169,7 @@ function editor_form_filter_format_form_alter(&$form, FormStateInterface &$form_ /** * Button submit handler for filter_format_form()'s 'editor_configure' button. */ -function editor_form_filter_admin_format_editor_configure($form, FormStateInterface &$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'] === '') { @@ -189,14 +189,14 @@ function editor_form_filter_admin_format_editor_configure($form, FormStateInterf /** * AJAX callback handler for filter_format_form(). */ -function editor_form_filter_admin_form_ajax($form, FormStateInterface &$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, FormStateInterface &$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; @@ -214,7 +214,7 @@ function editor_form_filter_admin_format_validate($form, FormStateInterface &$fo /** * Additional submit handler for filter_format_form(). */ -function editor_form_filter_admin_format_submit($form, FormStateInterface &$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 24274f8..b75fc40 100644 --- a/core/modules/editor/src/Form/EditorImageDialog.php +++ b/core/modules/editor/src/Form/EditorImageDialog.php @@ -34,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, FormStateInterface &$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'])) { @@ -184,7 +184,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, FilterFo /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 f392416..8f31c3c 100644 --- a/core/modules/editor/src/Form/EditorLinkDialog.php +++ b/core/modules/editor/src/Form/EditorLinkDialog.php @@ -33,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, FormStateInterface &$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(); @@ -79,7 +79,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, FilterFo /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 1d43460..4cb1fe2 100644 --- a/core/modules/editor/src/Plugin/EditorBase.php +++ b/core/modules/editor/src/Plugin/EditorBase.php @@ -55,20 +55,20 @@ public function getDefaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$form_state, Editor $editor) { + public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor) { return $form; } /** * {@inheritdoc} */ - public function settingsFormValidate(array $form, FormStateInterface &$form_state) { + public function settingsFormValidate(array $form, FormStateInterface $form_state) { } /** * {@inheritdoc} */ - public function settingsFormSubmit(array $form, FormStateInterface &$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 3301dea..10ad314 100644 --- a/core/modules/editor/src/Plugin/EditorPluginInterface.php +++ b/core/modules/editor/src/Plugin/EditorPluginInterface.php @@ -46,7 +46,7 @@ public function getDefaultSettings(); * @return array * A render array for the settings form. */ - public function settingsForm(array $form, FormStateInterface &$form_state, Editor $editor); + public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor); /** * Validates the settings form for an editor. @@ -60,7 +60,7 @@ public function settingsForm(array $form, FormStateInterface &$form_state, Edito * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - public function settingsFormValidate(array $form, FormStateInterface &$form_state); + public function settingsFormValidate(array $form, FormStateInterface $form_state); /** * Modifies any values in the form state to prepare them for saving. @@ -73,7 +73,7 @@ public function settingsFormValidate(array $form, FormStateInterface &$form_stat * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - public function settingsFormSubmit(array $form, FormStateInterface &$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 cef5c68..6937fb2 100644 --- a/core/modules/editor/tests/modules/src/Plugin/Editor/UnicornEditor.php +++ b/core/modules/editor/tests/modules/src/Plugin/Editor/UnicornEditor.php @@ -34,7 +34,7 @@ function getDefaultSettings() { /** * {@inheritdoc} */ - function settingsForm(array $form, FormStateInterface &$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 e8024d8..6457e23 100644 --- a/core/modules/entity/src/Entity/EntityFormDisplay.php +++ b/core/modules/entity/src/Entity/EntityFormDisplay.php @@ -149,7 +149,7 @@ public function getRenderer($field_name) { /** * {@inheritdoc} */ - public function buildForm(ContentEntityInterface $entity, array &$form, FormStateInterface &$form_state) { + public function buildForm(ContentEntityInterface $entity, array &$form, FormStateInterface $form_state) { // Set #parents to 'top-level' by default. $form += array('#parents' => array()); @@ -198,7 +198,7 @@ public function processForm($element, $form_state, $form) { /** * {@inheritdoc} */ - public function extractFormValues(ContentEntityInterface $entity, array &$form, FormStateInterface &$form_state) { + public function extractFormValues(ContentEntityInterface $entity, array &$form, FormStateInterface $form_state) { $extracted = array(); foreach ($entity as $name => $items) { if ($widget = $this->getRenderer($name)) { @@ -212,7 +212,7 @@ public function extractFormValues(ContentEntityInterface $entity, array &$form, /** * {@inheritdoc} */ - public function validateFormValues(ContentEntityInterface $entity, array &$form, FormStateInterface &$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 766fc8c..296fde2 100644 --- a/core/modules/entity/src/Form/EntityDisplayModeAddForm.php +++ b/core/modules/entity/src/Form/EntityDisplayModeAddForm.php @@ -25,7 +25,7 @@ class EntityDisplayModeAddForm extends EntityDisplayModeFormBase { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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. @@ -38,7 +38,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $entity_ /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$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 715e341..03717dd 100644 --- a/core/modules/entity/src/Form/EntityDisplayModeDeleteForm.php +++ b/core/modules/entity/src/Form/EntityDisplayModeDeleteForm.php @@ -49,7 +49,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 f3c2401..52e3388 100644 --- a/core/modules/entity/src/Form/EntityDisplayModeFormBase.php +++ b/core/modules/entity/src/Form/EntityDisplayModeFormBase.php @@ -65,7 +65,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - protected function init(FormStateInterface &$form_state) { + protected function init(FormStateInterface $form_state) { parent::init($form_state); $this->entityType = $this->entityManager->getDefinition($this->entity->getEntityTypeId()); } @@ -73,7 +73,7 @@ protected function init(FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form['label'] = array( '#type' => 'textfield', '#title' => t('Label'), @@ -121,7 +121,7 @@ public function exists($entity_id, array $element) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 f95cd7c..f344622 100644 --- a/core/modules/entity_reference/entity_reference.module +++ b/core/modules/entity_reference/entity_reference.module @@ -150,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, FormStateInterface &$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); } @@ -170,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, FormStateInterface &$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 19d276d..c79f259 100644 --- a/core/modules/entity_reference/src/ConfigurableEntityReferenceItem.php +++ b/core/modules/entity_reference/src/ConfigurableEntityReferenceItem.php @@ -160,7 +160,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition) /** * {@inheritdoc} */ - public function settingsForm(array &$form, FormStateInterface &$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'), @@ -177,7 +177,7 @@ public function settingsForm(array &$form, FormStateInterface &$form_state, $has /** * {@inheritdoc} */ - public function instanceSettingsForm(array $form, FormStateInterface &$form_state) { + public function instanceSettingsForm(array $form, FormStateInterface $form_state) { $instance = $form_state['instance']; // Get all selection plugins for this entity type. @@ -251,7 +251,7 @@ public function instanceSettingsForm(array $form, FormStateInterface &$form_stat * @param \Drupal\Core\Form\FormStateInterface $form_state * The form state of the (entire) configuration form. */ - public static function instanceSettingsFormValidate(array $form, FormStateInterface &$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 dbe3a04..448343e 100644 --- a/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php +++ b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php @@ -38,7 +38,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 013aaa3..154759f 100644 --- a/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php +++ b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php @@ -37,7 +37,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 2819ecf..25d8546 100644 --- a/core/modules/entity_reference/src/Plugin/Field/FieldType/ConfigurableEntityReferenceFieldItemList.php +++ b/core/modules/entity_reference/src/Plugin/Field/FieldType/ConfigurableEntityReferenceFieldItemList.php @@ -74,7 +74,7 @@ public static function processDefaultValue($default_value, ContentEntityInterfac /** * {@inheritdoc} */ - public function defaultValuesFormSubmit(array $element, array &$form, FormStateInterface &$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 e097071..b289a06 100644 --- a/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteTagsWidget.php +++ b/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteTagsWidget.php @@ -40,7 +40,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function elementValidate($element, FormStateInterface &$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 e9b9b7f..3633b5d 100644 --- a/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteWidget.php +++ b/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteWidget.php @@ -58,7 +58,7 @@ protected function getEntityIds(FieldItemListInterface $items, $delta) { /** * {@inheritdoc} */ - public function elementValidate($element, FormStateInterface &$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 0d7ff78..975ec4f 100644 --- a/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteWidgetBase.php +++ b/core/modules/entity_reference/src/Plugin/Field/FieldWidget/AutocompleteWidgetBase.php @@ -22,7 +22,7 @@ /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$form_state) { + public function settingsForm(array $form, FormStateInterface $form_state) { $element['match_operator'] = array( '#type' => 'radios', '#title' => t('Autocomplete matching'), @@ -71,7 +71,7 @@ public function settingsSummary() { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$form_state) { + public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { $entity = $items->getEntity(); // Prepare the autocomplete route parameters. @@ -104,14 +104,14 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen /** * {@inheritdoc} */ - public function errorElement(array $element, ConstraintViolationInterface $error, array $form, FormStateInterface &$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, FormStateInterface &$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 5da5ba7..37a5264 100644 --- a/core/modules/entity_reference/src/Plugin/Type/Selection/SelectionBroken.php +++ b/core/modules/entity_reference/src/Plugin/Type/Selection/SelectionBroken.php @@ -50,7 +50,7 @@ public function validateReferenceableEntities(array $ids) { /** * {@inheritdoc} */ - public function validateAutocompleteInput($input, &$element, FormStateInterface &$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 d3415dd..eb3b8ae 100644 --- a/core/modules/entity_reference/src/Plugin/Type/Selection/SelectionInterface.php +++ b/core/modules/entity_reference/src/Plugin/Type/Selection/SelectionInterface.php @@ -68,7 +68,7 @@ public function validateReferenceableEntities(array $ids); * * @see \Drupal\entity_reference\Plugin\Field\FieldWidget::elementValidate() */ - public function validateAutocompleteInput($input, &$element, FormStateInterface &$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 cbfca39..fbb6537 100644 --- a/core/modules/entity_reference/src/Plugin/entity_reference/selection/SelectionBase.php +++ b/core/modules/entity_reference/src/Plugin/entity_reference/selection/SelectionBase.php @@ -230,7 +230,7 @@ public function validateReferenceableEntities(array $ids) { /** * {@inheritdoc} */ - public function validateAutocompleteInput($input, &$element, FormStateInterface &$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 1bbdd15..8434e97 100644 --- a/core/modules/entity_reference/src/Plugin/views/row/EntityReference.php +++ b/core/modules/entity_reference/src/Plugin/views/row/EntityReference.php @@ -39,7 +39,7 @@ protected function defineOptions() { /** * Overrides \Drupal\views\Plugin\views\row\Fields::buildOptionsForm(). */ - public function buildOptionsForm(&$form, FormStateInterface &$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 37aad61..d0b3bbe 100644 --- a/core/modules/entity_reference/src/Plugin/views/style/EntityReference.php +++ b/core/modules/entity_reference/src/Plugin/views/style/EntityReference.php @@ -55,7 +55,7 @@ protected function defineOptions() { /** * Overrides \Drupal\views\Plugin\views\style\StylePluginBase\StylePluginBase::buildOptionsForm(). */ - public function buildOptionsForm(&$form, FormStateInterface &$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 efcd194..1b7b44c 100644 --- a/core/modules/field/field.api.php +++ b/core/modules/field/field.api.php @@ -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, \Drupal\Core\Form\FormStateInterface &$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') { @@ -147,7 +147,7 @@ function hook_field_widget_form_alter(&$element, \Drupal\Core\Form\FormStateInte * @see \Drupal\Core\Field\WidgetBase::formSingleElement() * @see hook_field_widget_form_alter() */ -function hook_field_widget_WIDGET_TYPE_form_alter(&$element, \Drupal\Core\Form\FormStateInterface &$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 05a1852..eb0512d 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -345,7 +345,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, FormStateInterface &$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 9d7dbcf..28cbcaf 100644 --- a/core/modules/field/src/Plugin/views/argument/FieldList.php +++ b/core/modules/field/src/Plugin/views/argument/FieldList.php @@ -48,7 +48,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 a8dd7cf..20b781c 100644 --- a/core/modules/field/src/Plugin/views/argument/ListString.php +++ b/core/modules/field/src/Plugin/views/argument/ListString.php @@ -49,7 +49,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 fa41225..a8dc0f8 100644 --- a/core/modules/field/src/Plugin/views/field/Field.php +++ b/core/modules/field/src/Plugin/views/field/Field.php @@ -434,7 +434,7 @@ protected function defineOptions() { /** * {@inheritdoc} */ - public function buildOptionsForm(&$form, FormStateInterface &$form_state) { + public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $field = $this->getFieldDefinition(); @@ -515,7 +515,7 @@ public function buildOptionsForm(&$form, FormStateInterface &$form_state) { /** * Provide options for multiple value fields. */ - function multiple_options_form(&$form, FormStateInterface &$form_state) { + function multiple_options_form(&$form, FormStateInterface $form_state) { $field = $this->getFieldDefinition(); $form['multiple_field_settings'] = array( @@ -638,7 +638,7 @@ function multiple_options_form(&$form, FormStateInterface &$form_state) { /** * Extend the groupby form with group columns. */ - public function buildGroupByForm(&$form, FormStateInterface &$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. @@ -671,7 +671,7 @@ public function buildGroupByForm(&$form, FormStateInterface &$form_state) { ); } - public function submitGroupByForm(&$form, FormStateInterface &$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/tests/modules/field_test/field_test.module b/core/modules/field/tests/modules/field_test/field_test.module index 36c16b9..b4f8fc8 100644 --- a/core/modules/field/tests/modules/field_test/field_test.module +++ b/core/modules/field/tests/modules/field_test/field_test.module @@ -116,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, FormStateInterface &$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 438f857..ea5a30e 100644 --- a/core/modules/field/tests/modules/field_test/src/Form/NestedEntityTestForm.php +++ b/core/modules/field/tests/modules/field_test/src/Form/NestedEntityTestForm.php @@ -27,7 +27,7 @@ public function getFormId() { /** * {@inheritdoc] */ - public function buildForm(array $form, FormStateInterface &$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'); @@ -58,7 +58,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, EntityIn /** * {@inheritdoc] */ - public function validateForm(array &$form, FormStateInterface &$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']; @@ -75,7 +75,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc] */ - public function submitForm(array &$form, FormStateInterface &$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 d2acf58..d195a31 100644 --- a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldDefaultFormatter.php +++ b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldDefaultFormatter.php @@ -38,7 +38,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 29e9a46..84938ec 100644 --- a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldEmptySettingFormatter.php +++ b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldEmptySettingFormatter.php @@ -37,7 +37,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 6668b39..a310ad3 100644 --- a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldMultipleFormatter.php +++ b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldMultipleFormatter.php @@ -38,7 +38,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 1b5c8c1..211c1cd 100644 --- a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldPrepareViewFormatter.php +++ b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldPrepareViewFormatter.php @@ -38,7 +38,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 31b6bae..96b3b3f 100644 --- a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php +++ b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php @@ -77,7 +77,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition) /** * {@inheritdoc} */ - public function settingsForm(array &$form, FormStateInterface &$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'), @@ -92,7 +92,7 @@ public function settingsForm(array &$form, FormStateInterface &$form_state, $has /** * {@inheritdoc} */ - public function instanceSettingsForm(array $form, FormStateInterface &$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 b197c84..71b8afa 100644 --- a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidget.php +++ b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidget.php @@ -39,7 +39,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$form_state) { + public function settingsForm(array $form, FormStateInterface $form_state) { $element['test_widget_setting'] = array( '#type' => 'textfield', '#title' => t('Field test field widget setting'), @@ -62,7 +62,7 @@ public function settingsSummary() { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$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 : '', @@ -73,7 +73,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen /** * {@inheritdoc} */ - public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface &$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 543a858..5ad37f4 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 @@ -41,7 +41,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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'), @@ -64,7 +64,7 @@ public function settingsSummary() { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$form_state) { + public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { $values = array(); foreach ($items as $item) { $values[] = $item->value; @@ -80,14 +80,14 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen /** * {@inheritdoc} */ - public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface &$form_state) { + public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state) { return $element; } /** * Element validation helper. */ - public static function multipleValidate($element, FormStateInterface &$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.module b/core/modules/field_ui/field_ui.module index cf1f864..1ee5d06 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -199,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, FormStateInterface &$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 bdd610d..6d5a677 100644 --- a/core/modules/field_ui/src/DisplayOverview.php +++ b/core/modules/field_ui/src/DisplayOverview.php @@ -78,7 +78,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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'); } @@ -89,7 +89,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $entity_ /** * {@inheritdoc} */ - protected function buildFieldRow(FieldDefinitionInterface $field_definition, EntityDisplayInterface $entity_display, array $form, FormStateInterface &$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(); @@ -234,7 +234,7 @@ protected function getFieldLabelOptions() { /** * {@inheritdoc} */ - protected function thirdPartySettingsForm(PluginSettingsInterface $plugin, FieldDefinitionInterface $field_definition, array $form, FormStateInterface &$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 bb6778d..e76b6b6 100644 --- a/core/modules/field_ui/src/DisplayOverviewBase.php +++ b/core/modules/field_ui/src/DisplayOverviewBase.php @@ -117,7 +117,7 @@ protected function getFieldDefinitions() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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)) { @@ -260,7 +260,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $entity_ * @return array * A table row array. */ - protected function buildFieldRow(FieldDefinitionInterface $field_definition, EntityDisplayInterface $entity_display, array $form, FormStateInterface &$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(); @@ -506,7 +506,7 @@ protected function buildExtraFieldRow($field_id, $extra_field, EntityDisplayInte /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$form_state) { + public function submitForm(array &$form, FormStateInterface $form_state) { $form_values = $form_state['values']; $display = $this->getEntityDisplay($this->mode); @@ -612,7 +612,7 @@ public function submitForm(array &$form, FormStateInterface &$form_state) { /** * Form submission handler for multistep buttons. */ - public function multistepSubmit($form, FormStateInterface &$form_state) { + public function multistepSubmit($form, FormStateInterface $form_state) { $trigger = $form_state['triggering_element']; $op = $trigger['#op']; @@ -656,7 +656,7 @@ public function multistepSubmit($form, FormStateInterface &$form_state) { /** * Ajax handler for multistep buttons. */ - public function multistepAjax($form, FormStateInterface &$form_state) { + public function multistepAjax($form, FormStateInterface $form_state) { $trigger = $form_state['triggering_element']; $op = $trigger['#op']; @@ -890,7 +890,7 @@ protected function saveDisplayStatuses($display_statuses) { * @return array * The widget or formatter third party settings form. */ - abstract protected function thirdPartySettingsForm(PluginSettingsInterface $plugin, FieldDefinitionInterface $field_definition, array $form, FormStateInterface &$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 19360a2..24b3d92 100644 --- a/core/modules/field_ui/src/FieldOverview.php +++ b/core/modules/field_ui/src/FieldOverview.php @@ -78,7 +78,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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. @@ -282,7 +282,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $entity_ /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$form_state) { + public function validateForm(array &$form, FormStateInterface $form_state) { $this->validateAddNew($form, $form_state); $this->validateAddExisting($form, $form_state); } @@ -297,7 +297,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { * * @see \Drupal\field_ui\FieldOverview::validateForm() */ - protected function validateAddNew(array $form, FormStateInterface &$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. @@ -337,7 +337,7 @@ protected function validateAddNew(array $form, FormStateInterface &$form_state) * * @see \Drupal\field_ui\FieldOverview::validate() */ - protected function validateAddExisting(array $form, FormStateInterface &$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'])) { @@ -362,7 +362,7 @@ protected function validateAddExisting(array $form, FormStateInterface &$form_st /** * Overrides \Drupal\field_ui\OverviewBase::submitForm(). */ - public function submitForm(array &$form, FormStateInterface &$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 d2884b9..e586bd3 100644 --- a/core/modules/field_ui/src/Form/FieldEditForm.php +++ b/core/modules/field_ui/src/Form/FieldEditForm.php @@ -75,7 +75,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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(); @@ -160,7 +160,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, FieldIns /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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']; @@ -172,7 +172,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 a8864e4..e6ad7b2 100644 --- a/core/modules/field_ui/src/Form/FieldInstanceConfigDeleteForm.php +++ b/core/modules/field_ui/src/Form/FieldInstanceConfigDeleteForm.php @@ -68,7 +68,7 @@ public function getCancelRoute() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 4acd77e..c9019a7 100644 --- a/core/modules/field_ui/src/Form/FieldInstanceEditForm.php +++ b/core/modules/field_ui/src/Form/FieldInstanceEditForm.php @@ -63,7 +63,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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; @@ -165,7 +165,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, FieldIns /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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); @@ -175,7 +175,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$form_state) { + public function submitForm(array &$form, FormStateInterface $form_state) { // Handle the default value. $default_value = array(); if (isset($form['instance']['default_value'])) { @@ -210,7 +210,7 @@ public function submitForm(array &$form, FormStateInterface &$form_state) { /** * Redirects to the field instance deletion form. */ - public function delete(array &$form, FormStateInterface &$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 17442cb..4857a53 100644 --- a/core/modules/field_ui/src/FormDisplayOverview.php +++ b/core/modules/field_ui/src/FormDisplayOverview.php @@ -77,7 +77,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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'); } @@ -88,7 +88,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $entity_ /** * {@inheritdoc} */ - protected function buildFieldRow(FieldDefinitionInterface $field_definition, EntityDisplayInterface $entity_display, array $form, FormStateInterface &$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(); @@ -184,7 +184,7 @@ protected function getOverviewRoute($mode) { /** * {@inheritdoc} */ - protected function thirdPartySettingsForm(PluginSettingsInterface $plugin, FieldDefinitionInterface $field_definition, array $form, FormStateInterface &$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 6f330d5..7132eda 100644 --- a/core/modules/field_ui/src/OverviewBase.php +++ b/core/modules/field_ui/src/OverviewBase.php @@ -75,7 +75,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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'])) { @@ -92,7 +92,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $entity_ /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 190ce3e..f7f736e 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -1160,7 +1160,7 @@ function file_token_info() { * * This function is assigned as a #process callback in file_element_info(). */ -function file_managed_file_process($element, FormStateInterface &$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'; @@ -1307,7 +1307,7 @@ function file_managed_file_process($element, FormStateInterface &$form_state, $f * * This function is assigned as a #value_callback in file_element_info(). */ -function file_managed_file_value(&$element, $input, FormStateInterface &$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) { @@ -1383,7 +1383,7 @@ function file_managed_file_value(&$element, $input, FormStateInterface &$form_st * This function is assigned as a #element_validate callback in * file_element_info(). */ -function file_managed_file_validate(&$element, FormStateInterface &$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. @@ -1421,7 +1421,7 @@ function file_managed_file_validate(&$element, FormStateInterface &$form_state) * * @see file_managed_file_process() */ -function file_managed_file_submit($form, FormStateInterface &$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']; @@ -1492,7 +1492,7 @@ function file_managed_file_submit($form, FormStateInterface &$form_state) { * 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, FormStateInterface &$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 9124a11..f8ee03c 100644 --- a/core/modules/file/src/Plugin/Field/FieldType/FileFieldItemList.php +++ b/core/modules/file/src/Plugin/Field/FieldType/FileFieldItemList.php @@ -18,7 +18,7 @@ class FileFieldItemList extends EntityReferenceFieldItemList { /** * {@inheritdoc} */ - public function defaultValuesForm(array &$form, FormStateInterface &$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 4f5c5d5..9f80a6f 100644 --- a/core/modules/file/src/Plugin/Field/FieldType/FileItem.php +++ b/core/modules/file/src/Plugin/Field/FieldType/FileItem.php @@ -107,7 +107,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public function settingsForm(array &$form, FormStateInterface &$form_state, $has_data) { + public function settingsForm(array &$form, FormStateInterface $form_state, $has_data) { $element = array(); $element['#attached']['library'][] = 'file/drupal.file'; @@ -149,7 +149,7 @@ public function settingsForm(array &$form, FormStateInterface &$form_state, $has /** * {@inheritdoc} */ - public function instanceSettingsForm(array $form, FormStateInterface &$form_state) { + public function instanceSettingsForm(array $form, FormStateInterface $form_state) { $element = array(); $settings = $this->getSettings(); @@ -209,7 +209,7 @@ public function instanceSettingsForm(array $form, FormStateInterface &$form_stat * This function is assigned as an #element_validate callback in * instanceSettingsForm(). */ - public static function validateDirectory($element, FormStateInterface &$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); @@ -225,7 +225,7 @@ public static function validateDirectory($element, FormStateInterface &$form_sta * 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, FormStateInterface &$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)); @@ -248,7 +248,7 @@ public static function validateExtensions($element, FormStateInterface &$form_st * This function is assigned as an #element_validate callback in * instanceSettingsForm(). */ - public static function validateMaxFilesize($element, FormStateInterface &$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 75e81a0..6ad7812 100644 --- a/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php +++ b/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php @@ -40,7 +40,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$form_state) { + public function settingsForm(array $form, FormStateInterface $form_state) { $element['progress_indicator'] = array( '#type' => 'radios', '#title' => t('Progress indicator'), @@ -70,7 +70,7 @@ public function settingsSummary() { * * Special handling for draggable multiple widgets and 'add more' button. */ - protected function formMultipleElements(FieldItemListInterface $items, array &$form, FormStateInterface &$form_state) { + protected function formMultipleElements(FieldItemListInterface $items, array &$form, FormStateInterface $form_state) { $field_name = $this->fieldDefinition->getName(); $parents = $form['#parents']; @@ -187,7 +187,7 @@ protected function formMultipleElements(FieldItemListInterface $items, array &$f /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$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 @@ -257,7 +257,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen /** * {@inheritdoc} */ - public function massageFormValues(array $values, array $form, FormStateInterface &$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. @@ -307,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, FormStateInterface &$form_state, $form) { + public static function validateMultipleCount($element, FormStateInterface $form_state, $form) { $parents = $element['#parents']; $values = NestedArray::getValue($form_state['values'], $parents); @@ -342,7 +342,7 @@ public static function validateMultipleCount($element, FormStateInterface &$form * * This method is assigned as a #process callback in formElement() method. */ - public static function process($element, FormStateInterface &$form_state, $form) { + public static function process($element, FormStateInterface $form_state, $form) { $item = $element['#value']; $item['fids'] = $element['fids']['#value']; @@ -420,7 +420,7 @@ public static function process($element, FormStateInterface &$form_state, $form) * This method on is assigned as a #process callback in formMultipleElements() * method. */ - public static function processMultiple($element, FormStateInterface &$form_state, $form) { + public static function processMultiple($element, FormStateInterface $form_state, $form) { $element_children = Element::children($element, TRUE); $count = count($element_children); @@ -485,7 +485,7 @@ protected static function getDescriptionFromElement($element) { * * @see file_managed_file_submit() */ - public static function submit($form, FormStateInterface &$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 8ab3851..ba53c81 100644 --- a/core/modules/file/src/Plugin/views/field/Extension.php +++ b/core/modules/file/src/Plugin/views/field/Extension.php @@ -32,7 +32,7 @@ protected function defineOptions() { /** * {@inheritdoc} */ - public function buildOptionsForm(&$form, FormStateInterface &$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 da6ff84..135ff7f 100644 --- a/core/modules/file/src/Plugin/views/field/File.php +++ b/core/modules/file/src/Plugin/views/field/File.php @@ -42,7 +42,7 @@ protected function defineOptions() { /** * Provide link to file option */ - public function buildOptionsForm(&$form, FormStateInterface &$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 f101c08..5576e34 100644 --- a/core/modules/file/src/Plugin/views/field/FileMime.php +++ b/core/modules/file/src/Plugin/views/field/FileMime.php @@ -25,7 +25,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 53a4725..2d2c481 100644 --- a/core/modules/file/src/Plugin/views/field/Uri.php +++ b/core/modules/file/src/Plugin/views/field/Uri.php @@ -23,7 +23,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 708d924..19264cc 100644 --- a/core/modules/file/tests/file_module_test/src/Form/FileModuleTestForm.php +++ b/core/modules/file/tests/file_module_test/src/Form/FileModuleTestForm.php @@ -38,7 +38,7 @@ public function getFormId() { * @param array $default_fids * (optional) Any default file IDs to use. */ - public function buildForm(array $form, FormStateInterface &$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( @@ -71,7 +71,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $tree = /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 a4139e3..68ebf61 100644 --- a/core/modules/file/tests/file_test/src/Form/FileTestForm.php +++ b/core/modules/file/tests/file_test/src/Form/FileTestForm.php @@ -24,7 +24,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form['file_test_upload'] = array( '#type' => 'file', '#title' => t('Upload a file'), @@ -73,12 +73,12 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$form_state) {} + public function validateForm(array &$form, FormStateInterface $form_state) {} /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 0494eb0..8c6ad4a 100644 --- a/core/modules/filter/src/FilterFormatAddForm.php +++ b/core/modules/filter/src/FilterFormatAddForm.php @@ -17,14 +17,14 @@ class FilterFormatAddForm extends FilterFormatFormBase { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { return parent::form($form, $form_state); } /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 00a5c12..ab437ac 100644 --- a/core/modules/filter/src/FilterFormatEditForm.php +++ b/core/modules/filter/src/FilterFormatEditForm.php @@ -18,7 +18,7 @@ class FilterFormatEditForm extends FilterFormatFormBase { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { if (!$this->entity->status()) { throw new NotFoundHttpException(); } @@ -32,7 +32,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 efef10e..fce0b93 100644 --- a/core/modules/filter/src/FilterFormatFormBase.php +++ b/core/modules/filter/src/FilterFormatFormBase.php @@ -48,7 +48,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $format = $this->entity; $is_fallback = ($format->id() == $this->config('filter.settings')->get('fallback_format')); @@ -210,7 +210,7 @@ public function exists($format_id) { /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$form_state) { + public function validate(array $form, FormStateInterface $form_state) { parent::validate($form, $form_state); // @todo Move trimming upstream. @@ -234,7 +234,7 @@ public function validate(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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. @@ -266,7 +266,7 @@ public function submit(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$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 05c3b2c..0003cfa 100644 --- a/core/modules/filter/src/FilterFormatListBuilder.php +++ b/core/modules/filter/src/FilterFormatListBuilder.php @@ -137,7 +137,7 @@ public function getDefaultOperations(EntityInterface $entity) { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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; @@ -146,7 +146,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 52dfac9..dbb67f9 100644 --- a/core/modules/filter/src/Form/FilterDisableForm.php +++ b/core/modules/filter/src/Form/FilterDisableForm.php @@ -47,7 +47,7 @@ public function getDescription() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 0eac79b..b76933e 100644 --- a/core/modules/filter/src/Plugin/Filter/FilterHtml.php +++ b/core/modules/filter/src/Plugin/Filter/FilterHtml.php @@ -32,7 +32,7 @@ class FilterHtml extends FilterBase { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 51427c3..a915052 100644 --- a/core/modules/filter/src/Plugin/Filter/FilterUrl.php +++ b/core/modules/filter/src/Plugin/Filter/FilterUrl.php @@ -28,7 +28,7 @@ class FilterUrl extends FilterBase { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 f912864..2b39147 100644 --- a/core/modules/filter/src/Plugin/FilterBase.php +++ b/core/modules/filter/src/Plugin/FilterBase.php @@ -142,7 +142,7 @@ public function getDescription() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 da3d1c4..aa2438b 100644 --- a/core/modules/filter/src/Plugin/FilterInterface.php +++ b/core/modules/filter/src/Plugin/FilterInterface.php @@ -140,7 +140,7 @@ public function getDescription(); * 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, FormStateInterface &$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 0747ff9..8f90746 100644 --- a/core/modules/filter/tests/filter_test/src/Form/FilterTestFormatForm.php +++ b/core/modules/filter/tests/filter_test/src/Form/FilterTestFormatForm.php @@ -24,7 +24,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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; @@ -110,7 +110,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 5e4572e..faba204 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -202,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, FormStateInterface &$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()) { @@ -388,7 +388,7 @@ function forum_comment_delete(CommentInterface $comment) { /** * Implements hook_form_BASE_FORM_ID_alter(). */ -function forum_form_taxonomy_vocabulary_form_alter(&$form, FormStateInterface &$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()) { @@ -410,7 +410,7 @@ function forum_form_taxonomy_vocabulary_form_alter(&$form, FormStateInterface &$ /** * Implements hook_form_FORM_ID_alter() for taxonomy_term_form(). */ -function forum_form_taxonomy_term_form_alter(&$form, FormStateInterface &$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. @@ -421,7 +421,7 @@ function forum_form_taxonomy_term_form_alter(&$form, FormStateInterface &$form_s /** * Implements hook_form_BASE_FORM_ID_alter() for node_form(). */ -function forum_form_node_form_alter(&$form, FormStateInterface &$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 3840c15..e167d74 100644 --- a/core/modules/forum/src/Form/ContainerForm.php +++ b/core/modules/forum/src/Form/ContainerForm.php @@ -24,7 +24,7 @@ class ContainerForm extends ForumForm { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$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); @@ -42,7 +42,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 5d2b377..a3f6824 100644 --- a/core/modules/forum/src/Form/DeleteForm.php +++ b/core/modules/forum/src/Form/DeleteForm.php @@ -55,7 +55,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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); @@ -64,7 +64,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, TermInte /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 f759cbf..9dfb9f0 100644 --- a/core/modules/forum/src/Form/ForumForm.php +++ b/core/modules/forum/src/Form/ForumForm.php @@ -32,7 +32,7 @@ class ForumForm extends TermForm { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$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); @@ -62,7 +62,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function buildEntity(array $form, FormStateInterface &$form_state) { + public function buildEntity(array $form, FormStateInterface $form_state) { $term = parent::buildEntity($form, $form_state); // Assign parents from forum parent select field. @@ -74,7 +74,7 @@ public function buildEntity(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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); @@ -99,7 +99,7 @@ public function save(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$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 1ba8a24..98688ab 100644 --- a/core/modules/forum/src/Form/Overview.php +++ b/core/modules/forum/src/Form/Overview.php @@ -61,7 +61,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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 64e3c89..51b42a3 100644 --- a/core/modules/forum/src/ForumSettingsForm.php +++ b/core/modules/forum/src/ForumSettingsForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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); @@ -64,7 +64,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 eb7161c..b9bab02 100644 --- a/core/modules/forum/src/Plugin/Block/ForumBlockBase.php +++ b/core/modules/forum/src/Plugin/Block/ForumBlockBase.php @@ -64,7 +64,7 @@ protected function blockAccess(AccountInterface $account) { /** * {@inheritdoc} */ - public function blockForm($form, FormStateInterface &$form_state) { + public function blockForm($form, FormStateInterface $form_state) { $range = range(2, 20); $form['block_count'] = array( '#type' => 'select', @@ -78,7 +78,7 @@ public function blockForm($form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function blockSubmit($form, FormStateInterface &$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 c47594d..4a7d0c1 100644 --- a/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php +++ b/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php @@ -55,7 +55,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 ffcf52d..70866c8 100644 --- a/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php +++ b/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php @@ -32,7 +32,7 @@ public function usesGroupBy() { return FALSE; } - public function buildExposeForm(&$form, FormStateInterface &$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']); @@ -40,7 +40,7 @@ public function buildExposeForm(&$form, FormStateInterface &$form_state) { unset($form['expose']['remember']); } - protected function valueForm(&$form, FormStateInterface &$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 f36c568..7b391b5 100644 --- a/core/modules/image/src/ConfigurableImageEffectBase.php +++ b/core/modules/image/src/ConfigurableImageEffectBase.php @@ -17,13 +17,13 @@ /** * {@inheritdoc} */ - public function validateConfigurationForm(array &$form, FormStateInterface &$form_state) { + public function validateConfigurationForm(array &$form, FormStateInterface $form_state) { } /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 8a13e74..e491d07 100644 --- a/core/modules/image/src/Form/ImageEffectAddForm.php +++ b/core/modules/image/src/Form/ImageEffectAddForm.php @@ -47,7 +47,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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 4005515..4663672 100644 --- a/core/modules/image/src/Form/ImageEffectDeleteForm.php +++ b/core/modules/image/src/Form/ImageEffectDeleteForm.php @@ -61,7 +61,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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); @@ -71,7 +71,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, ImageSty /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 2cb143c..1e2ba85 100644 --- a/core/modules/image/src/Form/ImageEffectEditForm.php +++ b/core/modules/image/src/Form/ImageEffectEditForm.php @@ -18,7 +18,7 @@ class ImageEffectEditForm extends ImageEffectFormBase { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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 f31c105..b819568 100644 --- a/core/modules/image/src/Form/ImageEffectFormBase.php +++ b/core/modules/image/src/Form/ImageEffectFormBase.php @@ -55,7 +55,7 @@ public function getFormId() { * * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException */ - public function buildForm(array $form, FormStateInterface &$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); @@ -103,7 +103,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, ImageSty /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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 = new FormState(array( @@ -115,7 +115,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$form_state) { + public function submitForm(array &$form, FormStateInterface $form_state) { form_state_values_clean($form_state); // The image effect configuration is stored in the 'data' key in the form, diff --git a/core/modules/image/src/Form/ImageStyleAddForm.php b/core/modules/image/src/Form/ImageStyleAddForm.php index 36632df..7d34a1d 100644 --- a/core/modules/image/src/Form/ImageStyleAddForm.php +++ b/core/modules/image/src/Form/ImageStyleAddForm.php @@ -17,7 +17,7 @@ class ImageStyleAddForm extends ImageStyleFormBase { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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()))); } @@ -25,7 +25,7 @@ public function save(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function actions(array $form, FormStateInterface &$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 5d937f4..7aeacb1 100644 --- a/core/modules/image/src/Form/ImageStyleDeleteForm.php +++ b/core/modules/image/src/Form/ImageStyleDeleteForm.php @@ -47,7 +47,7 @@ public function getDescription() { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$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'), @@ -62,7 +62,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 c3ca46d..f861ef1 100644 --- a/core/modules/image/src/Form/ImageStyleEditForm.php +++ b/core/modules/image/src/Form/ImageStyleEditForm.php @@ -53,7 +53,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$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(); @@ -156,7 +156,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * Validate handler for image effect. */ - public function effectValidate($form, FormStateInterface &$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.')); } @@ -165,7 +165,7 @@ public function effectValidate($form, FormStateInterface &$form_state) { /** * Submit handler for image effect. */ - public function effectSave($form, FormStateInterface &$form_state) { + public function effectSave($form, FormStateInterface $form_state) { // Update image effect weights. if (!empty($form_state['values']['effects'])) { @@ -215,7 +215,7 @@ public function effectSave($form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$form_state) { + public function save(array $form, FormStateInterface $form_state) { // Update image effect weights. if (!empty($form_state['values']['effects'])) { @@ -229,7 +229,7 @@ public function save(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function actions(array $form, FormStateInterface &$form_state) { + public function actions(array $form, FormStateInterface $form_state) { $actions = parent::actions($form, $form_state); $actions['submit']['#value'] = $this->t('Update style'); @@ -254,7 +254,7 @@ protected function updateEffectWeights(array $effects) { /** * {@inheritdoc} */ - protected function copyFormValuesToEntity(EntityInterface $entity, array $form, FormStateInterface &$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 33e5d26..a1dbddf 100644 --- a/core/modules/image/src/Form/ImageStyleFlushForm.php +++ b/core/modules/image/src/Form/ImageStyleFlushForm.php @@ -47,7 +47,7 @@ public function getCancelRoute() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 856309e..ad4ce5c 100644 --- a/core/modules/image/src/Form/ImageStyleFormBase.php +++ b/core/modules/image/src/Form/ImageStyleFormBase.php @@ -53,7 +53,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form['label'] = array( '#type' => 'textfield', @@ -76,7 +76,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 30f5020..069178d 100644 --- a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php +++ b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php @@ -36,7 +36,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 b9f7ad9..d1489c8 100644 --- a/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php +++ b/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php @@ -153,7 +153,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public function settingsForm(array &$form, FormStateInterface &$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() @@ -183,7 +183,7 @@ public function settingsForm(array &$form, FormStateInterface &$form_state, $has /** * {@inheritdoc} */ - public function instanceSettingsForm(array $form, FormStateInterface &$form_state) { + public function instanceSettingsForm(array $form, FormStateInterface $form_state) { // Get base form from FileItem::instanceSettingsForm(). $element = parent::instanceSettingsForm($form, $form_state); @@ -314,7 +314,7 @@ public function preSave() { /** * Element validate function for resolution fields. */ - public static function validateResolution($element, FormStateInterface &$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']) { @@ -387,7 +387,7 @@ protected function defaultImageForm(array &$element, array $settings) { * @param \Drupal\Core\Form\FormStateInterface $form_state * The form state. */ - public static function validateDefaultImageForm(array &$element, FormStateInterface &$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 e936cb5..c38ccba 100644 --- a/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php +++ b/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php @@ -38,7 +38,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$form_state) { + public function settingsForm(array $form, FormStateInterface $form_state) { $element = parent::settingsForm($form, $form_state); $element['preview_image_style'] = array( @@ -83,7 +83,7 @@ public function settingsSummary() { * * Special handling for draggable multiple widgets and 'add more' button. */ - protected function formMultipleElements(FieldItemListInterface $items, array &$form, FormStateInterface &$form_state) { + protected function formMultipleElements(FieldItemListInterface $items, array &$form, FormStateInterface $form_state) { $elements = parent::formMultipleElements($items, $form, $form_state); $cardinality = $this->fieldDefinition->getFieldStorageDefinition()->getCardinality(); @@ -110,7 +110,7 @@ protected function formMultipleElements(FieldItemListInterface $items, array &$f /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$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(); @@ -145,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, FormStateInterface &$form_state, $form) { + public static function process($element, FormStateInterface $form_state, $form) { $item = $element['#value']; $item['fids'] = $element['fids']['#value']; @@ -228,7 +228,7 @@ public static function process($element, FormStateInterface &$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, FormStateInterface &$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 9cf7b12..0edac98 100644 --- a/core/modules/image/src/Plugin/ImageEffect/CropImageEffect.php +++ b/core/modules/image/src/Plugin/ImageEffect/CropImageEffect.php @@ -60,7 +60,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$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 a9bdc6a..15f0080 100644 --- a/core/modules/image/src/Plugin/ImageEffect/ResizeImageEffect.php +++ b/core/modules/image/src/Plugin/ImageEffect/ResizeImageEffect.php @@ -68,7 +68,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form['width'] = array( '#type' => 'number', '#title' => t('Width'), @@ -91,7 +91,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 3490ca9..7f29aaf 100644 --- a/core/modules/image/src/Plugin/ImageEffect/RotateImageEffect.php +++ b/core/modules/image/src/Plugin/ImageEffect/RotateImageEffect.php @@ -98,7 +98,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form['degrees'] = array( '#type' => 'number', '#default_value' => $this->configuration['degrees'], @@ -127,7 +127,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function validateConfigurationForm(array &$form, FormStateInterface &$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.')); } @@ -136,7 +136,7 @@ public function validateConfigurationForm(array &$form, FormStateInterface &$for /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 917ac71..a5dae9a 100644 --- a/core/modules/image/src/Plugin/ImageEffect/ScaleImageEffect.php +++ b/core/modules/image/src/Plugin/ImageEffect/ScaleImageEffect.php @@ -67,7 +67,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form = parent::buildConfigurationForm($form, $form_state); $form['width']['#required'] = FALSE; $form['height']['#required'] = FALSE; @@ -83,7 +83,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function validateConfigurationForm(array &$form, FormStateInterface &$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.')); @@ -93,7 +93,7 @@ public function validateConfigurationForm(array &$form, FormStateInterface &$for /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 42dfed6..0909511 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -215,7 +215,7 @@ function language_configuration_element_default_options() { /** * Process handler for the language_configuration form element. */ -function language_configuration_element_process($element, FormStateInterface &$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. @@ -266,7 +266,7 @@ function language_configuration_element_process($element, FormStateInterface &$f /** * Submit handler for the forms that have a language_configuration element. */ -function language_configuration_element_submit(&$form, FormStateInterface &$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'])) { @@ -651,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, FormStateInterface &$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) { @@ -674,7 +674,7 @@ function language_form_system_regional_settings_alter(&$form, FormStateInterface * * @see language_form_system_regional_settings_alter() */ -function language_system_regional_settings_form_submit($form, FormStateInterface &$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 0799ff2..47c136e 100644 --- a/core/modules/language/src/Form/ContentLanguageSettingsForm.php +++ b/core/modules/language/src/Form/ContentLanguageSettingsForm.php @@ -59,7 +59,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $entity_types = $this->entityManager->getDefinitions(); $labels = array(); $default = array(); @@ -147,7 +147,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 423a2ef..692cae9 100644 --- a/core/modules/language/src/Form/LanguageAddForm.php +++ b/core/modules/language/src/Form/LanguageAddForm.php @@ -27,7 +27,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form['#title'] = $this->t('Add language'); $predefined_languages = $this->languageManager->getStandardLanguageListWithoutConfigured(); @@ -82,7 +82,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$form_state) { + public function submitForm(array &$form, FormStateInterface $form_state) { $langcode = $form_state['values']['predefined_langcode']; if ($langcode == 'custom') { $langcode = $form_state['values']['langcode']; @@ -110,7 +110,7 @@ public function submitForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function actions(array $form, FormStateInterface &$form_state) { + public function actions(array $form, FormStateInterface $form_state) { // No actions needed. return array(); } @@ -118,7 +118,7 @@ public function actions(array $form, FormStateInterface &$form_state) { /** * Validates the language addition form on custom language button. */ - public function validateCustom(array $form, FormStateInterface &$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. @@ -136,7 +136,7 @@ public function validateCustom(array $form, FormStateInterface &$form_state) { /** * Element specific validator for the Add language button. */ - public function validatePredefined($form, FormStateInterface &$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 Add custom language.')); diff --git a/core/modules/language/src/Form/LanguageDeleteForm.php b/core/modules/language/src/Form/LanguageDeleteForm.php index 5632a51..979c2c8 100644 --- a/core/modules/language/src/Form/LanguageDeleteForm.php +++ b/core/modules/language/src/Form/LanguageDeleteForm.php @@ -85,7 +85,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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. @@ -106,7 +106,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 f1030a8..f5d7498 100644 --- a/core/modules/language/src/Form/LanguageEditForm.php +++ b/core/modules/language/src/Form/LanguageEditForm.php @@ -26,7 +26,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $this->commonForm($form); return parent::form($form, $form_state); } @@ -34,7 +34,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function actions(array $form, FormStateInterface &$form_state) { + public function actions(array $form, FormStateInterface $form_state) { $actions['submit'] = array( '#type' => 'submit', '#value' => $this->t('Save language'), @@ -47,7 +47,7 @@ public function actions(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 01fce3c..880a017 100644 --- a/core/modules/language/src/Form/LanguageFormBase.php +++ b/core/modules/language/src/Form/LanguageFormBase.php @@ -97,7 +97,7 @@ public function commonForm(array &$form) { /** * Validates the language editing element. */ - public function validateCommon(array $form, FormStateInterface &$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 0e42778..d0da6d1 100644 --- a/core/modules/language/src/Form/NegotiationBrowserDeleteForm.php +++ b/core/modules/language/src/Form/NegotiationBrowserDeleteForm.php @@ -46,7 +46,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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); @@ -59,7 +59,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $browser /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 1988567..9d1177b 100644 --- a/core/modules/language/src/Form/NegotiationBrowserForm.php +++ b/core/modules/language/src/Form/NegotiationBrowserForm.php @@ -56,7 +56,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form = array(); // Initialize a language list to the ones available, including English. @@ -129,7 +129,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$form_state) { + public function validateForm(array &$form, FormStateInterface $form_state) { // Array to check if all browser language codes are unique. $unique_values = array(); @@ -168,7 +168,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 d1741bb..afc39aa 100644 --- a/core/modules/language/src/Form/NegotiationConfigureForm.php +++ b/core/modules/language/src/Form/NegotiationConfigureForm.php @@ -94,7 +94,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $configurable = $this->languageTypes->get('configurable'); $form = array( @@ -128,7 +128,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 3dddccb..f88daa8 100644 --- a/core/modules/language/src/Form/NegotiationSelectedForm.php +++ b/core/modules/language/src/Form/NegotiationSelectedForm.php @@ -26,7 +26,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('language.negotiation'); $form['selected_langcode'] = array( '#type' => 'language_select', @@ -41,7 +41,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 2f7cca6..ef4cb3d 100644 --- a/core/modules/language/src/Form/NegotiationSessionForm.php +++ b/core/modules/language/src/Form/NegotiationSessionForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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'), @@ -42,7 +42,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 e1c3d29..96cbbb8 100644 --- a/core/modules/language/src/Form/NegotiationUrlForm.php +++ b/core/modules/language/src/Form/NegotiationUrlForm.php @@ -26,7 +26,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { global $base_url; $config = $this->config('language.negotiation'); @@ -97,7 +97,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * Implements \Drupal\Core\Form\FormInterface::validateForm(). */ - public function validateForm(array &$form, FormStateInterface &$form_state) { + public function validateForm(array &$form, FormStateInterface $form_state) { $languages = language_list(); // Count repeated values for uniqueness check. @@ -161,7 +161,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 a9b229d..3c28810 100644 --- a/core/modules/language/src/LanguageListBuilder.php +++ b/core/modules/language/src/LanguageListBuilder.php @@ -76,7 +76,7 @@ public function buildRow(EntityInterface $entity) { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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'); @@ -86,7 +86,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 f193617..3ae2b09 100644 --- a/core/modules/language/src/Plugin/Condition/Language.php +++ b/core/modules/language/src/Plugin/Condition/Language.php @@ -28,7 +28,7 @@ class Language extends ConditionPluginBase { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { if (\Drupal::languageManager()->isMultilingual()) { // Fetch languages. $languages = language_list(LanguageInterface::STATE_ALL); @@ -56,7 +56,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$form_state) { + public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { $this->configuration['langcodes'] = array_filter($form_state['values']['langcodes']); parent::submitConfigurationForm($form, $form_state); } diff --git a/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElement.php b/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElement.php index 270fd16..f9a0e1b 100644 --- a/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElement.php +++ b/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElement.php @@ -24,7 +24,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $conf = language_get_default_configuration('some_custom_type', 'some_bundle'); $form['lang_configuration'] = array( @@ -47,6 +47,6 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 753e45e..130c069 100644 --- a/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElementTest.php +++ b/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElementTest.php @@ -24,7 +24,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form['langcode'] = array( '#title' => t('Language select'), '#type' => 'language_select', @@ -36,6 +36,6 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 16df1c7..0c08d66 100644 --- a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php +++ b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php @@ -43,7 +43,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 00a3fdd..f8639bb 100644 --- a/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php +++ b/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php @@ -105,7 +105,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition) /** * {@inheritdoc} */ - public function instanceSettingsForm(array $form, FormStateInterface &$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 b5666f8..568f64c 100644 --- a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php +++ b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php @@ -43,7 +43,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$form_state) { + public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { $default_url_value = NULL; if (isset($items[$delta]->url)) { @@ -139,7 +139,7 @@ protected function supportsExternalLinks() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$form_state) { + public function settingsForm(array $form, FormStateInterface $form_state) { $elements = parent::settingsForm($form, $form_state); $elements['placeholder_url'] = array( @@ -191,7 +191,7 @@ public function settingsSummary() { * * Conditionally requires the link title if a URL value was filled in. */ - public function validateTitle(&$element, FormStateInterface &$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']))); @@ -201,7 +201,7 @@ public function validateTitle(&$element, FormStateInterface &$form_state, $form) /** * {@inheritdoc} */ - public function massageFormValues(array $values, array $form, FormStateInterface &$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 014835e..0651607 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -643,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, FormStateInterface &$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(); @@ -696,7 +696,7 @@ function locale_form_language_admin_overview_form_alter(&$form, FormStateInterfa /** * Implements hook_form_FORM_ID_alter() for language_admin_add_form((). */ -function locale_form_language_admin_add_form_alter(&$form, FormStateInterface &$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'; } @@ -732,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, FormStateInterface &$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 3d6d1ea..dcac323 100644 --- a/core/modules/locale/src/Form/ExportForm.php +++ b/core/modules/locale/src/Form/ExportForm.php @@ -57,7 +57,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $languages = $this->languageManager->getLanguages(); $language_options = array(); foreach ($languages as $langcode => $language) { @@ -128,7 +128,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 74a5164..e789a0d 100644 --- a/core/modules/locale/src/Form/ImportForm.php +++ b/core/modules/locale/src/Form/ImportForm.php @@ -72,7 +72,7 @@ public function getFormID() { /** * Form constructor for the translation import screen. */ - public function buildForm(array $form, FormStateInterface &$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 @@ -158,7 +158,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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. @@ -170,7 +170,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 2a8a509..ccd6549 100644 --- a/core/modules/locale/src/Form/LocaleSettingsForm.php +++ b/core/modules/locale/src/Form/LocaleSettingsForm.php @@ -24,7 +24,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('locale.settings'); $form['update_interval_days'] = array( @@ -84,7 +84,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * Implements \Drupal\Core\Form\FormInterface::validateForm(). */ - public function validateForm(array &$form, FormStateInterface &$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) { @@ -95,7 +95,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 9d8eb88..83c45f9 100644 --- a/core/modules/locale/src/Form/TranslateEditForm.php +++ b/core/modules/locale/src/Form/TranslateEditForm.php @@ -27,7 +27,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $filter_values = $this->translateFilterValues(); $langcode = $filter_values['langcode']; @@ -159,7 +159,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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) { @@ -175,7 +175,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 fb25981..a9be9f5 100644 --- a/core/modules/locale/src/Form/TranslateFilterForm.php +++ b/core/modules/locale/src/Form/TranslateFilterForm.php @@ -24,7 +24,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $filters = $this->translateFilters(); $filter_values = $this->translateFilterValues(); @@ -84,7 +84,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$form_state) { + public function submitForm(array &$form, FormStateInterface $form_state) { $filters = $this->translateFilters(); foreach ($filters as $name => $filter) { if (isset($form_state['values'][$name])) { @@ -97,7 +97,7 @@ public function submitForm(array &$form, FormStateInterface &$form_state) { /** * Provides a submit handler for the reset button. */ - public function resetForm(array &$form, FormStateInterface &$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 7e2cd48..b09658f 100644 --- a/core/modules/locale/src/Form/TranslationStatusForm.php +++ b/core/modules/locale/src/Form/TranslationStatusForm.php @@ -68,7 +68,7 @@ public function getFormID() { * * @ingroup forms */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $languages = locale_translatable_language_list(); $status = locale_translation_get_status(); $options = array(); @@ -265,7 +265,7 @@ protected function createInfoString($project_info) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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.')); @@ -275,7 +275,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 5c2eea9..0c49cc9 100644 --- a/core/modules/menu_link/src/MenuLinkForm.php +++ b/core/modules/menu_link/src/MenuLinkForm.php @@ -71,7 +71,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$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. @@ -193,7 +193,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$form_state) { + protected function actions(array $form, FormStateInterface $form_state) { $element = parent::actions($form, $form_state); $element['submit']['#button_type'] = 'primary'; return $element; @@ -202,7 +202,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$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); @@ -242,7 +242,7 @@ public function validate(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function buildEntity(array $form, FormStateInterface &$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; @@ -271,7 +271,7 @@ public function buildEntity(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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); @@ -289,7 +289,7 @@ public function submit(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 b6af48a..a2ef585 100644 --- a/core/modules/menu_ui/menu_ui.module +++ b/core/modules/menu_ui/menu_ui.module @@ -378,7 +378,7 @@ function menu_ui_node_predelete(EntityInterface $node) { /** * Implements hook_node_prepare_form(). */ -function menu_ui_node_prepare_form(NodeInterface $node, $operation, FormStateInterface &$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 7069ee1..b751317 100644 --- a/core/modules/menu_ui/src/Form/MenuDeleteForm.php +++ b/core/modules/menu_ui/src/Form/MenuDeleteForm.php @@ -93,7 +93,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 4323af4..18437b0 100644 --- a/core/modules/menu_ui/src/Form/MenuLinkDeleteForm.php +++ b/core/modules/menu_ui/src/Form/MenuLinkDeleteForm.php @@ -35,7 +35,7 @@ public function getCancelRoute() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 673b544..ba5e5dc 100644 --- a/core/modules/menu_ui/src/Form/MenuLinkResetForm.php +++ b/core/modules/menu_ui/src/Form/MenuLinkResetForm.php @@ -49,7 +49,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 026ffd5..00994ce 100644 --- a/core/modules/menu_ui/src/MenuForm.php +++ b/core/modules/menu_ui/src/MenuForm.php @@ -80,7 +80,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $menu = $this->entity; if ($this->operation == 'edit') { @@ -176,7 +176,7 @@ public function menuNameExists($value) { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$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 @@ -197,7 +197,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * Submit handler to update the bundle for the default language configuration. */ - public function languageConfigurationSubmit(array &$form, FormStateInterface &$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. @@ -210,7 +210,7 @@ public function languageConfigurationSubmit(array &$form, FormStateInterface &$f /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$form_state) { + public function save(array $form, FormStateInterface $form_state) { $menu = $this->entity; if (!$menu->isNew() || $menu->isLocked()) { $this->submitOverviewForm($form, $form_state); @@ -245,7 +245,7 @@ public function save(array $form, FormStateInterface &$form_state) { * Forms integrating this section should call menu_overview_form_submit() from * their form submit handler. */ - protected function buildOverviewForm(array &$form, FormStateInterface &$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; @@ -366,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, FormStateInterface &$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 2f16a48..77c3c15 100644 --- a/core/modules/menu_ui/src/MenuSettingsForm.php +++ b/core/modules/menu_ui/src/MenuSettingsForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('menu_ui.settings'); $form['intro'] = array( '#type' => 'item', @@ -61,7 +61,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 3998a48..bb621cf 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, \Drupal\Core\Form\FormStateInterface &$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, \Drupal\Cor * * @ingroup entity_crud */ -function hook_node_submit(\Drupal\node\NodeInterface $node, $form, \Drupal\Core\Form\FormStateInterface &$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 22b6f7e..bff528b 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -1054,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, FormStateInterface &$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', @@ -1072,7 +1072,7 @@ function node_form_system_site_information_settings_form_alter(&$form, FormState * * @see node_form_system_site_information_settings_form_alter() */ -function node_form_system_site_information_settings_form_submit($form, FormStateInterface &$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(); @@ -1085,7 +1085,7 @@ function node_form_system_site_information_settings_form_submit($form, FormState * * @see node_form_system_themes_admin_form_submit() */ -function node_form_system_themes_admin_form_alter(&$form, FormStateInterface &$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'), @@ -1099,7 +1099,7 @@ function node_form_system_themes_admin_form_alter(&$form, FormStateInterface &$f * * @see node_form_system_themes_admin_form_alter() */ -function node_form_system_themes_admin_form_submit($form, FormStateInterface &$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 a95a255..e848f3e 100644 --- a/core/modules/node/node.pages.inc +++ b/core/modules/node/node.pages.inc @@ -49,7 +49,7 @@ function template_preprocess_node_add_list(&$variables) { * * @see node_form_build_preview() */ -function node_preview(NodeInterface $node, FormStateInterface &$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 a044643..cbf7ed0 100644 --- a/core/modules/node/src/Form/DeleteMultiple.php +++ b/core/modules/node/src/Form/DeleteMultiple.php @@ -94,7 +94,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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))); @@ -116,7 +116,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 c1e44cb..67a1517 100644 --- a/core/modules/node/src/Form/NodeDeleteForm.php +++ b/core/modules/node/src/Form/NodeDeleteForm.php @@ -72,7 +72,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 7723208..9c91d3f 100644 --- a/core/modules/node/src/Form/NodeRevisionDeleteForm.php +++ b/core/modules/node/src/Form/NodeRevisionDeleteForm.php @@ -105,7 +105,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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); @@ -117,7 +117,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $node_re /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 c56835a..a3dcca6 100644 --- a/core/modules/node/src/Form/NodeRevisionRevertForm.php +++ b/core/modules/node/src/Form/NodeRevisionRevertForm.php @@ -88,7 +88,7 @@ public function getDescription() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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); @@ -100,7 +100,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $node_re /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 b825774..b542d38 100644 --- a/core/modules/node/src/Form/NodeTypeDeleteConfirm.php +++ b/core/modules/node/src/Form/NodeTypeDeleteConfirm.php @@ -68,7 +68,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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 = '' . 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())) . '
'; @@ -83,7 +83,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 2356775..caf96b9 100644 --- a/core/modules/node/src/Form/RebuildPermissionsForm.php +++ b/core/modules/node/src/Form/RebuildPermissionsForm.php @@ -51,7 +51,7 @@ public function getDescription() { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 5cfd220..bf4b869 100644 --- a/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -46,7 +46,7 @@ protected function prepareEntity() { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { /** @var \Drupal\node\NodeInterface $node */ $node = $this->entity; @@ -212,7 +212,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$form_state) { + protected function actions(array $form, FormStateInterface $form_state) { $element = parent::actions($form, $form_state); $node = $this->entity; $preview_mode = $this->settings['preview']; @@ -293,7 +293,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$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())) { @@ -333,7 +333,7 @@ public function validate(array $form, FormStateInterface &$form_state) { * form state's entity with the current step's values before proceeding to the * next step. */ - public function submit(array $form, FormStateInterface &$form_state) { + public function submit(array $form, FormStateInterface $form_state) { // Build the node object from the submitted values. $node = parent::submit($form, $form_state); @@ -365,7 +365,7 @@ public function submit(array $form, FormStateInterface &$form_state) { * @param $form_state * The current state of the form. */ - public function preview(array $form, FormStateInterface &$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'); @@ -381,7 +381,7 @@ public function preview(array $form, FormStateInterface &$form_state) { * @param $form_state * The current state of the form. */ - public function publish(array $form, FormStateInterface &$form_state) { + public function publish(array $form, FormStateInterface $form_state) { $node = $this->entity; $node->setPublished(TRUE); return $node; @@ -395,7 +395,7 @@ public function publish(array $form, FormStateInterface &$form_state) { * @param $form_state * The current state of the form. */ - public function unpublish(array $form, FormStateInterface &$form_state) { + public function unpublish(array $form, FormStateInterface $form_state) { $node = $this->entity; $node->setPublished(FALSE); return $node; @@ -404,7 +404,7 @@ public function unpublish(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function buildEntity(array $form, FormStateInterface &$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 @@ -428,7 +428,7 @@ public function buildEntity(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 9ee0a06..02afb6c 100644 --- a/core/modules/node/src/NodeTranslationHandler.php +++ b/core/modules/node/src/NodeTranslationHandler.php @@ -19,7 +19,7 @@ class NodeTranslationHandler extends ContentTranslationHandler { /** * {@inheritdoc} */ - public function entityFormAlter(array &$form, FormStateInterface &$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. @@ -74,7 +74,7 @@ protected function entityFormTitle(EntityInterface $entity) { /** * {@inheritdoc} */ - public function entityFormEntityBuild($entity_type, EntityInterface $entity, array $form, FormStateInterface &$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 716c105..f8cf927 100644 --- a/core/modules/node/src/NodeTypeForm.php +++ b/core/modules/node/src/NodeTypeForm.php @@ -20,7 +20,7 @@ class NodeTypeForm extends EntityForm { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form = parent::form($form, $form_state); $type = $this->entity; @@ -153,7 +153,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$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'); @@ -163,7 +163,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$form_state) { + public function validate(array $form, FormStateInterface $form_state) { parent::validate($form, $form_state); $id = trim($form_state['values']['type']); @@ -176,7 +176,7 @@ public function validate(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 bd6ced6..b2ead47 100644 --- a/core/modules/node/src/Plugin/Action/AssignOwnerNode.php +++ b/core/modules/node/src/Plugin/Action/AssignOwnerNode.php @@ -78,7 +78,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$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 = ''; @@ -118,7 +118,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function validateConfigurationForm(array &$form, FormStateInterface &$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.')); @@ -128,7 +128,7 @@ public function validateConfigurationForm(array &$form, FormStateInterface &$for /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 cbc88ec..7dab8be 100644 --- a/core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php +++ b/core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php @@ -48,7 +48,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form['keywords'] = array( '#title' => t('Keywords'), '#type' => 'textarea', @@ -61,7 +61,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 ff6c909..d0038fc 100644 --- a/core/modules/node/src/Plugin/Block/SyndicateBlock.php +++ b/core/modules/node/src/Plugin/Block/SyndicateBlock.php @@ -51,7 +51,7 @@ public function build() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$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 7f98412..9727bed 100644 --- a/core/modules/node/src/Plugin/Condition/NodeType.php +++ b/core/modules/node/src/Plugin/Condition/NodeType.php @@ -69,7 +69,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $options = array(); $node_types = $this->entityStorage->loadMultiple(); foreach ($node_types as $type) { @@ -87,7 +87,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 986c8e1..45e34b8 100644 --- a/core/modules/node/src/Plugin/Search/NodeSearch.php +++ b/core/modules/node/src/Plugin/Search/NodeSearch.php @@ -399,7 +399,7 @@ public function indexStatus() { /** * {@inheritdoc} */ - public function searchFormAlter(array &$form, FormStateInterface &$form_state) { + public function searchFormAlter(array &$form, FormStateInterface $form_state) { // Add advanced search keyword-related boxes. $form['advanced'] = array( '#type' => 'details', @@ -561,7 +561,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { // Output form for defining rank factor weights. $form['content_ranking'] = array( '#type' => 'details', @@ -590,7 +590,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 b3c79d2..9f7ff51 100644 --- a/core/modules/node/src/Plugin/views/field/Language.php +++ b/core/modules/node/src/Plugin/views/field/Language.php @@ -27,7 +27,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 5b9cd7e..b276747 100644 --- a/core/modules/node/src/Plugin/views/field/Link.php +++ b/core/modules/node/src/Plugin/views/field/Link.php @@ -33,7 +33,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 345df01..ae74239 100644 --- a/core/modules/node/src/Plugin/views/field/Node.php +++ b/core/modules/node/src/Plugin/views/field/Node.php @@ -45,7 +45,7 @@ protected function defineOptions() { /** * Provide link to node option */ - public function buildOptionsForm(&$form, FormStateInterface &$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 af41266..53b5010 100644 --- a/core/modules/node/src/Plugin/views/field/Path.php +++ b/core/modules/node/src/Plugin/views/field/Path.php @@ -38,7 +38,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 9f57537..040c63f 100644 --- a/core/modules/node/src/Plugin/views/field/Revision.php +++ b/core/modules/node/src/Plugin/views/field/Revision.php @@ -42,7 +42,7 @@ protected function defineOptions() { /** * Provide link to revision option. */ - public function buildOptionsForm(&$form, FormStateInterface &$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 8978544..4824227 100644 --- a/core/modules/node/src/Plugin/views/field/Type.php +++ b/core/modules/node/src/Plugin/views/field/Type.php @@ -30,7 +30,7 @@ protected function defineOptions() { /** * Provide machine_name option for to node type display. */ - public function buildOptionsForm(&$form, FormStateInterface &$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 b973b2e..8845ca8 100644 --- a/core/modules/node/src/Plugin/views/filter/Access.php +++ b/core/modules/node/src/Plugin/views/filter/Access.php @@ -20,7 +20,7 @@ class Access extends FilterPluginBase { public function adminSummary() { } - protected function operatorForm(&$form, FormStateInterface &$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 7fcd740..35c818e 100644 --- a/core/modules/node/src/Plugin/views/filter/Status.php +++ b/core/modules/node/src/Plugin/views/filter/Status.php @@ -21,7 +21,7 @@ class Status extends FilterPluginBase { public function adminSummary() { } - protected function operatorForm(&$form, FormStateInterface &$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 683bfbb..c79691f 100644 --- a/core/modules/node/src/Plugin/views/row/NodeRow.php +++ b/core/modules/node/src/Plugin/views/row/NodeRow.php @@ -39,7 +39,7 @@ protected function defineOptions() { /** * {@inheritdoc} */ - public function buildOptionsForm(&$form, FormStateInterface &$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 e596d59..9d3db7b 100644 --- a/core/modules/node/src/Plugin/views/row/Rss.php +++ b/core/modules/node/src/Plugin/views/row/Rss.php @@ -45,7 +45,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 919ace7..377a6c6 100644 --- a/core/modules/node/src/Plugin/views/wizard/Node.php +++ b/core/modules/node/src/Plugin/views/wizard/Node.php @@ -92,7 +92,7 @@ protected function rowStyleOptions() { * @param string $type * The display ID (e.g. 'page' or 'block'). */ - protected function buildFormStyle(array &$form, FormStateInterface &$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 @@ -157,7 +157,7 @@ protected function defaultDisplayOptions() { /** * Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayFiltersUser(). */ - protected function defaultDisplayFiltersUser(array $form, FormStateInterface &$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'])) { @@ -184,7 +184,7 @@ protected function defaultDisplayFiltersUser(array $form, FormStateInterface &$f /** * {@inheritdoc} */ - protected function pageDisplayOptions(array $form, FormStateInterface &$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(); @@ -195,7 +195,7 @@ protected function pageDisplayOptions(array $form, FormStateInterface &$form_sta /** * {@inheritdoc} */ - protected function blockDisplayOptions(array $form, FormStateInterface &$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(); @@ -234,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, FormStateInterface &$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 1adecd7..c31a666 100644 --- a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php +++ b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php @@ -73,7 +73,7 @@ public function isEmpty() { /** * {@inheritdoc} */ - public function settingsForm(array &$form, FormStateInterface &$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'); @@ -122,7 +122,7 @@ public function settingsForm(array &$form, FormStateInterface &$form_state, $has * * @see form_process_pattern() */ - public static function validateAllowedValues($element, FormStateInterface &$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 63aee21..aed9a29 100644 --- a/core/modules/options/src/Plugin/Field/FieldWidget/ButtonsWidget.php +++ b/core/modules/options/src/Plugin/Field/FieldWidget/ButtonsWidget.php @@ -30,7 +30,7 @@ class ButtonsWidget extends OptionsWidgetBase { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$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 fde0334..9f1e014 100644 --- a/core/modules/options/src/Plugin/Field/FieldWidget/OptionsWidgetBase.php +++ b/core/modules/options/src/Plugin/Field/FieldWidget/OptionsWidgetBase.php @@ -55,7 +55,7 @@ public function __construct($plugin_id, $plugin_definition, FieldDefinitionInter /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$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']; @@ -79,7 +79,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen * @param \Drupal\Core\Form\FormStateInterface $form_state * The form state. */ - public static function validateElement(array $element, FormStateInterface &$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 f3fb8ab..093e06c 100644 --- a/core/modules/options/src/Plugin/Field/FieldWidget/SelectWidget.php +++ b/core/modules/options/src/Plugin/Field/FieldWidget/SelectWidget.php @@ -30,7 +30,7 @@ class SelectWidget extends OptionsWidgetBase { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$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 573bcd0..ece964c 100644 --- a/core/modules/path/src/Form/DeleteForm.php +++ b/core/modules/path/src/Form/DeleteForm.php @@ -73,7 +73,7 @@ public function getCancelRoute() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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); @@ -86,7 +86,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $pid = N /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 e78aa40..b5fd90e 100644 --- a/core/modules/path/src/Form/EditForm.php +++ b/core/modules/path/src/Form/EditForm.php @@ -33,7 +33,7 @@ protected function buildPath($pid) { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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']); @@ -52,7 +52,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $pid = N /** * Submits the delete form. */ - public function deleteSubmit(array &$form, FormStateInterface &$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 1458fd1..e8130f0 100644 --- a/core/modules/path/src/Form/PathFilterForm.php +++ b/core/modules/path/src/Form/PathFilterForm.php @@ -26,7 +26,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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', @@ -60,7 +60,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $keys = /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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']), )); @@ -69,7 +69,7 @@ public function submitForm(array &$form, FormStateInterface &$form_state) { /** * Resets the filter selections. */ - public function resetForm(array &$form, FormStateInterface &$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 724872c..f4d7ffd 100644 --- a/core/modules/path/src/Form/PathFormBase.php +++ b/core/modules/path/src/Form/PathFormBase.php @@ -75,7 +75,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state, $pid = NULL) { + public function buildForm(array $form, FormStateInterface $form_state, $pid = NULL) { $this->path = $this->buildPath($pid); $form['source'] = array( '#type' => 'textfield', @@ -136,7 +136,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $pid = N /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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']; @@ -155,7 +155,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 0b3380d..dc4d256 100644 --- a/core/modules/path/src/Plugin/Field/FieldWidget/PathWidget.php +++ b/core/modules/path/src/Plugin/Field/FieldWidget/PathWidget.php @@ -29,7 +29,7 @@ class PathWidget extends WidgetBase { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface &$form_state) { + public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { $entity = $items->getEntity(); $path = array(); if (!$entity->isNew()) { @@ -83,7 +83,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen * @param \Drupal\Core\Form\FormStateInterface $form_state * The form state. */ - public static function validateFormElement(array &$element, FormStateInterface &$form_state) { + public static function validateFormElement(array &$element, FormStateInterface $form_state) { // Trim the submitted value. $alias = trim($element['alias']['#value']); if (!empty($alias)) { @@ -101,7 +101,7 @@ public static function validateFormElement(array &$element, FormStateInterface & /** * {@inheritdoc} */ - public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface &$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 256feb6..6ce51d8 100644 --- a/core/modules/quickedit/src/Form/QuickEditFieldForm.php +++ b/core/modules/quickedit/src/Form/QuickEditFieldForm.php @@ -84,7 +84,7 @@ public function getFormId() { * * Builds a form for a single entity field. */ - public function buildForm(array $form, FormStateInterface &$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); } @@ -117,7 +117,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, EntityIn /** * Initialize the form state and the entity before the first form build. */ - protected function init(FormStateInterface &$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') { @@ -144,7 +144,7 @@ protected function init(FormStateInterface &$form_state, EntityInterface $entity /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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); @@ -165,7 +165,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { * * Saves the entity with updated values for the edited field. */ - public function submitForm(array &$form, FormStateInterface &$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. @@ -178,7 +178,7 @@ public function submitForm(array &$form, FormStateInterface &$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, FormStateInterface &$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']; @@ -207,7 +207,7 @@ protected function buildEntity(array $form, FormStateInterface &$form_state) { * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - protected function simplify(array &$form, FormStateInterface &$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/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php b/core/modules/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php index 14d8bab..b3df9d4 100644 --- a/core/modules/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php +++ b/core/modules/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php @@ -37,7 +37,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 51f2ada..24a80d4 100644 --- a/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php +++ b/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php @@ -39,7 +39,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public function settingsForm(array $form, FormStateInterface &$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 94f37f0..7a38d12 100644 --- a/core/modules/responsive_image/src/ResponsiveImageMappingForm.php +++ b/core/modules/responsive_image/src/ResponsiveImageMappingForm.php @@ -29,7 +29,7 @@ class ResponsiveImageMappingForm extends EntityForm { * @return array * The array containing the complete form. */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { if ($this->operation == 'duplicate') { $form['#title'] = $this->t('Duplicate responsive image mapping @label', array('@label' => $this->entity->label())); $this->entity = $this->entity->createDuplicate(); @@ -97,7 +97,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$form_state) { + public function validate(array $form, FormStateInterface $form_state) { /** @var \Drupal\responsive_image\ResponsiveImageMappingInterface $responsive_image_mapping */ $responsive_image_mapping = $this->entity; @@ -120,7 +120,7 @@ public function validate(array $form, FormStateInterface &$form_state) { /** * Overrides Drupal\Core\Entity\EntityForm::save(). */ - public function save(array $form, FormStateInterface &$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 e2f7753..68668ba 100644 --- a/core/modules/rest/src/Plugin/views/row/DataFieldRow.php +++ b/core/modules/rest/src/Plugin/views/row/DataFieldRow.php @@ -75,7 +75,7 @@ protected function defineOptions() { /** * Overrides \Drupal\views\Plugin\views\row\RowPluginBase::buildOptionsForm(). */ - public function buildOptionsForm(&$form, FormStateInterface &$form_state) { + public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $form['field_options'] = array( @@ -112,7 +112,7 @@ public function buildOptionsForm(&$form, FormStateInterface &$form_state) { /** * Form element validation handler for \Drupal\rest\Plugin\views\row\DataFieldRow::buildOptionsForm(). */ - public function validateAliasName($element, FormStateInterface &$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.')); } @@ -121,7 +121,7 @@ public function validateAliasName($element, FormStateInterface &$form_state) { /** * Overrides \Drupal\views\Plugin\views\row\RowPluginBase::validateOptionsForm(). */ - public function validateOptionsForm(&$form, FormStateInterface &$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 1d85a24..6652963 100644 --- a/core/modules/rest/src/Plugin/views/style/Serializer.php +++ b/core/modules/rest/src/Plugin/views/style/Serializer.php @@ -89,7 +89,7 @@ protected function defineOptions() { /** * {@inheritdoc} */ - public function buildOptionsForm(&$form, FormStateInterface &$form_state) { + public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $form['formats'] = array( @@ -104,7 +104,7 @@ public function buildOptionsForm(&$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitOptionsForm(&$form, FormStateInterface &$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 1296cf4..be8da8a 100644 --- a/core/modules/search/search.module +++ b/core/modules/search/search.module @@ -832,7 +832,7 @@ function search_module_preinstall() { * * @see \Drupal\search\Form\SearchBlockForm */ -function search_form_search_block_form_alter(&$form, FormStateInterface &$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 544085a..3a721ab 100644 --- a/core/modules/search/src/Form/ReindexConfirm.php +++ b/core/modules/search/src/Form/ReindexConfirm.php @@ -61,7 +61,7 @@ public function getCancelRoute() { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 1fc8dd5..e154863 100644 --- a/core/modules/search/src/Form/SearchBlockForm.php +++ b/core/modules/search/src/Form/SearchBlockForm.php @@ -53,7 +53,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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) { @@ -91,7 +91,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 ee24bf1..0550f74 100644 --- a/core/modules/search/src/Form/SearchPageAddForm.php +++ b/core/modules/search/src/Form/SearchPageAddForm.php @@ -17,7 +17,7 @@ class SearchPageAddForm extends SearchPageFormBase { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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']); @@ -27,7 +27,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $search_ /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$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; @@ -36,7 +36,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 40d48b1..f75bdcb 100644 --- a/core/modules/search/src/Form/SearchPageDeleteForm.php +++ b/core/modules/search/src/Form/SearchPageDeleteForm.php @@ -40,7 +40,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 501fb67..7ff9260 100644 --- a/core/modules/search/src/Form/SearchPageEditForm.php +++ b/core/modules/search/src/Form/SearchPageEditForm.php @@ -17,7 +17,7 @@ class SearchPageEditForm extends SearchPageFormBase { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$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; @@ -26,7 +26,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 6538d57..8e585db 100644 --- a/core/modules/search/src/Form/SearchPageForm.php +++ b/core/modules/search/src/Form/SearchPageForm.php @@ -38,7 +38,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $plugin = $this->entity->getPlugin(); $form_state['search_page_id'] = $this->entity->id(); @@ -75,7 +75,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$form_state) { + protected function actions(array $form, FormStateInterface $form_state) { // The submit button is added in the form directly. return array(); } @@ -83,7 +83,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 5c80387..97cd2fc 100644 --- a/core/modules/search/src/Form/SearchPageFormBase.php +++ b/core/modules/search/src/Form/SearchPageFormBase.php @@ -80,7 +80,7 @@ public function getBaseFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $this->plugin = $this->entity->getPlugin(); return parent::buildForm($form, $form_state); } @@ -88,7 +88,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form['label'] = array( '#type' => 'textfield', '#title' => $this->t('Label'), @@ -144,7 +144,7 @@ public function exists($id) { /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$form_state) { + public function validate(array $form, FormStateInterface $form_state) { parent::validate($form, $form_state); // Ensure each path is unique. @@ -164,7 +164,7 @@ public function validate(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$form_state) { + public function submit(array $form, FormStateInterface $form_state) { parent::submit($form, $form_state); if ($this->plugin instanceof PluginFormInterface) { @@ -176,7 +176,7 @@ public function submit(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 cde0e28..d5de0c4 100644 --- a/core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php +++ b/core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php @@ -55,7 +55,7 @@ public function setConfiguration(array $configuration) { /** * {@inheritdoc} */ - public function validateConfigurationForm(array &$form, FormStateInterface &$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 23c94b1..34c9d4f 100644 --- a/core/modules/search/src/Plugin/SearchInterface.php +++ b/core/modules/search/src/Plugin/SearchInterface.php @@ -99,7 +99,7 @@ public function buildResults(); * * @see SearchInterface::buildSearchUrlQuery() */ - public function searchFormAlter(array &$form, FormStateInterface &$form_state); + public function searchFormAlter(array &$form, FormStateInterface $form_state); /** * Builds the URL GET query parameters array for search. diff --git a/core/modules/search/src/Plugin/SearchPluginBase.php b/core/modules/search/src/Plugin/SearchPluginBase.php index 1e2f2b5..9a553cc 100644 --- a/core/modules/search/src/Plugin/SearchPluginBase.php +++ b/core/modules/search/src/Plugin/SearchPluginBase.php @@ -105,7 +105,7 @@ public function buildResults() { /** * {@inheritdoc} */ - public function searchFormAlter(array &$form, FormStateInterface &$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 90f59cd..e885ce9 100644 --- a/core/modules/search/src/Plugin/views/filter/Search.php +++ b/core/modules/search/src/Plugin/views/filter/Search.php @@ -71,7 +71,7 @@ protected function defineOptions() { /** * {@inheritdoc} */ - protected function operatorForm(&$form, FormStateInterface &$form_state) { + protected function operatorForm(&$form, FormStateInterface $form_state) { $form['operator'] = array( '#type' => 'radios', '#title' => t('On empty input'), @@ -86,7 +86,7 @@ protected function operatorForm(&$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - protected function valueForm(&$form, FormStateInterface &$form_state) { + protected function valueForm(&$form, FormStateInterface $form_state) { $form['value'] = array( '#type' => 'textfield', '#size' => 15, @@ -99,7 +99,7 @@ protected function valueForm(&$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateExposed(&$form, FormStateInterface &$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 580e917..c93efda 100644 --- a/core/modules/search/src/Plugin/views/row/SearchRow.php +++ b/core/modules/search/src/Plugin/views/row/SearchRow.php @@ -35,7 +35,7 @@ protected function defineOptions() { /** * {@inheritdoc} */ - public function buildOptionsForm(&$form, FormStateInterface &$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 af36885..da90646 100644 --- a/core/modules/search/src/SearchPageListBuilder.php +++ b/core/modules/search/src/SearchPageListBuilder.php @@ -153,7 +153,7 @@ public function buildRow(EntityInterface $entity) { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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'); @@ -301,13 +301,13 @@ public function getDefaultOperations(EntityInterface $entity) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$form_state) { + public function validateForm(array &$form, FormStateInterface $form_state) { } /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$form_state) { + public function submitForm(array &$form, FormStateInterface $form_state) { parent::submitForm($form, $form_state); $search_settings = $this->configFactory->get('search.settings'); @@ -330,7 +330,7 @@ public function submitForm(array &$form, FormStateInterface &$form_state) { * Form submission handler for the reindex button on the search admin settings * form. */ - public function searchAdminReindexSubmit(array &$form, FormStateInterface &$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'; } @@ -338,7 +338,7 @@ public function searchAdminReindexSubmit(array &$form, FormStateInterface &$form /** * Form validation handler for adding a new search page. */ - public function validateAddSearchPage(array &$form, FormStateInterface &$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.')); } @@ -347,7 +347,7 @@ public function validateAddSearchPage(array &$form, FormStateInterface &$form_st /** * Form submission handler for adding a new search page. */ - public function submitAddSearchPage(array &$form, FormStateInterface &$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 f329fc6..3bb04e0 100644 --- a/core/modules/search/tests/modules/search_embedded_form/src/Form/SearchEmbeddedForm.php +++ b/core/modules/search/tests/modules/search_embedded_form/src/Form/SearchEmbeddedForm.php @@ -25,7 +25,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $count = \Drupal::state()->get('search_embedded_form.submit_count'); $form['name'] = array( @@ -49,7 +49,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 9277e60..2c34010 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 @@ -90,7 +90,7 @@ public function buildResults() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { // Output form for defining rank factor weights. $form['extra_type_settings'] = array( '#type' => 'fieldset', @@ -113,7 +113,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 9d0fd62..d6afd90 100644 --- a/core/modules/shortcut/src/Form/SetCustomize.php +++ b/core/modules/shortcut/src/Form/SetCustomize.php @@ -28,7 +28,7 @@ class SetCustomize extends EntityForm { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form = parent::form($form, $form_state); $form['shortcuts'] = array( '#tree' => TRUE, @@ -83,7 +83,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$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( @@ -100,7 +100,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 283a768..96701ef 100644 --- a/core/modules/shortcut/src/Form/ShortcutDeleteForm.php +++ b/core/modules/shortcut/src/Form/ShortcutDeleteForm.php @@ -49,7 +49,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 bbd1aa4..3506eac 100644 --- a/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php +++ b/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php @@ -75,7 +75,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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); @@ -102,7 +102,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 78edeed..a66a890 100644 --- a/core/modules/shortcut/src/Form/SwitchShortcutSet.php +++ b/core/modules/shortcut/src/Form/SwitchShortcutSet.php @@ -76,7 +76,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state, UserInterface $user = NULL) { + public function buildForm(array $form, FormStateInterface $form_state, UserInterface $user = NULL) { $account = $this->currentUser(); $this->user = $user; @@ -170,7 +170,7 @@ public function exists($id) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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']) == '') { @@ -186,7 +186,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 0b5418a..e36fd79 100644 --- a/core/modules/shortcut/src/ShortcutForm.php +++ b/core/modules/shortcut/src/ShortcutForm.php @@ -26,7 +26,7 @@ class ShortcutForm extends ContentEntityForm { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form = parent::form($form, $form_state); $form['path'] = array( @@ -51,7 +51,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function buildEntity(array $form, FormStateInterface &$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 @@ -64,7 +64,7 @@ public function buildEntity(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$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.')); } @@ -75,7 +75,7 @@ public function validate(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 799b64b..be48569 100644 --- a/core/modules/shortcut/src/ShortcutSetForm.php +++ b/core/modules/shortcut/src/ShortcutSetForm.php @@ -18,7 +18,7 @@ class ShortcutSetForm extends EntityForm { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form = parent::form($form, $form_state); $entity = $this->entity; @@ -51,7 +51,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$form_state) { + public function validate(array $form, FormStateInterface $form_state) { parent::validate($form, $form_state); $entity = $this->entity; // Check to prevent a duplicate title. @@ -63,7 +63,7 @@ public function validate(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 7449344..f9e48d3 100644 --- a/core/modules/simpletest/src/Form/SimpletestResultsForm.php +++ b/core/modules/simpletest/src/Form/SimpletestResultsForm.php @@ -105,7 +105,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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. @@ -251,7 +251,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $test_id /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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(); diff --git a/core/modules/simpletest/src/Form/SimpletestSettingsForm.php b/core/modules/simpletest/src/Form/SimpletestSettingsForm.php index 2c41280..2b1e71d 100644 --- a/core/modules/simpletest/src/Form/SimpletestSettingsForm.php +++ b/core/modules/simpletest/src/Form/SimpletestSettingsForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('simpletest.settings'); $form['general'] = array( '#type' => 'details', @@ -87,7 +87,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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. @@ -107,7 +107,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 c69e95f..bb56b69 100644 --- a/core/modules/simpletest/src/Form/SimpletestTestForm.php +++ b/core/modules/simpletest/src/Form/SimpletestTestForm.php @@ -27,7 +27,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form['actions'] = array('#type' => 'actions'); $form['actions']['submit'] = array( '#type' => 'submit', @@ -184,7 +184,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 02a4f47..62745b7 100644 --- a/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php +++ b/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php @@ -78,7 +78,7 @@ protected function blockAccess(AccountInterface $account) { /** * {@inheritdoc} */ - public function blockForm($form, FormStateInterface &$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); @@ -109,7 +109,7 @@ public function blockForm($form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function blockSubmit($form, FormStateInterface &$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 4c5e013..cac15a1 100644 --- a/core/modules/statistics/src/StatisticsSettingsForm.php +++ b/core/modules/statistics/src/StatisticsSettingsForm.php @@ -58,7 +58,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('statistics.settings'); // Content counter settings. @@ -80,7 +80,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 e5e9c95..baee84f 100644 --- a/core/modules/syslog/syslog.module +++ b/core/modules/syslog/syslog.module @@ -31,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, FormStateInterface &$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( @@ -64,7 +64,7 @@ function syslog_form_system_logging_settings_alter(&$form, FormStateInterface &$ * * @see syslog_form_system_logging_settings_alter() */ -function syslog_logging_settings_submit($form, FormStateInterface &$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 6a7918a..3a55e7f 100644 --- a/core/modules/system/entity.api.php +++ b/core/modules/system/entity.api.php @@ -1286,7 +1286,7 @@ function hook_entity_display_build_alter(&$build, $context) { * * @ingroup entity_crud */ -function hook_entity_prepare_form(\Drupal\Core\Entity\EntityInterface $entity, $operation, \Drupal\Core\Form\FormStateInterface &$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; @@ -1312,7 +1312,7 @@ function hook_entity_prepare_form(\Drupal\Core\Entity\EntityInterface $entity, $ * * @ingroup entity_crud */ -function hook_ENTITY_TYPE_prepare_form(\Drupal\Core\Entity\EntityInterface $entity, $operation, \Drupal\Core\Form\FormStateInterface &$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/Form/CronForm.php b/core/modules/system/src/Form/CronForm.php index d8caa76..d2253ae 100644 --- a/core/modules/system/src/Form/CronForm.php +++ b/core/modules/system/src/Form/CronForm.php @@ -71,7 +71,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('system.cron'); $form['description'] = array( @@ -112,7 +112,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$form_state) { + public function submitForm(array &$form, FormStateInterface $form_state) { $this->config('system.cron') ->set('threshold.autorun', $form_state['values']['cron_safe_threshold']) ->save(); @@ -123,7 +123,7 @@ public function submitForm(array &$form, FormStateInterface &$form_state) { /** * Runs cron and reloads the page. */ - public function submitCron(array &$form, FormStateInterface &$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 00bddc2..22333e7 100644 --- a/core/modules/system/src/Form/DateFormatAddForm.php +++ b/core/modules/system/src/Form/DateFormatAddForm.php @@ -17,7 +17,7 @@ class DateFormatAddForm extends DateFormatFormBase { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$form_state) { + protected function actions(array $form, FormStateInterface $form_state) { $actions = parent::actions($form, $form_state); $actions['submit']['#value'] = t('Add format'); return $actions; @@ -26,7 +26,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 555b9a4..f88731f 100644 --- a/core/modules/system/src/Form/DateFormatDeleteForm.php +++ b/core/modules/system/src/Form/DateFormatDeleteForm.php @@ -71,7 +71,7 @@ public function getCancelRoute() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 14fb18b..9261894 100644 --- a/core/modules/system/src/Form/DateFormatEditForm.php +++ b/core/modules/system/src/Form/DateFormatEditForm.php @@ -17,7 +17,7 @@ class DateFormatEditForm extends DateFormatFormBase { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$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()))); @@ -30,7 +30,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$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']); @@ -40,7 +40,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 9b07c2f..ac73cd7 100644 --- a/core/modules/system/src/Form/DateFormatFormBase.php +++ b/core/modules/system/src/Form/DateFormatFormBase.php @@ -106,7 +106,7 @@ public static function dateTimeLookup(array $form, FormStateInterface $form_stat /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form['label'] = array( '#type' => 'textfield', '#title' => 'Name', @@ -155,7 +155,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validate(array $form, FormStateInterface &$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 @@ -173,7 +173,7 @@ public function validate(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 15a9724..135f869 100644 --- a/core/modules/system/src/Form/FileSystemForm.php +++ b/core/modules/system/src/Form/FileSystemForm.php @@ -27,7 +27,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('system.file'); $form['file_public_path'] = array( '#type' => 'item', @@ -87,7 +87,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 5443789..15378db 100644 --- a/core/modules/system/src/Form/ImageToolkitForm.php +++ b/core/modules/system/src/Form/ImageToolkitForm.php @@ -61,7 +61,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $current_toolkit = $this->config('system.image')->get('toolkit'); $form['image_toolkit'] = array( @@ -96,7 +96,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 6d4626f..ddb7e3c 100644 --- a/core/modules/system/src/Form/LoggingForm.php +++ b/core/modules/system/src/Form/LoggingForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('system.logging'); $form['error_level'] = array( '#type' => 'radios', @@ -46,7 +46,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 e70ad2b..d8f3e10 100644 --- a/core/modules/system/src/Form/ModulesListConfirmForm.php +++ b/core/modules/system/src/Form/ModulesListConfirmForm.php @@ -102,7 +102,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $account = $this->currentUser()->id(); $this->modules = $this->keyValueExpirable->get($account); @@ -132,7 +132,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 1ad737c..021b064 100644 --- a/core/modules/system/src/Form/ModulesListForm.php +++ b/core/modules/system/src/Form/ModulesListForm.php @@ -128,7 +128,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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()); @@ -437,7 +437,7 @@ protected function buildModuleList($form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 f39fdb8..61d4186 100644 --- a/core/modules/system/src/Form/ModulesUninstallConfirmForm.php +++ b/core/modules/system/src/Form/ModulesUninstallConfirmForm.php @@ -126,7 +126,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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); @@ -192,7 +192,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 8535cf7..b1ec48c 100644 --- a/core/modules/system/src/Form/ModulesUninstallForm.php +++ b/core/modules/system/src/Form/ModulesUninstallForm.php @@ -65,7 +65,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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'; @@ -149,7 +149,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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'); @@ -160,7 +160,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 7c00387..9927c6f 100644 --- a/core/modules/system/src/Form/PerformanceForm.php +++ b/core/modules/system/src/Form/PerformanceForm.php @@ -58,7 +58,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form['#attached']['library'][] = 'system/drupal.system'; $config = $this->config('system.performance'); @@ -144,7 +144,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 @@ -166,7 +166,7 @@ public function submitForm(array &$form, FormStateInterface &$form_state) { /** * Clears the caches. */ - public function submitCacheClear(array &$form, FormStateInterface &$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 b6ccd5e..7ac2159 100644 --- a/core/modules/system/src/Form/RegionalForm.php +++ b/core/modules/system/src/Form/RegionalForm.php @@ -58,7 +58,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $countries = $this->countryManager->getList(); $system_date = $this->config('system.date'); @@ -142,7 +142,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 db41924..5ba8e6d 100644 --- a/core/modules/system/src/Form/RssFeedsForm.php +++ b/core/modules/system/src/Form/RssFeedsForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $rss_config = $this->config('system.rss'); $form['feed_description'] = array( '#type' => 'textarea', @@ -59,7 +59,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 49a722f..46b9013 100644 --- a/core/modules/system/src/Form/SiteInformationForm.php +++ b/core/modules/system/src/Form/SiteInformationForm.php @@ -59,7 +59,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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)) { @@ -132,7 +132,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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". @@ -168,7 +168,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 c6b636f..1ee0aa6 100644 --- a/core/modules/system/src/Form/SiteMaintenanceModeForm.php +++ b/core/modules/system/src/Form/SiteMaintenanceModeForm.php @@ -57,7 +57,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('system.maintenance'); $form['maintenance_mode'] = array( '#type' => 'checkbox', @@ -77,7 +77,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 00f7aa4..627c2b3 100644 --- a/core/modules/system/src/Form/ThemeAdminForm.php +++ b/core/modules/system/src/Form/ThemeAdminForm.php @@ -24,7 +24,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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', @@ -49,7 +49,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, array $t /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 b1df67d..9d398d9 100644 --- a/core/modules/system/src/Form/ThemeSettingsForm.php +++ b/core/modules/system/src/Form/ThemeSettingsForm.php @@ -66,7 +66,7 @@ public function getFormId() { * @param string $theme * The theme name. */ - public function buildForm(array $form, FormStateInterface &$form_state, $theme = '') { + public function buildForm(array $form, FormStateInterface $form_state, $theme = '') { $form = parent::buildForm($form, $form_state); $themes = list_themes(); @@ -317,7 +317,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, $theme = /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$form_state) { + public function validateForm(array &$form, FormStateInterface $form_state) { parent::validateForm($form, $form_state); if ($this->moduleHandler->moduleExists('file')) { @@ -374,7 +374,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 e049108..0cecf2b 100644 --- a/core/modules/system/src/Plugin/Block/SystemBrandingBlock.php +++ b/core/modules/system/src/Plugin/Block/SystemBrandingBlock.php @@ -106,7 +106,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function blockForm($form, FormStateInterface &$form_state) { + public function blockForm($form, FormStateInterface $form_state) { // Get the theme. $theme = $form_state['block_theme']; @@ -174,7 +174,7 @@ public function blockForm($form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function blockSubmit($form, FormStateInterface &$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 00a7d5e..e251cad 100644 --- a/core/modules/system/src/Plugin/Block/SystemMainBlock.php +++ b/core/modules/system/src/Plugin/Block/SystemMainBlock.php @@ -32,7 +32,7 @@ public function build() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$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 d6e6a28..980d5b3 100644 --- a/core/modules/system/src/Plugin/Block/SystemPoweredByBlock.php +++ b/core/modules/system/src/Plugin/Block/SystemPoweredByBlock.php @@ -31,7 +31,7 @@ public function build() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$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 86e0731..1ccd1f9 100644 --- a/core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php +++ b/core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php @@ -93,7 +93,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form['theme'] = array( '#type' => 'select', '#title' => $this->t('Theme'), @@ -108,7 +108,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 4b527e2..c6314d5 100644 --- a/core/modules/system/src/Plugin/Condition/RequestPath.php +++ b/core/modules/system/src/Plugin/Condition/RequestPath.php @@ -94,7 +94,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form['pages'] = array( '#type' => 'textarea', '#title' => $this->t('Pages'), @@ -111,7 +111,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 6cded03..3cbdbd9 100644 --- a/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php +++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php @@ -77,7 +77,7 @@ public function settingsForm() { /** * {@inheritdoc} */ - public function settingsFormSubmit($form, FormStateInterface &$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 42511a1..9cf6836 100644 --- a/core/modules/system/src/Plugin/views/field/BulkForm.php +++ b/core/modules/system/src/Plugin/views/field/BulkForm.php @@ -93,7 +93,7 @@ protected function defineOptions() { /** * {@inheritdoc} */ - public function buildOptionsForm(&$form, FormStateInterface &$form_state) { + public function buildOptionsForm(&$form, FormStateInterface $form_state) { $form['action_title'] = array( '#type' => 'textfield', '#title' => t('Action title'), @@ -123,7 +123,7 @@ public function buildOptionsForm(&$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateOptionsForm(&$form, FormStateInterface &$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']); @@ -161,7 +161,7 @@ public function preRender(&$values) { * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - public function viewsForm(&$form, FormStateInterface &$form_state) { + public function viewsForm(&$form, FormStateInterface $form_state) { // Add the tableselect javascript. $form['#attached']['library'][] = 'core/drupal.tableselect'; @@ -249,7 +249,7 @@ protected function getBulkOptions($filtered = TRUE) { * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - public function viewsFormSubmit(&$form, FormStateInterface &$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']]); @@ -290,7 +290,7 @@ protected function emptySelectedMessage() { /** * {@inheritdoc} */ - public function viewsFormValidate(&$form, FormStateInterface &$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/FormDefaultHandlersTest.php b/core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php index 2e5f4e0..7fa6a7c 100644 --- a/core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php +++ b/core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php @@ -36,7 +36,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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'); @@ -46,28 +46,28 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function customValidateForm(array &$form, FormStateInterface &$form_state) { + public function customValidateForm(array &$form, FormStateInterface $form_state) { $form_state['test_handlers']['validate'][] = __FUNCTION__; } /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$form_state) { + public function validateForm(array &$form, FormStateInterface $form_state) { $form_state['test_handlers']['validate'][] = __FUNCTION__; } /** * {@inheritdoc} */ - public function customSubmitForm(array &$form, FormStateInterface &$form_state) { + public function customSubmitForm(array &$form, FormStateInterface $form_state) { $form_state['test_handlers']['submit'][] = __FUNCTION__; } /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$form_state) { + public function submitForm(array &$form, FormStateInterface $form_state) { $form_state['test_handlers']['submit'][] = __FUNCTION__; } diff --git a/core/modules/system/src/Tests/Form/StubForm.php b/core/modules/system/src/Tests/Form/StubForm.php index cac6579..c3898df 100644 --- a/core/modules/system/src/Tests/Form/StubForm.php +++ b/core/modules/system/src/Tests/Form/StubForm.php @@ -52,14 +52,14 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { return $this->form; } /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 f985a19..2d040de 100644 --- a/core/modules/system/src/Tests/Form/TriggeringElementProgrammedUnitTest.php +++ b/core/modules/system/src/Tests/Form/TriggeringElementProgrammedUnitTest.php @@ -32,7 +32,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form['one'] = array( '#type' => 'textfield', '#title' => 'One', @@ -59,7 +59,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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']); } @@ -67,7 +67,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$form_state) { + public function submitForm(array &$form, FormStateInterface $form_state) { } /** diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index 67fb668..0b3c6c7 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, \Drupal\Core\Form\FormStateInterface &$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, \Drupal\Core\Form\FormStateInterface &$form_sta * @see \Drupal\Core\Form\FormBuilderInterface::prepareForm() * @see forms_api_reference.html */ -function hook_form_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface &$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, \Drupal\Core\Form\FormStateInterface &$ * @see hook_form_FORM_ID_alter() * @see \Drupal\Core\Form\FormBuilderInterface::prepareForm() */ -function hook_form_BASE_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface &$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 c95f0d6..3ddfe93 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -991,7 +991,7 @@ function system_page_build(&$page) { /** * Implements hook_form_FORM_ID_alter(). */ -function system_form_user_form_alter(&$form, FormStateInterface &$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); } @@ -1000,7 +1000,7 @@ function system_form_user_form_alter(&$form, FormStateInterface &$form_state) { /** * Implements hook_form_FORM_ID_alter(). */ -function system_form_user_register_form_alter(&$form, FormStateInterface &$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); @@ -1031,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, FormStateInterface &$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 2f45911..8f8719a 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 @@ -207,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, FormStateInterface &$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 c67f97b..46525e7 100644 --- a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php +++ b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc}. */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form = array(); // Shows the 'after' command with a callback generating commands. @@ -217,7 +217,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc}. */ - public function submitForm(array &$form, FormStateInterface &$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 59e3291..762c306 100644 --- a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestLazyLoadForm.php +++ b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestLazyLoadForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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 @@ -55,7 +55,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 7df4e55..225664d 100644 --- a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php +++ b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php @@ -26,7 +26,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $object = new Callbacks(); $form = array(); @@ -78,7 +78,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 caa450b..bf7064e 100644 --- a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestValidationForm.php +++ b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestValidationForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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."), @@ -69,7 +69,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 496c44d..5f11817 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 @@ -30,7 +30,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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. @@ -60,14 +60,14 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$form_state) { + public function validateForm(array &$form, FormStateInterface $form_state) { } /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$form_state) { + public function submitForm(array &$form, FormStateInterface $form_state) { $form_state['redirect'] = 'ajax-test/dialog-contents'; } @@ -75,14 +75,14 @@ public function submitForm(array &$form, FormStateInterface &$form_state) { /** * AJAX callback handler for AjaxTestDialogForm. */ - public function modal(&$form, FormStateInterface &$form_state) { + public function modal(&$form, FormStateInterface $form_state) { return $this->dialog(TRUE); } /** * AJAX callback handler for AjaxTestDialogForm. */ - public function nonModal(&$form, FormStateInterface &$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 1065f34..4237316 100644 --- a/core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestForm.php +++ b/core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form['#action'] = url('ajax-test/dialog'); @@ -44,11 +44,11 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$form_state) {} + public function submitForm(array &$form, FormStateInterface $form_state) {} /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$form_state) {} + public function validateForm(array &$form, FormStateInterface $form_state) {} } 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 b4b5240..ae6430e 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 @@ -26,7 +26,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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( @@ -50,13 +50,13 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$form_state) { + public function submitForm(array &$form, FormStateInterface $form_state) { } /** * Form submission handler #1 for batch_test_chained_form */ - public static function batchTestChainedFormSubmit1($form, FormStateInterface &$form_state) { + public static function batchTestChainedFormSubmit1($form, FormStateInterface $form_state) { batch_test_stack(NULL, TRUE); batch_test_stack('submit handler 1'); @@ -71,7 +71,7 @@ public static function batchTestChainedFormSubmit1($form, FormStateInterface &$f /** * Form submission handler #2 for batch_test_chained_form */ - public static function batchTestChainedFormSubmit2($form, FormStateInterface &$form_state) { + public static function batchTestChainedFormSubmit2($form, FormStateInterface $form_state) { batch_test_stack('submit handler 2'); batch_test_stack('value = ' . $form_state['values']['value']); @@ -84,7 +84,7 @@ public static function batchTestChainedFormSubmit2($form, FormStateInterface &$f /** * Form submission handler #3 for batch_test_chained_form */ - public static function batchTestChainedFormSubmit3($form, FormStateInterface &$form_state) { + public static function batchTestChainedFormSubmit3($form, FormStateInterface $form_state) { batch_test_stack('submit handler 3'); batch_test_stack('value = ' . $form_state['values']['value']); @@ -96,7 +96,7 @@ public static function batchTestChainedFormSubmit3($form, FormStateInterface &$f /** * Form submission handler #4 for batch_test_chained_form */ - public static function batchTestChainedFormSubmit4($form, FormStateInterface &$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 c68b7ea..f72fc29 100644 --- a/core/modules/system/tests/modules/batch_test/src/Form/BatchTestMockForm.php +++ b/core/modules/system/tests/modules/batch_test/src/Form/BatchTestMockForm.php @@ -25,7 +25,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form['test_value'] = array( '#title' => t('Test value'), '#type' => 'textfield', @@ -41,7 +41,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 10cfb2b..3743cac 100644 --- a/core/modules/system/tests/modules/batch_test/src/Form/BatchTestMultiStepForm.php +++ b/core/modules/system/tests/modules/batch_test/src/Form/BatchTestMultiStepForm.php @@ -26,7 +26,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { if (empty($form_state['storage']['step'])) { $form_state['storage']['step'] = 1; } @@ -45,7 +45,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 31effbb..6bfa1c9 100644 --- a/core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php +++ b/core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php @@ -26,7 +26,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form['batch'] = array( '#type' => 'select', '#title' => 'Choose batch', @@ -49,7 +49,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 5c54903..1f13755 100644 --- a/core/modules/system/tests/modules/condition_test/src/FormController.php +++ b/core/modules/system/tests/modules/condition_test/src/FormController.php @@ -41,7 +41,7 @@ public function __construct() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form = $this->condition->buildConfigurationForm($form, $form_state); $form['actions']['submit'] = array( '#type' => 'submit', @@ -54,14 +54,14 @@ public function buildForm(array $form, FormStateInterface &$form_state) { * Implements \Drupal\Core\Form\FormInterface::validateForm(). * */ - public function validateForm(array &$form, FormStateInterface &$form_state) { + public function validateForm(array &$form, FormStateInterface $form_state) { $this->condition->validateConfigurationForm($form, $form_state); } /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 4eb4bb5..712ac97 100644 --- a/core/modules/system/tests/modules/database_test/src/Form/DatabaseTestForm.php +++ b/core/modules/system/tests/modules/database_test/src/Form/DatabaseTestForm.php @@ -26,7 +26,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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'), @@ -73,7 +73,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 6881baa..6b293d1 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.module +++ b/core/modules/system/tests/modules/entity_test/entity_test.module @@ -243,7 +243,7 @@ function entity_test_permission() { /** * Implements hook_form_BASE_FORM_ID_alter(). */ -function entity_test_form_node_form_alter(&$form, FormStateInterface &$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 dfdbf48..d097294 100644 --- a/core/modules/system/tests/modules/entity_test/src/EntityTestDeleteForm.php +++ b/core/modules/system/tests/modules/entity_test/src/EntityTestDeleteForm.php @@ -34,7 +34,7 @@ public function getQuestion() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 617db12..ed56b50 100644 --- a/core/modules/system/tests/modules/entity_test/src/EntityTestForm.php +++ b/core/modules/system/tests/modules/entity_test/src/EntityTestForm.php @@ -18,7 +18,7 @@ class EntityTestForm extends ContentEntityForm { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $form = parent::form($form, $form_state); $entity = $this->entity; @@ -64,7 +64,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$form_state) { + public function submit(array $form, FormStateInterface $form_state) { // Build the entity object from the submitted values. $entity = parent::submit($form, $form_state); @@ -79,7 +79,7 @@ public function submit(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 70e573a..ad38397 100644 --- a/core/modules/system/tests/modules/form_test/form_test.module +++ b/core/modules/system/tests/modules/form_test/form_test.module @@ -25,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, FormStateInterface &$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, FormStateInterface &$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.'); } @@ -41,14 +41,14 @@ function form_test_form_alter(&$form, FormStateInterface &$form_state, $form_id) /** * Implements hook_form_FORM_ID_alter(). */ -function form_test_form_form_test_alter_form_alter(&$form, FormStateInterface &$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, FormStateInterface &$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.'); } @@ -95,7 +95,7 @@ function _form_test_tableselect_get_data() { * * @see form_test_state_persist() */ -function form_test_form_form_test_state_persist_alter(&$form, FormStateInterface &$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')) { @@ -106,7 +106,7 @@ function form_test_form_form_test_state_persist_alter(&$form, FormStateInterface /** * Implements hook_form_FORM_ID_alter() for the registration form. */ -function form_test_form_user_register_form_alter(&$form, FormStateInterface &$form_state) { +function form_test_form_user_register_form_alter(&$form, FormStateInterface $form_state) { $form['test_rebuild'] = array( '#type' => 'submit', '#value' => t('Rebuild'), @@ -117,7 +117,7 @@ function form_test_form_user_register_form_alter(&$form, FormStateInterface &$fo /** * Submit callback that just lets the form rebuild. */ -function form_test_user_register_form_rebuild($form, FormStateInterface &$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 d621c7e..73fd437 100644 --- a/core/modules/system/tests/modules/form_test/src/Callbacks.php +++ b/core/modules/system/tests/modules/form_test/src/Callbacks.php @@ -17,7 +17,7 @@ class Callbacks { /** * Form element validation handler for 'name' in form_test_validate_form(). */ - public function validateName(&$element, FormStateInterface &$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 62eb8ce..c7a3eb9 100644 --- a/core/modules/system/tests/modules/form_test/src/ConfirmFormTestForm.php +++ b/core/modules/system/tests/modules/form_test/src/ConfirmFormTestForm.php @@ -61,7 +61,7 @@ public function getCancelText() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $form['element'] = array('#markup' => 'The ConfirmFormTestForm::buildForm() method was used for this form.
'); return parent::buildForm($form, $form_state); @@ -70,7 +70,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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'] = 'This is a one-time login for %user_name and will expire on %expiration_date.
Click on this button to log in to the site and change your password.
', array('%user_name' => $user->getUsername(), '%expiration_date' => $expiration_date))); } @@ -99,7 +99,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, AccountI /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 466547e..8e5ac1d 100644 --- a/core/modules/user/src/Form/UserPermissionsForm.php +++ b/core/modules/user/src/Form/UserPermissionsForm.php @@ -76,7 +76,7 @@ protected function getRoles() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state) { + public function buildForm(array $form, FormStateInterface $form_state) { $role_names = array(); $role_permissions = array(); foreach ($this->getRoles() as $role_name => $role) { @@ -185,7 +185,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - function submitForm(array &$form, FormStateInterface &$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 85bba52..3da670d 100644 --- a/core/modules/user/src/Form/UserPermissionsRoleSpecificForm.php +++ b/core/modules/user/src/Form/UserPermissionsRoleSpecificForm.php @@ -35,7 +35,7 @@ protected function getRoles() { * @param string $role_id * The user role ID used for this form. */ - public function buildForm(array $form, FormStateInterface &$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 902de61..f9e7a75 100644 --- a/core/modules/user/src/Form/UserRoleDelete.php +++ b/core/modules/user/src/Form/UserRoleDelete.php @@ -40,7 +40,7 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function submit(array $form, FormStateInterface &$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 9c7d642..c6fb44a 100644 --- a/core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php +++ b/core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php @@ -60,7 +60,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $roles = user_role_names(TRUE); unset($roles[DRUPAL_AUTHENTICATED_RID]); $form['rid'] = array( @@ -76,7 +76,7 @@ public function buildConfigurationForm(array $form, FormStateInterface &$form_st /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 927d22b..5400d4e 100644 --- a/core/modules/user/src/Plugin/Condition/UserRole.php +++ b/core/modules/user/src/Plugin/Condition/UserRole.php @@ -28,7 +28,7 @@ class UserRole extends ConditionPluginBase { /** * {@inheritdoc} */ - public function buildConfigurationForm(array $form, FormStateInterface &$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'), @@ -51,7 +51,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - public function submitConfigurationForm(array &$form, FormStateInterface &$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 86c03eb..bc5a5fa 100644 --- a/core/modules/user/src/Plugin/views/access/Permission.php +++ b/core/modules/user/src/Plugin/views/access/Permission.php @@ -61,7 +61,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 5473c66..c63a5a4 100644 --- a/core/modules/user/src/Plugin/views/access/Role.php +++ b/core/modules/user/src/Plugin/views/access/Role.php @@ -70,7 +70,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$form_state) { + public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $form['role'] = array( '#type' => 'checkboxes', @@ -81,13 +81,13 @@ public function buildOptionsForm(&$form, FormStateInterface &$form_state) { ); } - public function validateOptionsForm(&$form, FormStateInterface &$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, FormStateInterface &$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 d252d43..d218e06 100644 --- a/core/modules/user/src/Plugin/views/argument_default/User.php +++ b/core/modules/user/src/Plugin/views/argument_default/User.php @@ -37,7 +37,7 @@ protected function defineOptions() { /** * {@inheritdoc} */ - public function buildOptionsForm(&$form, FormStateInterface &$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 2768c19..71b5209 100644 --- a/core/modules/user/src/Plugin/views/argument_validator/User.php +++ b/core/modules/user/src/Plugin/views/argument_validator/User.php @@ -51,7 +51,7 @@ protected function defineOptions() { /** * {@inheritdoc} */ - public function buildOptionsForm(&$form, FormStateInterface &$form_state) { + public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $form['restrict_roles'] = array( @@ -77,7 +77,7 @@ public function buildOptionsForm(&$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitOptionsForm(&$form, FormStateInterface &$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 5aae535..057389b 100644 --- a/core/modules/user/src/Plugin/views/argument_validator/UserName.php +++ b/core/modules/user/src/Plugin/views/argument_validator/UserName.php @@ -23,7 +23,7 @@ class UserName extends User { /** * {@inheritdoc} */ - public function buildOptionsForm(&$form, FormStateInterface &$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 ffc9384..40ff364 100644 --- a/core/modules/user/src/Plugin/views/field/Link.php +++ b/core/modules/user/src/Plugin/views/field/Link.php @@ -46,7 +46,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 9ea5344..ad26317 100644 --- a/core/modules/user/src/Plugin/views/field/Mail.php +++ b/core/modules/user/src/Plugin/views/field/Mail.php @@ -25,7 +25,7 @@ protected function defineOptions() { return $options; } - public function buildOptionsForm(&$form, FormStateInterface &$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 e27628b..5396bc6 100644 --- a/core/modules/user/src/Plugin/views/field/Name.php +++ b/core/modules/user/src/Plugin/views/field/Name.php @@ -49,7 +49,7 @@ protected function defineOptions() { /** * {@inheritdoc} */ - public function buildOptionsForm(&$form, FormStateInterface &$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 671089c..d49c7e1 100644 --- a/core/modules/user/src/Plugin/views/field/User.php +++ b/core/modules/user/src/Plugin/views/field/User.php @@ -42,7 +42,7 @@ protected function defineOptions() { /** * Provide link to node option */ - public function buildOptionsForm(&$form, FormStateInterface &$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 c5eef2f..943cd9b 100644 --- a/core/modules/user/src/Plugin/views/field/UserBulkForm.php +++ b/core/modules/user/src/Plugin/views/field/UserBulkForm.php @@ -24,7 +24,7 @@ class UserBulkForm extends BulkForm { * * Provide a more useful title to improve the accessibility. */ - public function viewsForm(&$form, FormStateInterface &$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 4f7ad9d..cb9f35b 100644 --- a/core/modules/user/src/Plugin/views/field/UserData.php +++ b/core/modules/user/src/Plugin/views/field/UserData.php @@ -64,7 +64,7 @@ protected function defineOptions() { /** * Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions(). */ - public function buildOptionsForm(&$form, FormStateInterface &$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 863b77f..8bdb001 100644 --- a/core/modules/user/src/Plugin/views/filter/Name.php +++ b/core/modules/user/src/Plugin/views/filter/Name.php @@ -22,7 +22,7 @@ class Name extends InOperator { protected $alwaysMultiple = TRUE; - protected function valueForm(&$form, FormStateInterface &$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)); @@ -51,7 +51,7 @@ protected function valueForm(&$form, FormStateInterface &$form_state) { } } - protected function valueValidate($form, FormStateInterface &$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); @@ -73,7 +73,7 @@ public function acceptExposedInput($input) { return $rc; } - public function validateExposed(&$form, FormStateInterface &$form_state) { + public function validateExposed(&$form, FormStateInterface $form_state) { if (empty($this->options['exposed'])) { return; } @@ -109,7 +109,7 @@ public function validateExposed(&$form, FormStateInterface &$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, FormStateInterface &$form_state, $values) { + function validate_user_strings(&$form, FormStateInterface $form_state, $values) { $uids = array(); $placeholders = array(); $args = array(); @@ -141,7 +141,7 @@ function validate_user_strings(&$form, FormStateInterface &$form_state, $values) return $uids; } - protected function valueSubmit($form, FormStateInterface &$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 954bcb6..c7c74c5 100644 --- a/core/modules/user/src/ProfileForm.php +++ b/core/modules/user/src/ProfileForm.php @@ -27,7 +27,7 @@ public function __construct(EntityManagerInterface $entity_manager, LanguageMana /** * {@inheritdoc} */ - protected function actions(array $form, FormStateInterface &$form_state) { + protected function actions(array $form, FormStateInterface $form_state) { $element = parent::actions($form, $form_state); // The user account being edited. @@ -46,7 +46,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$form_state) { + public function save(array $form, FormStateInterface $form_state) { $account = $this->entity; $account->save(); $form_state['values']['uid'] = $account->id(); @@ -57,7 +57,7 @@ public function save(array $form, FormStateInterface &$form_state) { /** * Provides a submit handler for the 'Cancel account' button. */ - public function editCancelSubmit($form, FormStateInterface &$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 15bdc33..fd9c90b 100644 --- a/core/modules/user/src/ProfileTranslationHandler.php +++ b/core/modules/user/src/ProfileTranslationHandler.php @@ -19,7 +19,7 @@ class ProfileTranslationHandler extends ContentTranslationHandler { /** * {@inheritdoc} */ - public function entityFormAlter(array &$form, FormStateInterface &$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'); } @@ -31,7 +31,7 @@ public function entityFormAlter(array &$form, FormStateInterface &$form_state, E * * @see \Drupal\Core\Entity\EntityForm::build(). */ - function entityFormSave(array $form, FormStateInterface &$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 f77802a..f3f2511 100644 --- a/core/modules/user/src/RegisterForm.php +++ b/core/modules/user/src/RegisterForm.php @@ -28,7 +28,7 @@ public function __construct(EntityManagerInterface $entity_manager, LanguageMana /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $user = $this->currentUser(); /** @var \Drupal\user\UserInterface $account */ $account = $this->entity; @@ -72,7 +72,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * Overrides Drupal\Core\Entity\EntityForm::actions(). */ - protected function actions(array $form, FormStateInterface &$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; @@ -81,7 +81,7 @@ protected function actions(array $form, FormStateInterface &$form_state) { /** * Overrides Drupal\Core\Entity\EntityForm::submit(). */ - public function submit(array $form, FormStateInterface &$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) { @@ -103,7 +103,7 @@ public function submit(array $form, FormStateInterface &$form_state) { /** * Overrides Drupal\Core\Entity\EntityForm::submit(). */ - public function save(array $form, FormStateInterface &$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 62012d2..0587041 100644 --- a/core/modules/user/src/RoleForm.php +++ b/core/modules/user/src/RoleForm.php @@ -19,7 +19,7 @@ class RoleForm extends EntityForm { /** * {@inheritdoc} */ - public function form(array $form, FormStateInterface &$form_state) { + public function form(array $form, FormStateInterface $form_state) { $entity = $this->entity; $form['label'] = array( '#type' => 'textfield', @@ -52,7 +52,7 @@ public function form(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function save(array $form, FormStateInterface &$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 52295e1..8e7feec 100644 --- a/core/modules/user/src/RoleListBuilder.php +++ b/core/modules/user/src/RoleListBuilder.php @@ -59,7 +59,7 @@ public function getDefaultOperations(EntityInterface $entity) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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/tests/modules/user_form_test/src/Form/TestCurrentPassword.php b/core/modules/user/tests/modules/user_form_test/src/Form/TestCurrentPassword.php index c9ddece..b01fc79 100644 --- a/core/modules/user/tests/modules/user_form_test/src/Form/TestCurrentPassword.php +++ b/core/modules/user/tests/modules/user_form_test/src/Form/TestCurrentPassword.php @@ -29,7 +29,7 @@ public function getFormId() { * @param \Drupal\user\Entity\UserInterface $user * The user account. */ - public function buildForm(array $form, FormStateInterface &$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', @@ -61,7 +61,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, UserInte /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 599ad99..cf61d3d 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -509,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, FormStateInterface &$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."); @@ -522,7 +522,7 @@ function _user_language_selector_langcode_value($element, $input, FormStateInter * * @see AccountForm::form() */ -function user_validate_current_pass(&$form, FormStateInterface &$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/src/Form/ViewsExposedForm.php b/core/modules/views/src/Form/ViewsExposedForm.php index 724f671..2c78f5f 100644 --- a/core/modules/views/src/Form/ViewsExposedForm.php +++ b/core/modules/views/src/Form/ViewsExposedForm.php @@ -52,7 +52,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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( @@ -132,7 +132,7 @@ public function buildForm(array $form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$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; @@ -148,7 +148,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$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 44e328d..ac88a11 100644 --- a/core/modules/views/src/Form/ViewsForm.php +++ b/core/modules/views/src/Form/ViewsForm.php @@ -116,7 +116,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$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'; @@ -147,7 +147,7 @@ public function buildForm(array $form, FormStateInterface &$form_state, ViewExec /** * {@inheritdoc} */ - public function validateForm(array &$form, FormStateInterface &$form_state) { + public function validateForm(array &$form, FormStateInterface $form_state) { $form_object = $this->getFormObject($form_state); $form_object->validateForm($form, $form_state); } @@ -155,7 +155,7 @@ public function validateForm(array &$form, FormStateInterface &$form_state) { /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface &$form_state) { + public function submitForm(array &$form, FormStateInterface $form_state) { $form_object = $this->getFormObject($form_state); $form_object->submitForm($form, $form_state); } diff --git a/core/modules/views/src/Form/ViewsFormMainForm.php b/core/modules/views/src/Form/ViewsFormMainForm.php index 8ed170f..6c48b7e 100644 --- a/core/modules/views/src/Form/ViewsFormMainForm.php +++ b/core/modules/views/src/Form/ViewsFormMainForm.php @@ -22,7 +22,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface &$form_state, ViewExecutable $view = NULL, $output = NULL) { + public function buildForm(array $form, FormStateInterface $form_state, ViewExecutable $view = NULL, $output = NULL) { $form['#prefix'] = '