diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 909f543..c853e3a 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1132,7 +1132,6 @@ function comment_form_node_type_form_alter(&$form, $form_state) { * comment_form_node_type_form_alter(). * * @see comment_form_node_type_form_alter() - * @see node_type_form() */ function comment_translation_configuration_element_submit($form, &$form_state) { // The comment translation settings form element is embedded into the node 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 b5a4f94..7844dcb 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.module +++ b/core/modules/system/tests/modules/entity_test/entity_test.module @@ -62,6 +62,11 @@ function entity_test_menu() { /** * Menu callback: displays the 'Add new entity_test' form. + * + * @return array + * The processed form for a new entity_test. + * + * @see entity_test_menu() */ function entity_test_add() { drupal_set_title(t('Create an entity_test')); @@ -71,6 +76,14 @@ function entity_test_add() { /** * Menu callback: displays the 'Edit existing entity_test' form. + * + * @param array $entity + * The entity to be edited. + * + * @return array + * The processed form for the edited entity_test. + * + * @see entity_test_menu() */ function entity_test_edit(EntityTest $entity) { drupal_set_title($entity->label(), PASS_THROUGH); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermTranslationController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermTranslationController.php index a8e6dd7..2fa4227 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermTranslationController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermTranslationController.php @@ -24,7 +24,11 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac } /** - * Submit handler for the save action. + * Form submission handler for TermTranslationController::entityFormAlter(). + * + * This handles the save action. + * + * @see \Drupal\Core\Entity\EntityFormController::build(). */ function entityFormSave(array $form, array &$form_state) { if ($this->getSourceLangcode($form_state)) { diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php index ddf6589..6966d0b 100644 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php +++ b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php @@ -247,7 +247,15 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac } /** - * Process callback that handles entity form shared elements. + * Process callback: Determines which elements get clue in the form. + * + * @param array $element + * Form API element. + * + * @return array + * A processed element with the shared elements marked with a clue. + * + * @see \Drupal\translation_entity\EntityTranslationController::entityFormAlter() */ public function entityFormSharedElements($element) { static $ignored_types; @@ -317,8 +325,15 @@ protected function addTranslatabilityClue(&$element) { /** * Entity builder method. + * + * @param string $entity_type + * The type of the entity. + * @param \Drupal\Core\Entity\EntityInterface $entity + * The entity whose form is being built. + * + * @see \Drupal\translation_entity\EntityTranslationController::entityFormAlter() */ - public function entityFormEntityBuild($entity_type, $entity, $form, &$form_state) { + public function entityFormEntityBuild($entity_type, EntityInterface $entity, array $form, array &$form_state) { $form_controller = translation_entity_form_controller($form_state); $form_langcode = $form_controller->getFormLangcode($form_state); $source_langcode = $this->getSourceLangcode($form_state); @@ -340,7 +355,9 @@ public function entityFormEntityBuild($entity_type, $entity, $form, &$form_state } /** - * Submit handler for the source language change. + * Form submission handler for EntityTranslationController::entityFormAlter(). + * + * Takes care of the source language change. */ public function entityFormSourceChange($form, &$form_state) { $form_controller = translation_entity_form_controller($form_state); @@ -353,7 +370,9 @@ public function entityFormSourceChange($form, &$form_state) { } /** - * Submit handler for the entity deletion. + * Form submission handler for EntityTranslationController::entityFormAlter(). + * + * Takes care of entity deletion. */ function entityFormDelete($form, &$form_state) { $form_controller = translation_entity_form_controller($form_state); @@ -364,7 +383,9 @@ function entityFormDelete($form, &$form_state) { } /** - * Submit handler for the entity translation deletion. + * Form submission handler for EntityTranslationController::entityFormAlter(). + * + * Takes care of entity translation deletion. */ function entityFormDeleteTranslation($form, &$form_state) { $form_controller = translation_entity_form_controller($form_state); @@ -377,7 +398,7 @@ function entityFormDeleteTranslation($form, &$form_state) { /** * Returns the title to be used for the entity form page. * - * @param Drupal\Core\Entity\EntityInterface $entity + * @param \Drupal\Core\Entity\EntityInterface $entity * The entity whose form is being altered. */ protected function entityFormTitle(EntityInterface $entity) { diff --git a/core/modules/translation_entity/translation_entity.admin.inc b/core/modules/translation_entity/translation_entity.admin.inc index 34e3b37..e9f87e8 100644 --- a/core/modules/translation_entity/translation_entity.admin.inc +++ b/core/modules/translation_entity/translation_entity.admin.inc @@ -5,8 +5,10 @@ * The entity translation administration forms. */ +use Drupal\Core\Entity\EntityInterface; + /** - * Returns the confirmation form for changing field translatability. + * Form constructor for the confirmation of translatability switching. */ function translation_entity_translatable_form(array $form, array &$form_state, $field_name) { $field = field_info_field($field_name); @@ -35,7 +37,7 @@ function translation_entity_translatable_form(array $form, array &$form_state, $ } /** - * Submit handler for the field settings form. + * Form submission handler for translation_entity_translatable_form(). * * This submit handler maintains consistency between the translatability of an * entity and the language under which the field data is stored. When a field is @@ -86,10 +88,16 @@ function translation_entity_translatable_form_submit(array $form, array $form_st batch_set($batch); } -/* +/** * Toggles translatability of the given field. * * This is called from a batch operation, but should only run once per field. + * + * @param bool $translatable + * Indicator of whether the field should be made translatable (TRUE) or + * untranslatble (FALSE). + * @param string $field_name + * Field machine name. */ function translation_entity_translatable_switch($translatable, $field_name) { $field = field_info_field($field_name); @@ -103,7 +111,13 @@ function translation_entity_translatable_switch($translatable, $field_name) { } /** - * Converts field data to or from LANGUAGE_NOT_SPECIFIED. + * Batch callback: Converts field data to or from LANGUAGE_NOT_SPECIFIED. + * + * @param bool $translatable + * Indicator of whether the field should be made translatable (TRUE) or + * untranslatble (FALSE). + * @param string $field_name + * Field machine name. */ function translation_entity_translatable_batch($translatable, $field_name, &$context) { $entity_types = array(); @@ -218,7 +232,7 @@ function translation_entity_translatable_batch($translatable, $field_name, &$con /** * Stores the given field translations. */ -function _translation_entity_update_field($entity_type, $entity, $field_name) { +function _translation_entity_update_field($entity_type, EntityInterface $entity, $field_name) { $empty = 0; $field = field_info_field($field_name); @@ -238,7 +252,7 @@ function _translation_entity_update_field($entity_type, $entity, $field_name) { } /** - * Checks the exit status of the batch operation. + * Batch finished callback: Checks the exit status of the batch operation. */ function translation_entity_translatable_batch_done($success, $results, $operations) { if ($success) { diff --git a/core/modules/translation_entity/translation_entity.module b/core/modules/translation_entity/translation_entity.module index a6dc4ce..547903a 100644 --- a/core/modules/translation_entity/translation_entity.module +++ b/core/modules/translation_entity/translation_entity.module @@ -634,9 +634,15 @@ function translation_entity_enable_widget($entity_type, $bundle, array &$form, a } /** - * Process handler for the language_configuration form element. + * Process callback: Expands the language_configuration form element. + * + * @param array $element + * Form API element. + * + * @return + * Processed language configuration element. */ -function translation_entity_language_configuration_element_process($element, array &$form_state, array &$form) { +function translation_entity_language_configuration_element_process(array $element, array &$form_state, array &$form) { $form_state['translation_entity']['key'] = $element['#name']; $context = $form_state['language'][$element['#name']]; @@ -654,11 +660,13 @@ function translation_entity_language_configuration_element_process($element, arr } /** - * Configuration element validation handler. + * Form validation handler for element added with translation_entity_language_configuration_element_process(). * * Checks whether translation can be enabled: if language is set to one of the * special languages and language selector is not hidden, translation cannot be * enabled. + * + * @see translation_entity_language_configuration_element_submit() */ function translation_entity_language_configuration_element_validate($element, array &$form_state, array $form) { $key = $form_state['translation_entity']['key']; @@ -675,9 +683,11 @@ function translation_entity_language_configuration_element_validate($element, ar } /** - * Configuration form submit handler. + * Form submission handler for element added with translation_entity_language_configuration_element_process(). * * Stores the entity translation settings. + * + * @see translation_entity_language_configuration_element_validate() */ function translation_entity_language_configuration_element_submit(array $form, array &$form_state) { $key = $form_state['translation_entity']['key']; diff --git a/core/modules/translation_entity/translation_entity.pages.inc b/core/modules/translation_entity/translation_entity.pages.inc index 4d92f52..b7b9a8c 100644 --- a/core/modules/translation_entity/translation_entity.pages.inc +++ b/core/modules/translation_entity/translation_entity.pages.inc @@ -236,7 +236,7 @@ function translation_entity_prepare_translation(EntityInterface $entity, Languag } /** - * Form builder for the translation deletion confirmation. + * Form constructor for the translation deletion confirmation. */ function translation_entity_delete_confirm(array $form, array $form_state, EntityInterface $entity, Language $language) { $langcode = $language->langcode; @@ -253,7 +253,7 @@ function translation_entity_delete_confirm(array $form, array $form_state, Entit } /** - * Submit handler for the translation deletion confirmation. + * Form submission handler for translation_entity_delete_confirm(). */ function translation_entity_delete_confirm_submit(array $form, array &$form_state) { list($entity, $language) = $form_state['build_info']['args']; diff --git a/core/modules/user/lib/Drupal/user/ProfileTranslationController.php b/core/modules/user/lib/Drupal/user/ProfileTranslationController.php index e7dcd65..91e129b 100644 --- a/core/modules/user/lib/Drupal/user/ProfileTranslationController.php +++ b/core/modules/user/lib/Drupal/user/ProfileTranslationController.php @@ -24,7 +24,11 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac } /** - * Submit handler for the save action. + * Form submission handler for ProfileTranslationController::entityFormAlter(). + * + * This handles the save action. + * + * @see \Drupal\Core\Entity\EntityFormController::build(). */ function entityFormSave(array $form, array &$form_state) { if ($this->getSourceLangcode($form_state)) {