diff --git a/core/lib/Drupal/Core/Form/FormBuilderInterface.php b/core/lib/Drupal/Core/Form/FormBuilderInterface.php index ff7c6273128e1f54c5f7a9d83a1143c4c85fd62a..66d9da4c2f1e7a6b5ed896e8c097a24469b5fca5 100644 --- a/core/lib/Drupal/Core/Form/FormBuilderInterface.php +++ b/core/lib/Drupal/Core/Form/FormBuilderInterface.php @@ -149,7 +149,7 @@ public function rebuildForm($form_id, FormStateInterface &$form_state, $old_form * The value must be one of the following: * - The name of a class that implements \Drupal\Core\Form\FormInterface. * - An instance of a class that implements \Drupal\Core\Form\FormInterface. - * @param $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. Most important is the * $form_state->getValues() collection, a tree of data used to simulate the * incoming \Drupal::request()->request information from a user's form diff --git a/core/lib/Drupal/Core/Form/FormSubmitterInterface.php b/core/lib/Drupal/Core/Form/FormSubmitterInterface.php index c3e0089b079189b4cdd66b8e89404e4542e039dc..9d078b3ca332e85cf0000b23b16065383abc74e7 100644 --- a/core/lib/Drupal/Core/Form/FormSubmitterInterface.php +++ b/core/lib/Drupal/Core/Form/FormSubmitterInterface.php @@ -27,9 +27,9 @@ public function doSubmitForm(&$form, FormStateInterface &$form_state); * Button-specific handlers are checked first. If none exist, the function * falls back to form-level handlers. * - * @param $form + * @param array $form * An associative array containing the structure of the form. - * @param $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. If the user submitted the form by clicking * a button with custom handler functions defined, those handlers will be * stored here. diff --git a/core/lib/Drupal/Core/Form/form.api.php b/core/lib/Drupal/Core/Form/form.api.php index 0502ea3239212fd918c0a55ac99244ac72b0d780..210e9f36ed54969303cb3f44b61eba7e98784dae 100644 --- a/core/lib/Drupal/Core/Form/form.api.php +++ b/core/lib/Drupal/Core/Form/form.api.php @@ -186,13 +186,13 @@ function hook_ajax_render_alter(array &$data) { * hook_form_FORM_ID_alter(). So, for each module, the more general hooks are * called first followed by the more specific. * - * @param $form + * @param array $form * Nested array of form elements that comprise the form. - * @param $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. The arguments that * \Drupal::formBuilder()->getForm() was originally called with are available * in the array $form_state->getBuildInfo()['args']. - * @param $form_id + * @param string $form_id * A string that is the unique ID of the form, set by * Drupal\Core\Form\FormInterface::getFormId(). * @@ -235,13 +235,13 @@ function hook_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_stat * hook_form_FORM_ID_alter(). So, for each module, the more general hooks are * called first followed by the more specific. * - * @param $form + * @param array $form * Nested array of form elements that comprise the form. - * @param $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. The arguments that * \Drupal::formBuilder()->getForm() was originally called with are available * in the array $form_state->getBuildInfo()['args']. - * @param $form_id + * @param string $form_id * String representing the name of the form itself. Typically this is the * name of the function that generated the form. * @@ -293,11 +293,11 @@ function hook_form_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $f * hook_form_FORM_ID_alter(). So, for each module, the more general hooks are * called first followed by the more specific. * - * @param $form + * @param array $form * Nested array of form elements that comprise the form. - * @param $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. - * @param $form_id + * @param string $form_id * String representing the name of the form itself. Typically this is the * name of the function that generated the form. * diff --git a/core/lib/Drupal/Core/Render/Element/FormElementBase.php b/core/lib/Drupal/Core/Render/Element/FormElementBase.php index 75da91227dc4cf80bf5458e3bbcffe6d23e45079..bce01e19558d7d6dc497dcd3f91ffa87eb403960 100644 --- a/core/lib/Drupal/Core/Render/Element/FormElementBase.php +++ b/core/lib/Drupal/Core/Render/Element/FormElementBase.php @@ -132,7 +132,7 @@ public static function processPattern(&$element, FormStateInterface $form_state, * @param $element * An associative array containing the properties and children of the * generic form element. - * @param $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. * @param array $complete_form * The complete form structure. diff --git a/core/lib/Drupal/Core/Render/theme.api.php b/core/lib/Drupal/Core/Render/theme.api.php index a67c53299b4e75fc3247dfaf44acc535e3e7463d..fa447c20063018f00c6622743ea56abe9ff26d97 100644 --- a/core/lib/Drupal/Core/Render/theme.api.php +++ b/core/lib/Drupal/Core/Render/theme.api.php @@ -525,9 +525,9 @@ * Note that the base theme's form alterations will be run before any sub-theme * alterations. * - * @param $form + * @param array $form * Nested array of form elements that comprise the form. - * @param $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ function hook_form_system_theme_settings_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state) { diff --git a/core/modules/field/field.api.php b/core/modules/field/field.api.php index f8d72a26dbac7e45ddbc0a9945b93c338c4c35b9..b33aa3c282b65211f8ab492c94e6bea094ad61be 100644 --- a/core/modules/field/field.api.php +++ b/core/modules/field/field.api.php @@ -257,10 +257,10 @@ function hook_field_widget_single_element_WIDGET_TYPE_form_alter(array &$element /** * Alter the complete form for field widgets provided by other modules. * - * @param $field_widget_complete_form + * @param array $field_widget_complete_form * The field widget form element as constructed by * \Drupal\Core\Field\WidgetBaseInterface::form(). - * @param $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. * @param $context * An associative array containing the following key-value pairs: diff --git a/core/modules/media_library/src/Form/FileUploadForm.php b/core/modules/media_library/src/Form/FileUploadForm.php index fd2bc14a419cb4fe1076d4068420e6fe3fdf40e3..e9e25f108fca6afae3ed647d274cda1e2d1b1370 100644 --- a/core/modules/media_library/src/Form/FileUploadForm.php +++ b/core/modules/media_library/src/Form/FileUploadForm.php @@ -276,7 +276,7 @@ protected function buildEntityFormElement(MediaInterface $media, array $form, Fo * The entity form source field element. * @param \Drupal\Core\Form\FormStateInterface $form_state * The current form state. - * @param $form + * @param array $form * The complete form. * * @return array diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php index bd71a44a3d945c7064d79d22ce590d923e731c75..31c97b3cb4c8ea889e4350fa2c261bca5c90a205 100644 --- a/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -244,9 +244,9 @@ protected function actions(array $form, FormStateInterface $form_state) { /** * Form submission handler for the 'preview' action. * - * @param $form + * @param array $form * An associative array containing the structure of the form. - * @param $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ public function preview(array $form, FormStateInterface $form_state) { diff --git a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php index 46af4ccd42cdcb71f23573661bf60a353e603bc0..47f1705481b1272b60a6a90848eb330f964386b0 100644 --- a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php +++ b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php @@ -339,7 +339,7 @@ abstract protected function allowedValuesDescription(); * @param $element * An associative array containing the properties and children of the * generic form element. - * @param $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form for the form this element belongs to. * * @see \Drupal\Core\Render\Element\FormElementBase::processPattern() diff --git a/core/modules/system/tests/modules/theme_test/src/ThemeTestPreprocess.php b/core/modules/system/tests/modules/theme_test/src/ThemeTestPreprocess.php index 211af09edd5418c86a9bece574723d8f91b2dc4e..5749af5778276f7f42a4354828ad134e8875bc42 100644 --- a/core/modules/system/tests/modules/theme_test/src/ThemeTestPreprocess.php +++ b/core/modules/system/tests/modules/theme_test/src/ThemeTestPreprocess.php @@ -12,7 +12,7 @@ class ThemeTestPreprocess { /** * Preprocess callback for testing preprocess callbacks. * - * @param $variables + * @param array $variables * An associative array containing: * - foo: Text for testing preprocess callback. */ diff --git a/core/modules/views/src/Plugin/views/HandlerBase.php b/core/modules/views/src/Plugin/views/HandlerBase.php index 583efd832c4c2bb84031734e7d0f3cbb47557773..f34d08737036c0d7fbe87ac524af9a8676a49caf 100644 --- a/core/modules/views/src/Plugin/views/HandlerBase.php +++ b/core/modules/views/src/Plugin/views/HandlerBase.php @@ -334,6 +334,12 @@ public function usesGroupBy() { /** * Provide a form for aggregation settings. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function buildGroupByForm(&$form, FormStateInterface $form_state) { $display_id = $form_state->get('display_id'); @@ -361,6 +367,12 @@ public function buildGroupByForm(&$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. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function submitGroupByForm(&$form, FormStateInterface $form_state) { $form_state->get('handler')->options['group_type'] = $form_state->getValue(['options', 'group_type']); @@ -383,11 +395,22 @@ public function defineExtraOptions(&$option) {} /** * Provide a form for setting options. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function buildExtraOptionsForm(&$form, FormStateInterface $form_state) {} /** * Validate the options form. + * + * @param array $form + * Associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function validateExtraOptionsForm($form, FormStateInterface $form_state) {} @@ -395,6 +418,11 @@ public function validateExtraOptionsForm($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. + * + * @param array $form + * Associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function submitExtraOptionsForm($form, FormStateInterface $form_state) {} @@ -417,26 +445,55 @@ public function exposedInfo() {} /** * Render our chunk of the exposed handler form when selecting. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function buildExposedForm(&$form, FormStateInterface $form_state) {} /** * Validate the exposed handler form. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function validateExposed(&$form, FormStateInterface $form_state) {} /** * Submit the exposed handler form. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function submitExposed(&$form, FormStateInterface $form_state) {} /** * Form for exposed handler options. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function buildExposeForm(&$form, FormStateInterface $form_state) {} /** * Validate the options form. + * + * @param array $form + * Associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function validateExposeForm($form, FormStateInterface $form_state) {} @@ -444,16 +501,33 @@ public function validateExposeForm($form, FormStateInterface $form_state) {} * Perform any necessary changes to the form exposes prior to storage. * * There is no need for this function to actually store the data. + * + * @param array $form + * Associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function submitExposeForm($form, FormStateInterface $form_state) {} /** * Shortcut to display the expose/hide button. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function showExposeButton(&$form, FormStateInterface $form_state) {} /** * Shortcut to display the exposed options form. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function showExposeForm(&$form, FormStateInterface $form_state) { if (empty($this->options['exposed'])) { @@ -770,6 +844,11 @@ public static function breakString($str, $force_int = FALSE) { /** * Displays the Expose form. + * + * @param array $form + * Associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function displayExposedForm($form, FormStateInterface $form_state) { $item = &$this->options; diff --git a/core/modules/views/src/Plugin/views/ViewsHandlerInterface.php b/core/modules/views/src/Plugin/views/ViewsHandlerInterface.php index 8a61d56548c3a99756f072784e7f24e9640fed82..cf060c0aa6c5510a6c2204951805442b6f577466 100644 --- a/core/modules/views/src/Plugin/views/ViewsHandlerInterface.php +++ b/core/modules/views/src/Plugin/views/ViewsHandlerInterface.php @@ -109,6 +109,11 @@ public function postExecute(&$values); /** * Shortcut to display the exposed options form. + * + * @param array $form + * The form array to alter, passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function showExposeForm(&$form, FormStateInterface $form_state); diff --git a/core/modules/views/src/Plugin/views/ViewsPluginInterface.php b/core/modules/views/src/Plugin/views/ViewsPluginInterface.php index 4304be07d8dbfe0d01aa9268ad30daffb7dd9450..7caf2faab0bf3f55ccae605aa602e9219871f508 100644 --- a/core/modules/views/src/Plugin/views/ViewsPluginInterface.php +++ b/core/modules/views/src/Plugin/views/ViewsPluginInterface.php @@ -43,6 +43,12 @@ public function filterByDefinedOptions(array &$storage); /** * Validate the options form. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function validateOptionsForm(&$form, FormStateInterface $form_state); @@ -82,6 +88,12 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$ /** * Handle any special handling on the validate form. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function submitOptionsForm(&$form, FormStateInterface $form_state); diff --git a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php index f817f88fb137a5d00e095de7e452cd50ced3adf1..0515864e5927ead525b2083959cadf8faa660d82 100644 --- a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php +++ b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php @@ -242,6 +242,12 @@ public function isAGroup() { * If overridden, it is best to call through to the parent, * or to at least make sure all of the functions in this form * are called. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); @@ -283,6 +289,12 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { /** * Simple validate handler. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function validateOptionsForm(&$form, FormStateInterface $form_state) { $this->operatorValidate($form, $form_state); @@ -297,6 +309,12 @@ public function validateOptionsForm(&$form, FormStateInterface $form_state) { /** * Simple submit handler. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function submitOptionsForm(&$form, FormStateInterface $form_state) { // Do not store these values. @@ -330,6 +348,12 @@ public function showOperatorForm(&$form, FormStateInterface $form_state) { * This may be overridden by child classes, and it must * define $form['operator']; * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. + * * @see buildOptionsForm() */ protected function operatorForm(&$form, FormStateInterface $form_state) { @@ -355,6 +379,11 @@ public function operatorOptions() { /** * Validate the operator form. + * + * @param array $form + * Associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ protected function operatorValidate($form, FormStateInterface $form_state) {} @@ -362,11 +391,22 @@ protected function operatorValidate($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. + * + * @param array $form + * Associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function operatorSubmit($form, FormStateInterface $form_state) {} /** * Shortcut to display the value form. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ protected function showValueForm(&$form, FormStateInterface $form_state) { $this->valueForm($form, $form_state); @@ -382,6 +422,12 @@ protected function showValueForm(&$form, FormStateInterface $form_state) { * This should be overridden by all child classes and it must * define $form['value'] * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. + * * @see buildOptionsForm() */ protected function valueForm(&$form, FormStateInterface $form_state) { @@ -390,6 +436,11 @@ protected function valueForm(&$form, FormStateInterface $form_state) { /** * Validate the options form. + * + * @param array $form + * Associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ protected function valueValidate($form, FormStateInterface $form_state) {} @@ -397,11 +448,22 @@ protected function valueValidate($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. + * + * @param array $form + * Associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ protected function valueSubmit($form, FormStateInterface $form_state) {} /** * Shortcut to display the exposed options form. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function showBuildGroupForm(&$form, FormStateInterface $form_state) { if (empty($this->options['is_grouped'])) { @@ -425,6 +487,12 @@ public function showBuildGroupForm(&$form, FormStateInterface $form_state) { /** * Shortcut to display the build_group/hide button. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ protected function showBuildGroupButton(&$form, FormStateInterface $form_state) { @@ -502,6 +570,12 @@ public function buildGroupForm($form, FormStateInterface $form_state) { /** * Shortcut to display the expose/hide button. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function showExposeButton(&$form, FormStateInterface $form_state) { $form['expose_button'] = [ @@ -552,6 +626,12 @@ public function showExposeButton(&$form, FormStateInterface $form_state) { /** * Options form subform for exposed filter options. * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. + * * @see buildOptionsForm() */ public function buildExposeForm(&$form, FormStateInterface $form_state) { @@ -945,6 +1025,12 @@ public function groupForm(&$form, FormStateInterface $form_state) { * Render our chunk of the exposed filter form when selecting. * * You can override this if it doesn't do what you expect. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ public function buildExposedForm(&$form, FormStateInterface $form_state) { if (empty($this->options['exposed'])) { @@ -1041,6 +1127,12 @@ protected function buildValueWrapper(&$form, $wrapper_identifier) { * Build the form to let users create the group of exposed filters. * * This form is displayed when users click on button 'Build group'. + * + * @param array $form + * An alterable, associative array containing the structure of the form, + * passed by reference. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. */ protected function buildExposedFiltersGroupForm(&$form, FormStateInterface $form_state) { if (empty($this->options['exposed']) || empty($this->options['is_grouped'])) {