From efee4d2f3c87200ed1011c7812c2f57a27eb0df0 Mon Sep 17 00:00:00 2001 From: Dave Long <dave@longwaveconsulting.com> Date: Fri, 3 Jan 2025 14:51:10 +0000 Subject: [PATCH] Issue #3478220 by quietone: Fix MissingParamType in modules not views --- core/modules/block/block.module | 4 ++-- core/modules/block/src/BlockViewBuilder.php | 4 ++-- .../config/src/StorageReplaceDataWrapper.php | 2 +- .../config_test/src/Entity/ConfigTest.php | 14 ++++++------ .../FunctionalJavascript/ConfigExportTest.php | 2 +- .../src/ConfigNamesMapper.php | 2 +- .../ContentModerationInterface.php | 2 +- .../ContentTranslationHandlerInterface.php | 2 +- core/modules/contextual/contextual.api.php | 4 ++-- core/modules/editor/editor.module | 2 +- core/modules/field/field.api.php | 14 ++++++------ .../d6/FieldFormatterSettingsDefaults.php | 2 +- .../field_test/src/FieldTestHelper.php | 4 ++-- .../src/EntityDisplayModeListBuilder.php | 2 +- .../src/EntityFormModeListBuilder.php | 2 +- .../rest/resource/FileUploadResource.php | 2 +- core/modules/help/src/HelpTopicTwigLoader.php | 2 +- .../src/HelpTestTwigNodeVisitor.php | 2 +- core/modules/history/history.module | 4 ++-- core/modules/image/image.api.php | 2 +- core/modules/image/image.module | 4 ++-- .../Discovery/StaticReflectionParser.php | 2 +- .../Plugin/migrate/process/EntityExists.php | 2 +- .../Plugin/migrate/source/DrupalSqlBase.php | 4 ++-- core/modules/node/node.module | 14 +++++++----- core/modules/node/src/NodeViewBuilder.php | 2 +- .../node/src/Plugin/Search/NodeSearch.php | 2 +- .../tests/src/Traits/NodeCreationTrait.php | 2 +- .../Plugin/Field/FieldType/ListItemBase.php | 2 +- .../path_alias/src/AliasManagerInterface.php | 2 +- .../responsive_image/responsive_image.module | 2 +- core/modules/rest/src/Plugin/ResourceBase.php | 2 +- .../src/Normalizer/NormalizerBase.php | 2 +- .../src/ShortcutSetStorageInterface.php | 4 ++-- .../src/Controller/DbUpdateController.php | 4 ++-- .../system/src/Form/ModulesListForm.php | 2 +- core/modules/system/src/SystemManager.php | 2 +- .../src/Tests/Routing/MockAliasManager.php | 7 ++++++ core/modules/system/system.api.php | 2 +- core/modules/system/system.module | 12 +++++----- .../src/Form/FormTestMachineNameForm.php | 2 +- .../FormTestMachineNameValidationForm.php | 2 +- .../src/Form/FormTestTableSelectFormBase.php | 2 +- core/modules/taxonomy/taxonomy.module | 2 +- core/modules/text/text.module | 6 ++--- core/modules/toolbar/toolbar.api.php | 2 +- core/modules/update/update.api.php | 4 ++-- core/modules/update/update.install | 4 ++-- core/modules/update/update.module | 22 +++++++++---------- core/modules/workflows/src/StateInterface.php | 4 ++-- .../workflows/src/WorkflowTypeInterface.php | 2 +- 51 files changed, 105 insertions(+), 96 deletions(-) diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 07961ed4c0cc..f931d44cd85f 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -10,7 +10,7 @@ /** * Initializes blocks for installed themes. * - * @param $theme_list + * @param string[] $theme_list * An array of theme names. * * @see block_modules_installed() @@ -40,7 +40,7 @@ function block_themes_installed($theme_list) { * a particular region isn't available in the new theme, the block is assigned * to the new theme's default region. * - * @param $theme + * @param string $theme * The name of a theme. */ function block_theme_initialize($theme) { diff --git a/core/modules/block/src/BlockViewBuilder.php b/core/modules/block/src/BlockViewBuilder.php index b4cdf0c7aad7..852ad0c98f57 100644 --- a/core/modules/block/src/BlockViewBuilder.php +++ b/core/modules/block/src/BlockViewBuilder.php @@ -146,9 +146,9 @@ public static function trustedCallbacks() { /** * #lazy_builder callback; builds a #pre_render-able block. * - * @param $entity_id + * @param string $entity_id * A block config entity ID. - * @param $view_mode + * @param string $view_mode * The view mode the block is being viewed in. * * @return array diff --git a/core/modules/config/src/StorageReplaceDataWrapper.php b/core/modules/config/src/StorageReplaceDataWrapper.php index 8c9fa138a72f..8a16553d645e 100644 --- a/core/modules/config/src/StorageReplaceDataWrapper.php +++ b/core/modules/config/src/StorageReplaceDataWrapper.php @@ -188,7 +188,7 @@ public function getCollectionName() { /** * Replaces the configuration object data with the supplied data. * - * @param $name + * @param string $name * The configuration object name whose data to replace. * @param array $data * The configuration data. diff --git a/core/modules/config/tests/config_test/src/Entity/ConfigTest.php b/core/modules/config/tests/config_test/src/Entity/ConfigTest.php index 7f73622e5a23..61ec27d9400b 100644 --- a/core/modules/config/tests/config_test/src/Entity/ConfigTest.php +++ b/core/modules/config/tests/config_test/src/Entity/ConfigTest.php @@ -208,7 +208,7 @@ public function isInstallable() { /** * Sets the protected property value. * - * @param $value + * @param string $value * The value to set. * * @return $this @@ -233,9 +233,9 @@ public function getProtectedProperty(): string { /** * Concatenates the two params and sets the protected property value. * - * @param $value1 + * @param string $value1 * The first value to concatenate. - * @param $value2 + * @param string $value2 * The second value to concatenate. * * @return $this @@ -250,9 +250,9 @@ public function concatProtectedProperty(string $value1, string $value2): static /** * Concatenates up to two params and sets the protected property value. * - * @param $value1 + * @param string $value1 * The first value to concatenate. - * @param $value2 + * @param string $value2 * (optional) The second value to concatenate. Defaults to ''. * * @return $this @@ -267,7 +267,7 @@ public function concatProtectedPropertyOptional(string $value1, string $value2 = /** * Appends to protected property. * - * @param $value + * @param mixed $value * The value to append. * * @return $this @@ -319,7 +319,7 @@ public function getArrayProperty(): array { /** * Sets the array property. * - * @param $value + * @param array $value * The value to set. * * @return $this diff --git a/core/modules/config/tests/src/FunctionalJavascript/ConfigExportTest.php b/core/modules/config/tests/src/FunctionalJavascript/ConfigExportTest.php index aacee5065b01..121edd515f23 100644 --- a/core/modules/config/tests/src/FunctionalJavascript/ConfigExportTest.php +++ b/core/modules/config/tests/src/FunctionalJavascript/ConfigExportTest.php @@ -59,7 +59,7 @@ protected function setUp(): void { /** * Creates test blocks. * - * @param $title + * @param string $title * Title of the block. * * @return \Drupal\block_content\Entity\BlockContent diff --git a/core/modules/config_translation/src/ConfigNamesMapper.php b/core/modules/config_translation/src/ConfigNamesMapper.php index 63d579b16e06..1e1db7c8e2df 100644 --- a/core/modules/config_translation/src/ConfigNamesMapper.php +++ b/core/modules/config_translation/src/ConfigNamesMapper.php @@ -99,7 +99,7 @@ class ConfigNamesMapper extends PluginBase implements ConfigMapperInterface, Con /** * Constructs a ConfigNamesMapper. * - * @param $plugin_id + * @param string $plugin_id * The config mapper plugin ID. * @param mixed $plugin_definition * An array of plugin information with the following keys: diff --git a/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModerationInterface.php b/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModerationInterface.php index 0188a87e2004..d2d128cba54f 100644 --- a/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModerationInterface.php +++ b/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModerationInterface.php @@ -68,7 +68,7 @@ public function addEntityTypeAndBundle($entity_type_id, $bundle_id); /** * {@inheritdoc} * - * @param $entity + * @param \Drupal\Core\Entity\EntityInterface|null $entity * Content Moderation uses this parameter to determine the initial state * based on publishing status. */ diff --git a/core/modules/content_translation/src/ContentTranslationHandlerInterface.php b/core/modules/content_translation/src/ContentTranslationHandlerInterface.php index c3b9e4cf8907..1ceafbc942f3 100644 --- a/core/modules/content_translation/src/ContentTranslationHandlerInterface.php +++ b/core/modules/content_translation/src/ContentTranslationHandlerInterface.php @@ -25,7 +25,7 @@ public function getFieldDefinitions(); * * @param \Drupal\Core\Entity\EntityInterface $entity * The entity whose translation has to be accessed. - * @param $op + * @param string $op * The operation to be performed on the translation. Possible values are: * - "create" * - "update" diff --git a/core/modules/contextual/contextual.api.php b/core/modules/contextual/contextual.api.php index 0fe485a3bbdf..004947bf9b14 100644 --- a/core/modules/contextual/contextual.api.php +++ b/core/modules/contextual/contextual.api.php @@ -19,9 +19,9 @@ * data that is passed in by reference. Further links may be added or existing * links can be altered. * - * @param $element + * @param array $element * A renderable array representing the contextual links. - * @param $items + * @param array $items * An associative array containing the original contextual link items, as * generated by * \Drupal\Core\Menu\ContextualLinkManagerInterface::getContextualLinksArrayByGroup(), diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module index 46599d004fdf..d760fafbd318 100644 --- a/core/modules/editor/editor.module +++ b/core/modules/editor/editor.module @@ -236,7 +236,7 @@ function _editor_record_file_usage(array $uuids, EntityInterface $entity) { * An array of file entity UUIDs. * @param \Drupal\Core\Entity\EntityInterface $entity * An entity whose fields to inspect for file references. - * @param $count + * @param int $count * The number of references to delete. Should be 1 when deleting a single * revision and 0 when deleting an entity entirely. * diff --git a/core/modules/field/field.api.php b/core/modules/field/field.api.php index eb2af3b555cf..610a7b566fc0 100644 --- a/core/modules/field/field.api.php +++ b/core/modules/field/field.api.php @@ -56,7 +56,7 @@ /** * Perform alterations on Field API field types. * - * @param $info + * @param array $info * Array of information on field types as collected by the "field type" plugin * manager. */ @@ -272,7 +272,7 @@ function hook_field_widget_single_element_WIDGET_TYPE_form_alter(array &$element * \Drupal\Core\Field\WidgetBaseInterface::form(). * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. - * @param $context + * @param array $context * An associative array containing the following key-value pairs: * - form: The form structure to which widgets are being attached. This may be * a full form structure, or a sub-element of a larger form. @@ -299,12 +299,12 @@ function hook_field_widget_complete_form_alter(&$field_widget_complete_form, For * to modify a specific widget form, rather than using * hook_field_widget_complete_form_alter() and checking the widget type. * - * @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 + * @param array $context * An associative array containing the following key-value pairs: * - form: The form structure to which widgets are being attached. This may be * a full form structure, or a sub-element of a larger form. @@ -414,7 +414,7 @@ function hook_field_info_max_weight($entity_type, $bundle, $context, $context_mo * field definitions cache has been cleared, this hook is invoked on all modules * to allow them to respond to the field storage being purged. * - * @param $field_storage \Drupal\field\Entity\FieldStorageConfig + * @param \Drupal\field\Entity\FieldStorageConfig $field_storage * The field storage being purged. */ function hook_field_purge_field_storage(FieldStorageConfig $field_storage) { @@ -431,7 +431,7 @@ function hook_field_purge_field_storage(FieldStorageConfig $field_storage) { * field info cache has been cleared, this hook is invoked on all modules to * allow them to respond to the field being purged. * - * @param $field + * @param \Drupal\field\Entity\FieldConfig $field * The field being purged. */ function hook_field_purge_field(FieldConfig $field) { diff --git a/core/modules/field/src/Plugin/migrate/process/d6/FieldFormatterSettingsDefaults.php b/core/modules/field/src/Plugin/migrate/process/d6/FieldFormatterSettingsDefaults.php index 6398203243e4..bf72f37cb5a0 100644 --- a/core/modules/field/src/Plugin/migrate/process/d6/FieldFormatterSettingsDefaults.php +++ b/core/modules/field/src/Plugin/migrate/process/d6/FieldFormatterSettingsDefaults.php @@ -42,7 +42,7 @@ public function transform($value, MigrateExecutableInterface $migrate_executable /** * @param string $type * The field type. - * @param $format + * @param string $format * The format selected for the field on the display. * * @return array diff --git a/core/modules/field/tests/modules/field_test/src/FieldTestHelper.php b/core/modules/field/tests/modules/field_test/src/FieldTestHelper.php index 0caaf9962469..06f5407b2f49 100644 --- a/core/modules/field/tests/modules/field_test/src/FieldTestHelper.php +++ b/core/modules/field/tests/modules/field_test/src/FieldTestHelper.php @@ -70,9 +70,9 @@ public static function defaultValue(FieldableEntityInterface $entity, FieldDefin * assertEquals([$field], $mem['fieldStorageConfigCreate'][0]); * @endcode * - * @param $key + * @param string $key * The key under which to store to $value, or NULL as described above. - * @param $value + * @param mixed|null $value * A value to store for $key. * * @return array|null diff --git a/core/modules/field_ui/src/EntityDisplayModeListBuilder.php b/core/modules/field_ui/src/EntityDisplayModeListBuilder.php index aa5cbb59e587..4c7b9e5bce31 100644 --- a/core/modules/field_ui/src/EntityDisplayModeListBuilder.php +++ b/core/modules/field_ui/src/EntityDisplayModeListBuilder.php @@ -175,7 +175,7 @@ public function render() { /** * Filters entities based on their view builder handlers. * - * @param $entity_type + * @param string $entity_type * The entity type of the entity that needs to be validated. * * @return bool diff --git a/core/modules/field_ui/src/EntityFormModeListBuilder.php b/core/modules/field_ui/src/EntityFormModeListBuilder.php index 6cab12f453fe..e4424eeeb430 100644 --- a/core/modules/field_ui/src/EntityFormModeListBuilder.php +++ b/core/modules/field_ui/src/EntityFormModeListBuilder.php @@ -12,7 +12,7 @@ class EntityFormModeListBuilder extends EntityDisplayModeListBuilder { /** * Filters entities based on their form mode handlers. * - * @param $entity_type + * @param string $entity_type * The entity type of the entity that needs to be validated. * * @return bool diff --git a/core/modules/file/src/Plugin/rest/resource/FileUploadResource.php b/core/modules/file/src/Plugin/rest/resource/FileUploadResource.php index caab7bcc6b0c..97bb0e4b458a 100644 --- a/core/modules/file/src/Plugin/rest/resource/FileUploadResource.php +++ b/core/modules/file/src/Plugin/rest/resource/FileUploadResource.php @@ -271,7 +271,7 @@ protected function getBaseRouteRequirements($method) { /** * Generates a lock ID based on the file URI. * - * @param $file_uri + * @param string $file_uri * The file URI. * * @return string diff --git a/core/modules/help/src/HelpTopicTwigLoader.php b/core/modules/help/src/HelpTopicTwigLoader.php index 743015f9e538..fc2e61bbaafc 100644 --- a/core/modules/help/src/HelpTopicTwigLoader.php +++ b/core/modules/help/src/HelpTopicTwigLoader.php @@ -53,7 +53,7 @@ public function __construct($root_path, ModuleHandlerInterface $module_handler, /** * Adds an extensions help_topics directory to the Twig loader. * - * @param $path + * @param string $path * The path to the extension. */ protected function addExtension($path) { diff --git a/core/modules/help/tests/modules/help_topics_twig_tester/src/HelpTestTwigNodeVisitor.php b/core/modules/help/tests/modules/help_topics_twig_tester/src/HelpTestTwigNodeVisitor.php index af317d9efbb2..953f2aa2ce4f 100644 --- a/core/modules/help/tests/modules/help_topics_twig_tester/src/HelpTestTwigNodeVisitor.php +++ b/core/modules/help/tests/modules/help_topics_twig_tester/src/HelpTestTwigNodeVisitor.php @@ -169,7 +169,7 @@ public static function getState() { * each rendering run. * - return_chunk: Chunk index to keep intact for translated_chunk * processing. All others are removed. - * @param $value + * @param int $value * Value to set for $key. */ public static function setStateValue(string $key, $value) { diff --git a/core/modules/history/history.module b/core/modules/history/history.module index 1d53c5360546..44426cdd41af 100644 --- a/core/modules/history/history.module +++ b/core/modules/history/history.module @@ -76,9 +76,9 @@ function history_read_multiple($nids) { /** * Updates 'last viewed' timestamp of the specified entity for the current user. * - * @param $nid + * @param string|int|null $nid * The node ID that has been read. - * @param $account + * @param \Drupal\User\UserInterface $account * (optional) The user account to update the history for. Defaults to the * current user. */ diff --git a/core/modules/image/image.api.php b/core/modules/image/image.api.php index bac226320f2f..f70c634cc4b0 100644 --- a/core/modules/image/image.api.php +++ b/core/modules/image/image.api.php @@ -13,7 +13,7 @@ /** * Alter the information provided in \Drupal\image\Annotation\ImageEffect. * - * @param $effects + * @param array $effects * The array of image effects, keyed on the machine-readable effect name. */ function hook_image_effect_info_alter(&$effects) { diff --git a/core/modules/image/image.module b/core/modules/image/image.module index 8f3e0542e96a..5da1c3d3fcab 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -14,7 +14,7 @@ /** * Clears cached versions of a specific file in all styles. * - * @param $path + * @param string $path * The Drupal file path to the original image. */ function image_path_flush($path) { @@ -27,7 +27,7 @@ function image_path_flush($path) { /** * Gets an array of image styles suitable for using as select list options. * - * @param $include_empty + * @param bool $include_empty * If TRUE a '- None -' option will be inserted in the options array. * * @return string[] diff --git a/core/modules/migrate/src/Plugin/Discovery/StaticReflectionParser.php b/core/modules/migrate/src/Plugin/Discovery/StaticReflectionParser.php index a26a2c1e422a..029cef457006 100644 --- a/core/modules/migrate/src/Plugin/Discovery/StaticReflectionParser.php +++ b/core/modules/migrate/src/Plugin/Discovery/StaticReflectionParser.php @@ -19,7 +19,7 @@ class StaticReflectionParser extends BaseStaticReflectionParser { * * @param \Drupal\Component\Annotation\Doctrine\StaticReflectionParser $parser * The current static parser. - * @param $finder + * @param \Doctrine\Common\Reflection\ClassFinderInterface $finder * The class finder. Must implement * \Drupal\Component\ClassFinder\ClassFinderInterface, but can do so * implicitly (i.e., implements the interface's methods but not the actual diff --git a/core/modules/migrate/src/Plugin/migrate/process/EntityExists.php b/core/modules/migrate/src/Plugin/migrate/process/EntityExists.php index 3af401e25172..1babf06ef222 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/EntityExists.php +++ b/core/modules/migrate/src/Plugin/migrate/process/EntityExists.php @@ -42,7 +42,7 @@ class EntityExists extends ProcessPluginBase implements ContainerFactoryPluginIn * The plugin ID. * @param mixed $plugin_definition * The plugin implementation definition. - * @param $storage + * @param \Drupal\Core\Entity\EntityStorageInterface $storage * The entity storage. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityStorageInterface $storage) { diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php b/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php index e5c094342b21..e5e014224dc6 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php @@ -153,9 +153,9 @@ protected function moduleExists($module) { /** * Reads a variable from a source Drupal database. * - * @param $name + * @param string $name * Name of the variable. - * @param $default + * @param mixed $default * The default value. * * @return mixed diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 917aa8e47f05..448845844af3 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -29,8 +29,9 @@ * query joins the {comment_entity_statistics} table so that the comment_count * field is available, a title attribute will be added to show the number of * comments. - * @param $title - * (optional) A heading for the resulting list. + * @param string|null $title + * (optional) A heading for the resulting list. NULL results in no heading. + * Defaults to NULL. * * @return array|false * A renderable array containing a list of linked node titles fetched from @@ -446,7 +447,7 @@ function node_access_grants($operation, AccountInterface $account) { * 'node_access'; when this function returns TRUE, no node access joins are * added to the query. * - * @param $account + * @param \Drupal\Core\Session\AccountProxyInterface|null $account * (optional) The user object for the user whose access is being checked. If * omitted, the current user is used. Defaults to NULL. * @@ -491,8 +492,9 @@ function node_access_view_all_nodes($account = NULL) { * When unsure if the current user is an administrator, node_access_rebuild() * should be used instead. * - * @param $rebuild - * (optional) The boolean value to be written. + * @param bool|null $rebuild + * (optional) The boolean value to be written. Defaults to NULL, which returns + * the current value. * * @return bool|null * The current value of the flag if no value was provided for $rebuild. If a @@ -524,7 +526,7 @@ function node_access_needs_rebuild($rebuild = NULL) { * Note : As of Drupal 6, node access modules are not required to (and actually * should not) call node_access_rebuild() in hook_install/uninstall anymore. * - * @param $batch_mode + * @param bool $batch_mode * (optional) Set to TRUE to process in 'batch' mode, spawning processing over * several HTTP requests (thus avoiding the risk of PHP timeout if the site * has a large number of nodes). hook_update_N() and any form submit handler diff --git a/core/modules/node/src/NodeViewBuilder.php b/core/modules/node/src/NodeViewBuilder.php index 1e79ca0d5917..e9b491d21d49 100644 --- a/core/modules/node/src/NodeViewBuilder.php +++ b/core/modules/node/src/NodeViewBuilder.php @@ -81,7 +81,7 @@ protected function getBuildDefaults(EntityInterface $entity, $view_mode) { * The language in which the node entity is being viewed. * @param bool $is_in_preview * Whether the node is currently being previewed. - * @param $revision_id + * @param int|string $revision_id * (optional) The identifier of the node revision to be loaded. If none * is provided, the default revision will be loaded. * diff --git a/core/modules/node/src/Plugin/Search/NodeSearch.php b/core/modules/node/src/Plugin/Search/NodeSearch.php index da195681714f..c6173d764874 100644 --- a/core/modules/node/src/Plugin/Search/NodeSearch.php +++ b/core/modules/node/src/Plugin/Search/NodeSearch.php @@ -434,7 +434,7 @@ public function removeSubmittedInfo(array $build) { /** * Adds the configured rankings to the search query. * - * @param $query + * @param \Drupal\Core\Database\Query\SelectExtender $query * A query object that has been extended with the Search DB Extender. */ protected function addNodeRankings(SelectExtender $query) { diff --git a/core/modules/node/tests/src/Traits/NodeCreationTrait.php b/core/modules/node/tests/src/Traits/NodeCreationTrait.php index 74898811a7d3..7830b545a831 100644 --- a/core/modules/node/tests/src/Traits/NodeCreationTrait.php +++ b/core/modules/node/tests/src/Traits/NodeCreationTrait.php @@ -19,7 +19,7 @@ trait NodeCreationTrait { * * @param string|\Drupal\Component\Render\MarkupInterface $title * A node title, usually generated by $this->randomMachineName(). - * @param $reset + * @param bool $reset * (optional) Whether to reset the entity cache. * * @return \Drupal\node\NodeInterface|false diff --git a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php index 250fe8812eaf..83b155a8f56d 100644 --- a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php +++ b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php @@ -336,7 +336,7 @@ abstract protected function allowedValuesDescription(); /** * #element_validate callback for options field allowed values. * - * @param $element + * @param array $element * An associative array containing the properties and children of the * generic form element. * @param \Drupal\Core\Form\FormStateInterface $form_state diff --git a/core/modules/path_alias/src/AliasManagerInterface.php b/core/modules/path_alias/src/AliasManagerInterface.php index 207905625d39..dca8fd111436 100644 --- a/core/modules/path_alias/src/AliasManagerInterface.php +++ b/core/modules/path_alias/src/AliasManagerInterface.php @@ -44,7 +44,7 @@ public function getAliasByPath($path, $langcode = NULL); /** * Clears the static caches in alias manager and rebuilds the prefix list. * - * @param $source + * @param string|null $source * Source path of the alias that is being inserted/updated. If omitted, the * entire lookup static cache will be cleared and the prefix list will be * rebuilt. diff --git a/core/modules/responsive_image/responsive_image.module b/core/modules/responsive_image/responsive_image.module index 00744ae91fbe..092e454be1e2 100644 --- a/core/modules/responsive_image/responsive_image.module +++ b/core/modules/responsive_image/responsive_image.module @@ -68,7 +68,7 @@ function template_preprocess_responsive_image_formatter(&$variables): void { * * Default template: responsive-image.html.twig. * - * @param $variables + * @param array $variables * An associative array containing: * - uri: The URI of the image. * - width: The width of the image (if known). diff --git a/core/modules/rest/src/Plugin/ResourceBase.php b/core/modules/rest/src/Plugin/ResourceBase.php index b3951f8488b9..aff6df954230 100644 --- a/core/modules/rest/src/Plugin/ResourceBase.php +++ b/core/modules/rest/src/Plugin/ResourceBase.php @@ -184,7 +184,7 @@ protected function getBaseRoute($canonical_path, $method) { /** * Gets the base route requirements for a particular method. * - * @param $method + * @param string $method * The HTTP method to be used for the route. * * @return array diff --git a/core/modules/serialization/src/Normalizer/NormalizerBase.php b/core/modules/serialization/src/Normalizer/NormalizerBase.php index b0220ce933f7..46d286d4aaa5 100644 --- a/core/modules/serialization/src/Normalizer/NormalizerBase.php +++ b/core/modules/serialization/src/Normalizer/NormalizerBase.php @@ -83,7 +83,7 @@ protected function checkFormat($format = NULL) { * * @param array $context * Context options for the normalizer. - * @param $data + * @param mixed $data * The data that might have cacheability information. */ protected function addCacheableDependency(array $context, $data) { diff --git a/core/modules/shortcut/src/ShortcutSetStorageInterface.php b/core/modules/shortcut/src/ShortcutSetStorageInterface.php index 409a986cbdc7..3deabb115b66 100644 --- a/core/modules/shortcut/src/ShortcutSetStorageInterface.php +++ b/core/modules/shortcut/src/ShortcutSetStorageInterface.php @@ -15,7 +15,7 @@ interface ShortcutSetStorageInterface extends ConfigEntityStorageInterface { * * @param \Drupal\shortcut\ShortcutSetInterface $shortcut_set * An object representing the shortcut set. - * @param $account + * @param \Drupal\user\UserInterface $account * A user account that will be assigned to use the set. */ public function assignUser(ShortcutSetInterface $shortcut_set, $account); @@ -25,7 +25,7 @@ public function assignUser(ShortcutSetInterface $shortcut_set, $account); * * The user will go back to using whatever default set applies. * - * @param $account + * @param \Drupal\user\UserInterface $account * A user account that will be removed from the shortcut set assignment. * * @return bool diff --git a/core/modules/system/src/Controller/DbUpdateController.php b/core/modules/system/src/Controller/DbUpdateController.php index 42a8c7b8a41f..40f8a5b22497 100644 --- a/core/modules/system/src/Controller/DbUpdateController.php +++ b/core/modules/system/src/Controller/DbUpdateController.php @@ -532,7 +532,7 @@ protected function results(Request $request) { /** * Renders a list of requirement errors or warnings. * - * @param $severity + * @param int $severity * The severity of the message, as per RFC 3164. * @param array $requirements * The array of requirement values. @@ -664,7 +664,7 @@ protected function triggerBatch(Request $request) { * page in update.php). Additionally, if the site was off-line, now that the * update process is completed, the site is set back online. * - * @param $success + * @param bool $success * Indicate that the batch API tasks were all completed successfully. * @param array $results * An array of all the results that were updated in update_do_one(). diff --git a/core/modules/system/src/Form/ModulesListForm.php b/core/modules/system/src/Form/ModulesListForm.php index 5a233b3807b1..fc0d10a4f0d2 100644 --- a/core/modules/system/src/Form/ModulesListForm.php +++ b/core/modules/system/src/Form/ModulesListForm.php @@ -247,7 +247,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { * The list existing modules. * @param \Drupal\Core\Extension\Extension $module * The module for which to build the form row. - * @param $distribution + * @param string $distribution * The distribution. * * @return array diff --git a/core/modules/system/src/SystemManager.php b/core/modules/system/src/SystemManager.php index 7c88d95c3e77..9e3d61ef3f9f 100644 --- a/core/modules/system/src/SystemManager.php +++ b/core/modules/system/src/SystemManager.php @@ -124,7 +124,7 @@ public function listRequirements() { /** * Extracts the highest severity from the requirements array. * - * @param $requirements + * @param array $requirements * An array of requirements, in the same format as is returned by * hook_requirements(). * diff --git a/core/modules/system/src/Tests/Routing/MockAliasManager.php b/core/modules/system/src/Tests/Routing/MockAliasManager.php index 7412e6d6dbe6..a9b88bfbc5c7 100644 --- a/core/modules/system/src/Tests/Routing/MockAliasManager.php +++ b/core/modules/system/src/Tests/Routing/MockAliasManager.php @@ -73,6 +73,13 @@ public function getPathByAlias($alias, $langcode = NULL) { /** * {@inheritdoc} + * + * @param string $path + * The path of the alias. + * @param string $langcode + * The language code. + * + * @return string */ public function getAliasByPath($path, $langcode = NULL) { if ($path[0] !== '/') { diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index ca1e02c9864f..7f259f27d5ec 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -15,7 +15,7 @@ /** * Alters theme operation links. * - * @param $theme_groups + * @param array $theme_groups * An associative array containing groups of themes. * * @see system_themes_page() diff --git a/core/modules/system/system.module b/core/modules/system/system.module index ea45920ab0b0..184e6ab02b5c 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -220,13 +220,13 @@ function template_preprocess_entity_add_list(&$variables): void { * * @param callable $callback * The name of the function to invoke once the user authorizes the operation. - * @param $file + * @param string $file * The full path to the file where the callback function is implemented. - * @param $arguments + * @param array $arguments * Optional array of arguments to pass into the callback when it is invoked. * Note that the first argument to the callback is always the FileTransfer * object created by authorize.php when the user authorizes the operation. - * @param $page_title + * @param string $page_title * Optional string to use as the page title once redirected to authorize.php. */ function system_authorized_init($callback, $file, $arguments = [], $page_title = NULL) { @@ -332,7 +332,7 @@ function system_preprocess_block(&$variables): void { * This function is called from the system_settings form to check all core * file directories (file_public_path, file_private_path, file_temporary_path). * - * @param $form_element + * @param array $form_element * The form element containing the name of the directory to check. * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. @@ -376,7 +376,7 @@ function system_check_directory($form_element, FormStateInterface $form_state) { * * @param \Drupal\Core\Extension\Extension|string $theme * A theme extension object, or the name of a theme. - * @param $show + * @param string $show * Possible values: REGIONS_ALL or REGIONS_VISIBLE. Visible excludes hidden * regions. * @@ -425,7 +425,7 @@ function system_sort_themes($a, $b) { /** * Gets the name of the default region for a given theme. * - * @param $theme + * @param string $theme * The name of a theme. * * @return string diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestMachineNameForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestMachineNameForm.php index 56dd003831ac..6b5415cdb5cc 100644 --- a/core/modules/system/tests/modules/form_test/src/Form/FormTestMachineNameForm.php +++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestMachineNameForm.php @@ -83,7 +83,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { /** * Loading stub for machine name. * - * @param $machine_name + * @param string $machine_name * The machine name. * * @return bool diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestMachineNameValidationForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestMachineNameValidationForm.php index af2d4cc1af9b..48e72015230f 100644 --- a/core/modules/system/tests/modules/form_test/src/Form/FormTestMachineNameValidationForm.php +++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestMachineNameValidationForm.php @@ -122,7 +122,7 @@ public function buildAjaxSnackConfigureForm(array $form, FormStateInterface $for /** * Loading stub for machine name. * - * @param $machine_name + * @param string $machine_name * The machine name. * * @return bool diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectFormBase.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectFormBase.php index 1420e4447439..075eaf200698 100644 --- a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectFormBase.php +++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectFormBase.php @@ -22,7 +22,7 @@ abstract class FormTestTableSelectFormBase extends FormBase { * An associative array containing the structure of the form. * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. - * @param $element_properties + * @param array $element_properties * An array of element properties for the tableselect element. * * @return array diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index d00cf3f80502..8f5afb1c24e2 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -95,7 +95,7 @@ function taxonomy_term_is_page(Term $term) { * The index lists all terms that are related to a given node entity, and is * therefore maintained at the entity level. * - * @param \Drupal\node\Entity\Node $node + * @param \Drupal\node\NodeInterface $node * The node entity. */ function taxonomy_build_node_index($node) { diff --git a/core/modules/text/text.module b/core/modules/text/text.module index b7bc4208561c..8ab9db539060 100644 --- a/core/modules/text/text.module +++ b/core/modules/text/text.module @@ -16,14 +16,14 @@ * place such as the end of a paragraph, a line break, or the end of a sentence * (in that order of preference). * - * @param $text + * @param string $text * The content for which a summary will be generated. - * @param $format + * @param string $format * The format of the content. If the line break filter is present then we * treat newlines embedded in $text as line breaks. If the htmlcorrector * filter is present, it will be run on the generated summary (if different * from the incoming $text). - * @param $size + * @param string|null $size * The desired character length of the summary. If omitted, the default value * will be used. Ignored if the special delimiter is present in $text. * diff --git a/core/modules/toolbar/toolbar.api.php b/core/modules/toolbar/toolbar.api.php index 27faac80bc01..8dbdc82698c6 100644 --- a/core/modules/toolbar/toolbar.api.php +++ b/core/modules/toolbar/toolbar.api.php @@ -157,7 +157,7 @@ function hook_toolbar(): array { * element of the $items array is one item returned by a module from * hook_toolbar(). Additional items may be added, or existing items altered. * - * @param $items + * @param array $items * Associative array of toolbar menu definitions returned from hook_toolbar(). */ function hook_toolbar_alter(&$items) { diff --git a/core/modules/update/update.api.php b/core/modules/update/update.api.php index b76fad3363fa..050db6161a13 100644 --- a/core/modules/update/update.api.php +++ b/core/modules/update/update.api.php @@ -25,7 +25,7 @@ * updates report. In rare cases, a module might want to alter the data * associated with a project already in the list. * - * @param $projects + * @param array $projects * Reference to an array of the projects installed on the system. This * includes all the metadata documented in the comments below for each project * (either module or theme) that is currently installed. The array is @@ -78,7 +78,7 @@ function hook_update_projects_alter(&$projects) { /** * Alter the information about available updates for projects. * - * @param $projects + * @param array $projects * Reference to an array of information about available updates to each * project installed on the system. * diff --git a/core/modules/update/update.install b/core/modules/update/update.install index 694fe84af710..b9fb4d70e4e6 100644 --- a/core/modules/update/update.install +++ b/core/modules/update/update.install @@ -97,10 +97,10 @@ function update_uninstall(): void { * This is shared for both core and contrib to generate the right elements in * the array for hook_requirements(). * - * @param $project + * @param array $project * Array of information about the project we're testing as returned by * update_calculate_project_data(). - * @param $type + * @param string $type * What kind of project this is ('core' or 'contrib'). * * @return array diff --git a/core/modules/update/update.module b/core/modules/update/update.module index 0ddab79fbfaf..bef8ee1e44e6 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -49,7 +49,7 @@ function _update_no_data() { * logic in update_calculate_project_data() will be wrong and produce confusing, * bogus results. * - * @param $refresh + * @param bool $refresh * (optional) Boolean to indicate if this method should refresh automatically * if there's no data. Defaults to FALSE. * @@ -115,7 +115,7 @@ function update_get_available($refresh = FALSE) { * We only create a new fetch task if there's no task already in the queue for * this particular project (based on 'update_fetch_task' key-value collection). * - * @param $project + * @param array $project * Associative array of information about a project as created by * \Drupal\update\UpdateManager::getProjects(), including keys such as 'name' * (short name), and the 'info' array with data from a .info.yml file for the @@ -146,9 +146,9 @@ function update_fetch_data() { /** * Batch callback: Performs actions when all fetch tasks have been completed. * - * @param $success + * @param bool $success * TRUE if the batch operation was successful; FALSE if there were errors. - * @param $results + * @param array $results * An associative array of results from the batch operation, including the key * 'updated' which holds the total number of projects we fetched available * update data for. @@ -176,12 +176,12 @@ function update_fetch_data_finished($success, $results) { * site-wide status report at admin/reports/status and in the body of the * notification email messages generated by update_cron(). * - * @param $msg_type + * @param string $msg_type * String to indicate what kind of message to generate. Can be either 'core' * or 'contrib'. - * @param $msg_reason + * @param int $msg_reason * Integer constant specifying why message is generated. - * @param $langcode + * @param string $langcode * (optional) A language code to use. Defaults to NULL. * * @return \Drupal\Core\StringTranslation\TranslatableMarkup @@ -266,7 +266,7 @@ function _update_project_status_sort($a, $b) { * provides a "Check manually" link that refreshes the available update and * redirects back to the same page. * - * @param $variables + * @param array $variables * An associative array containing: * - last: The timestamp when the site last checked for available updates. * @@ -302,7 +302,7 @@ function _update_manager_unique_identifier() { /** * Returns the directory where update archive files should be extracted. * - * @param $create + * @param bool $create * (optional) Whether to attempt to create the directory if it does not * already exist. Defaults to TRUE. * @@ -324,7 +324,7 @@ function _update_manager_extract_directory($create = TRUE) { /** * Returns the directory where update archive files should be cached. * - * @param $create + * @param bool $create * (optional) Whether to attempt to create the directory if it does not * already exist. Defaults to TRUE. * @@ -377,7 +377,7 @@ function update_clear_update_disk_cache() { * left alone by tar and correctly set to the time the archive file was * unpacked. * - * @param $path + * @param string $path * A string containing a file path or (streamwrapper) URI. * * @return bool diff --git a/core/modules/workflows/src/StateInterface.php b/core/modules/workflows/src/StateInterface.php index d4fe9871c46d..5ae57da528b3 100644 --- a/core/modules/workflows/src/StateInterface.php +++ b/core/modules/workflows/src/StateInterface.php @@ -43,7 +43,7 @@ public function weight(); /** * Determines if the state can transition to the provided state ID. * - * @param $to_state_id + * @param string $to_state_id * The state to transition to. * * @return bool @@ -54,7 +54,7 @@ public function canTransitionTo($to_state_id); /** * Gets the Transition object for the provided state ID. * - * @param $to_state_id + * @param string $to_state_id * The state to transition to. * * @return \Drupal\workflows\TransitionInterface diff --git a/core/modules/workflows/src/WorkflowTypeInterface.php b/core/modules/workflows/src/WorkflowTypeInterface.php index 36a7f4a40bc9..6bd5e95c2fca 100644 --- a/core/modules/workflows/src/WorkflowTypeInterface.php +++ b/core/modules/workflows/src/WorkflowTypeInterface.php @@ -246,7 +246,7 @@ public function getTransitions(?array $transition_ids = NULL); /** * Gets the transitions for a state for the provided direction. * - * @param $state_id + * @param string $state_id * The state to get transitions for. * @param string $direction * (optional) The direction of the transition, defaults to -- GitLab