diff options
author | quietone <quietone@2572884.no-reply.drupal.org> | 2024-11-17 17:37:29 +1300 |
---|---|---|
committer | quietone <quietone@2572884.no-reply.drupal.org> | 2024-11-17 17:37:29 +1300 |
commit | be64557b884ec2c730732aa15d3c0784f8f23da3 (patch) | |
tree | f82c59d776a44dd439ab305b563fb07a4f45d793 /core | |
parent | f8e5acb7643f787cf58dee689c76d13e29c8aa43 (diff) | |
download | drupal-be64557b884ec2c730732aa15d3c0784f8f23da3.tar.gz drupal-be64557b884ec2c730732aa15d3c0784f8f23da3.zip |
Issue #3483299 by tstoeckler, mstrelan, nicxvan: Add void return type to all preprocess hook implementations
Diffstat (limited to 'core')
77 files changed, 258 insertions, 1794 deletions
diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php index b56942a5dab7..b2c42d37625b 100644 --- a/core/.phpstan-baseline.php +++ b/core/.phpstan-baseline.php @@ -266,72 +266,6 @@ $ignoreErrors[] = [ 'path' => __DIR__ . '/includes/form.inc', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_checkboxes\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/form.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_details\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/form.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_fieldset\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/form.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_form\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/form.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_form_element\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/form.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_form_element_label\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/form.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_input\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/form.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_radios\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/form.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_select\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/form.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_textarea\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/form.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_vertical_tabs\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/form.inc', -]; -$ignoreErrors[] = [ // identifier: variable.undefined 'message' => '#^Variable \\$new_set_index might not be defined\\.$#', 'count' => 1, @@ -536,126 +470,6 @@ $ignoreErrors[] = [ 'path' => __DIR__ . '/includes/theme.inc', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_breadcrumb\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_container\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_datetime_form\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_datetime_wrapper\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_field\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_field_multiple_value_form\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_html\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_image\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_install_page\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_item_list\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_links\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_maintenance_page\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_maintenance_task_list\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_menu_local_action\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_menu_local_task\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_page\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_pager\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_region\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_table\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_time\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.inc', -]; -$ignoreErrors[] = [ // identifier: variable.undefined 'message' => '#^Variable \\$items might not be defined\\.$#', 'count' => 1, @@ -668,12 +482,6 @@ $ignoreErrors[] = [ 'path' => __DIR__ . '/includes/theme.maintenance.inc', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_authorize_report\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/includes/theme.maintenance.inc', -]; -$ignoreErrors[] = [ // identifier: variable.undefined 'message' => '#^Variable \\$custom_theme might not be defined\\.$#', 'count' => 1, @@ -12504,12 +12312,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/block/block.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\block\\\\BlockAccessControlHandler\\:\\:mergeCacheabilityFromConditions\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/block/src/BlockAccessControlHandler.php', @@ -12984,12 +12786,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_block_content_add_list\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/block_content/block_content.pages.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\block_content\\\\Access\\\\AccessGroupAnd\\:\\:addDependency\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/block_content/src/Access/AccessGroupAnd.php', @@ -14256,30 +14052,12 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function comment_preprocess_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/comment/comment.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function comment_preprocess_field\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/comment/comment.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function comment_uri\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/comment/comment.module', ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_comment\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/comment/comment.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\comment\\\\CommentBreadcrumbBuilder\\:\\:formatPlural\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/comment/src/CommentBreadcrumbBuilder.php', @@ -14856,12 +14634,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function comment_empty_title_test_preprocess_comment\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/comment/tests/modules/comment_empty_title_test/comment_empty_title_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\comment_test\\\\Controller\\\\CommentTestController\\:\\:commentReport\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/comment/tests/modules/comment_test/src/Controller/CommentTestController.php', @@ -16776,12 +16548,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function content_moderation_preprocess_node\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/content_moderation/content_moderation.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\content_moderation\\\\ContentPreprocess\\:\\:create\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/content_moderation/src/ContentPreprocess.php', @@ -17874,12 +17640,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function _content_translation_preprocess_language_content_settings_table\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/content_translation/content_translation.admin.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function content_translation_form_language_content_settings_submit\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/content_translation/content_translation.admin.inc', @@ -17933,12 +17693,6 @@ $ignoreErrors[] = [ 'path' => __DIR__ . '/modules/content_translation/content_translation.module', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function content_translation_preprocess_language_content_settings_table\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/content_translation/content_translation.module', -]; -$ignoreErrors[] = [ // identifier: variable.undefined 'message' => '#^Variable \\$locked_languages might not be defined\\.$#', 'count' => 1, @@ -20537,18 +20291,6 @@ $ignoreErrors[] = [ 'path' => __DIR__ . '/modules/field_ui/field_ui.module', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function field_ui_preprocess_form_element__new_storage_type\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/field_ui/field_ui.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_field_ui_table\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/field_ui/field_ui.module', -]; -$ignoreErrors[] = [ // identifier: variable.undefined 'message' => '#^Variable \\$entity_display might not be defined\\.$#', 'count' => 1, @@ -21185,30 +20927,6 @@ $ignoreErrors[] = [ 'path' => __DIR__ . '/modules/file/file.module', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_file_link\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/file/file.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_file_managed_file\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/file/file.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_file_upload_help\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/file/file.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_file_widget_multiple\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/file/file.module', -]; -$ignoreErrors[] = [ // identifier: empty.variable 'message' => '#^Variable \\$file_upload in empty\\(\\) always exists and is not falsy\\.$#', 'count' => 1, @@ -22374,24 +22092,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_filter_guidelines\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/filter/filter.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_filter_tips\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/filter/filter.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_text_format_wrapper\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/filter/filter.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\filter\\\\Element\\\\TextFormat\\:\\:currentUser\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/filter/src/Element/TextFormat.php', @@ -22740,12 +22440,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function help_preprocess_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/help/help.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\help\\\\HelpSectionManager\\:\\:clearCachedDefinitions\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/help/src/HelpSectionManager.php', @@ -23082,30 +22776,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_image_anchor\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/image/image.admin.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_image_style_preview\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/image/image.admin.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_image_formatter\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/image/image.field.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_image_widget\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/image/image.field.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function image_requirements\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/image/image.install', @@ -23118,12 +22788,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_image_style\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/image/image.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\image\\\\ConfigurableImageEffectBase\\:\\:submitConfigurationForm\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/image/src/ConfigurableImageEffectBase.php', @@ -23820,30 +23484,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function inline_form_errors_preprocess_datetime_wrapper\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/inline_form_errors/inline_form_errors.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function inline_form_errors_preprocess_details\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/inline_form_errors/inline_form_errors.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function inline_form_errors_preprocess_fieldset\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/inline_form_errors/inline_form_errors.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function inline_form_errors_preprocess_form_element\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/inline_form_errors/inline_form_errors.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\inline_form_errors\\\\FormErrorHandler\\:\\:displayErrorMessages\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/inline_form_errors/src/FormErrorHandler.php', @@ -24840,18 +24480,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_language_content_settings_table\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/language/language.admin.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_language_negotiation_configure_form\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/language/language.admin.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function language_configuration_element_submit\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/language/language.module', @@ -24864,12 +24492,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function language_preprocess_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/language/language.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\language\\\\Config\\\\LanguageConfigFactoryOverride\\:\\:addCollections\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/language/src/Config/LanguageConfigFactoryOverride.php', @@ -25860,12 +25482,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function layout_builder_preprocess_language_content_settings_table\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/layout_builder/layout_builder.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\layout_builder_expose_all_field_blocks\\\\Hook\\\\LayoutBuilderExposeAllFieldBlocksHooks\\:\\:help\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/layout_builder/modules/layout_builder_expose_all_field_blocks/src/Hook/LayoutBuilderExposeAllFieldBlocksHooks.php', @@ -26682,18 +26298,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function layout_builder_test_preprocess_layout__onecol\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function layout_builder_test_preprocess_layout__twocol_section\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\layout_builder_test\\\\Hook\\\\LayoutBuilderTestHooks\\:\\:entityExtraFieldInfo\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/layout_builder/tests/modules/layout_builder_test/src/Hook/LayoutBuilderTestHooks.php', @@ -26790,12 +26394,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function layout_builder_theme_suggestions_test_preprocess_item_list__layouts\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/layout_builder/tests/modules/layout_builder_theme_suggestions_test/layout_builder_theme_suggestions_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\Tests\\\\layout_builder\\\\Functional\\\\LayoutBuilderAccessTest\\:\\:providerTestAccessWithBundles\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php', @@ -27336,12 +26934,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_layout\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/layout_discovery/layout_discovery.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\layout_discovery\\\\Hook\\\\LayoutDiscoveryHooks\\:\\:help\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/layout_discovery/src/Hook/LayoutDiscoveryHooks.php', @@ -27360,12 +26952,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_link_formatter_link_separate\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/link/link.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\link\\\\Hook\\\\LinkHooks\\:\\:fieldTypeCategoryInfoAlter\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/link/src/Hook/LinkHooks.php', @@ -27666,12 +27252,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function locale_preprocess_node\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/locale/locale.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function locale_string_is_safe\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/locale/locale.module', @@ -27744,18 +27324,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_locale_translation_last_check\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/locale/locale.pages.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_locale_translation_update_info\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/locale/locale.pages.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function locale_cron_fill_queue\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/locale/locale.translation.inc', @@ -28584,24 +28152,12 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function media_preprocess_media_reference_help\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/media/media.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function media_theme_suggestions_media\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/media/media.module', ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_media\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/media/media.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\media\\\\Controller\\\\MediaFilterController\\:\\:checkCsrf\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/media/src/Controller/MediaFilterController.php', @@ -28986,12 +28542,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function media_test_embed_preprocess_media_embed_error\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/media/tests/modules/media_test_embed/media_test_embed.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\media_test_embed\\\\Hook\\\\MediaTestEmbedHooks\\:\\:entityAccess\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/media/tests/modules/media_test_embed/src/Hook/MediaTestEmbedHooks.php', @@ -29010,12 +28560,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function media_test_oembed_preprocess_media_oembed_iframe\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/media/tests/modules/media_test_oembed/media_test_oembed.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\media_test_oembed\\\\Controller\\\\ResourceController\\:\\:setResource404\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/media/tests/modules/media_test_oembed/src/Controller/ResourceController.php', @@ -29574,36 +29118,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function media_library_preprocess_media\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/media_library/media_library.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function media_library_preprocess_views_view__media_library\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/media_library/media_library.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function media_library_preprocess_views_view_fields\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/media_library/media_library.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_media_library_item\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/media_library/media_library.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_media_library_wrapper\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/media_library/media_library.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\media_library\\\\Ajax\\\\UpdateSelectionCommand\\:\\:render\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/media_library/src/Ajax/UpdateSelectionCommand.php', @@ -30330,12 +29844,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function menu_ui_preprocess_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/menu_ui/menu_ui.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\menu_ui\\\\Form\\\\MenuDeleteForm\\:\\:create\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/menu_ui/src/Form/MenuDeleteForm.php', @@ -32888,12 +32396,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function navigation_test_preprocess_block__navigation\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/navigation/tests/navigation_test/navigation_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\Tests\\\\navigation\\\\Functional\\\\NavigationShortcutsBlockTest\\:\\:assertCacheContext\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/navigation/tests/src/Functional/NavigationShortcutsBlockTest.php', @@ -33020,24 +32522,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function node_preprocess_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/node/node.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function node_preprocess_field__node\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/node/node.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function node_preprocess_html\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/node/node.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function node_reindex_node_search\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/node/node.module', @@ -33049,18 +32533,6 @@ $ignoreErrors[] = [ 'path' => __DIR__ . '/modules/node/node.module', ]; $ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_node\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/node/node.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_node_add_list\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/node/node.module', -]; -$ignoreErrors[] = [ // identifier: return.missing 'message' => '#^Method Drupal\\\\node\\\\ConfigTranslation\\\\NodeTypeMapper\\:\\:setEntity\\(\\) should return bool but return statement is missing\\.$#', 'count' => 2, @@ -35774,18 +35246,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_responsive_image\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/responsive_image/responsive_image.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_responsive_image_formatter\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/responsive_image/responsive_image.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\responsive_image\\\\Hook\\\\ResponsiveImageHooks\\:\\:help\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/responsive_image/src/Hook/ResponsiveImageHooks.php', @@ -36614,12 +36074,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function search_preprocess_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/search/search.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function search_theme_suggestions_search_result\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/search/search.module', @@ -36632,12 +36086,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_search_result\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/search/search.pages.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function search_post_update_block_with_empty_page_id\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/search/search.post_update.php', @@ -37016,12 +36464,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function search_embedded_form_preprocess_search_result\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/search/tests/modules/search_embedded_form/search_embedded_form.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\search_embedded_form\\\\Form\\\\SearchEmbeddedForm\\:\\:submitForm\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/search/tests/modules/search_embedded_form/src/Form/SearchEmbeddedForm.php', @@ -37436,12 +36878,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function settings_tray_preprocess_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/settings_tray/settings_tray.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\settings_tray\\\\Block\\\\BlockEntitySettingTrayForm\\:\\:form\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/settings_tray/src/Block/BlockEntitySettingTrayForm.php', @@ -37598,18 +37034,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function shortcut_preprocess_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/shortcut/shortcut.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function shortcut_preprocess_page_title\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/shortcut/shortcut.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\shortcut\\\\Entity\\\\Shortcut\\:\\:postSave\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/shortcut/src/Entity/Shortcut.php', @@ -39098,42 +38522,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_admin_block_content\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/system.admin.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_admin_page\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/system.admin.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_system_admin_index\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/system.admin.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_system_modules_details\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/system.admin.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_system_modules_uninstall\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/system.admin.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_system_themes_page\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/system.admin.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function system_requirements\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/system/system.install', @@ -39200,18 +38588,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function system_preprocess_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/system.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function system_preprocess_toolbar\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/system.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function system_sort_themes\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/system/system.module', @@ -39248,12 +38624,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_entity_add_list\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/system.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function system_post_update_sdc_uninstall\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/system/system.post_update.php', @@ -39872,12 +39242,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function common_test_preprocess_common_test_render_element\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/common_test/common_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function olivero_drupal_alter_alter\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/modules/common_test/common_test.module', @@ -42640,12 +42004,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function js_displace_preprocess_html\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/js_displace/js_displace.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\js_interaction_test\\\\Controller\\\\JSInteractionTestForm\\:\\:submitForm\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/modules/js_interaction_test/src/Controller/JSInteractionTestForm.php', @@ -42718,12 +42076,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_layout_test_2col\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/layout_test/layout_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\layout_test\\\\Plugin\\\\Layout\\\\LayoutTestPlugin\\:\\:submitConfigurationForm\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/modules/layout_test/src/Plugin/Layout/LayoutTestPlugin.php', @@ -42956,24 +42308,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function olivero_test_preprocess_field_multiple_value_form\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/olivero_test/olivero_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_test_preprocess_html\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/olivero_test/olivero_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function pager_test_preprocess_pager\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/pager_test/pager_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\pager_test\\\\Controller\\\\PagerTestController\\:\\:multiplePagers\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/modules/pager_test/src/Controller/PagerTestController.php', @@ -43307,12 +42641,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function router_test_preprocess_page\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/router_test_directory/router_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\router_test\\\\RouteTestSubscriber\\:\\:alterRoutes\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/modules/router_test_directory/src/RouteTestSubscriber.php', @@ -43805,12 +43133,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function theme_region_test_preprocess_region\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/theme_region_test/theme_region_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\theme_suggestions_test\\\\Hook\\\\ThemeSuggestionsTestHooks\\:\\:themeSuggestionsAlter\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/modules/theme_suggestions_test/src/Hook/ThemeSuggestionsTestHooks.php', @@ -43919,48 +43241,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_theme_test\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/theme_test/theme_test.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_theme_test_deprecations_preprocess\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/theme_test/theme_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_theme_test_registered_by_module\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/theme_test/theme_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_theme_test_render_element\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/theme_test/theme_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function theme_test_preprocess_html\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/theme_test/theme_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function theme_test_preprocess_theme_test_preprocess_suggestions\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/theme_test/theme_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function theme_test_preprocess_theme_test_preprocess_suggestions__monkey\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/theme_test/theme_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function theme_test_theme_suggestions_node\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/modules/theme_test/theme_test.module', @@ -44093,12 +43373,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function twig_theme_test_preprocess_status_messages\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/twig_theme_test/twig_theme_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\unique_field_constraint_test\\\\Hook\\\\UniqueFieldConstraintTestHooks\\:\\:entityBaseFieldInfoAlter\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/modules/unique_field_constraint_test/src/Hook/UniqueFieldConstraintTestHooks.php', @@ -46247,18 +45521,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function test_subsubtheme_preprocess_theme_test_template_test\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/themes/test_subsubtheme/test_subsubtheme.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function test_subtheme_preprocess_theme_test_template_test\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/themes/test_subtheme/test_subtheme.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function test_subtheme_views_post_render\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/themes/test_subtheme/test_subtheme.theme', @@ -46283,48 +45545,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function test_theme_preprocess_theme_test_preprocess_suggestions\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/themes/test_theme/test_theme.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function test_theme_preprocess_theme_test_preprocess_suggestions__kitten\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/themes/test_theme/test_theme.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function test_theme_preprocess_theme_test_preprocess_suggestions__kitten__flamingo\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/themes/test_theme/test_theme.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function test_theme_preprocess_theme_test_preprocess_suggestions__kitten__meerkat__tarsier__moose\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/themes/test_theme/test_theme.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function test_theme_preprocess_theme_test_preprocess_suggestions__suggestion\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/themes/test_theme/test_theme.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function test_theme_preprocess_theme_test_theme_class\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/themes/test_theme/test_theme.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function test_theme_preprocess_twig_theme_test_php_variables\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/themes/test_theme/test_theme.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function test_theme_theme_registry_alter\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/themes/test_theme/test_theme.theme', @@ -46367,12 +45587,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function test_theme_nyan_cat_engine_preprocess_theme_test_template_test\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/themes/test_theme_nyan_cat_engine/test_theme_nyan_cat_engine.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function test_theme_settings_form_system_theme_settings_submit\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/themes/test_theme_settings/theme-settings.php', @@ -46931,12 +46145,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_taxonomy_term\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/taxonomy/taxonomy.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\taxonomy_crud\\\\Hook\\\\TaxonomyCrudHooks\\:\\:taxonomyVocabularyPresave\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/taxonomy/tests/modules/taxonomy_crud/src/Hook/TaxonomyCrudHooks.php', @@ -47627,12 +46835,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function toolbar_test_preprocess_menu\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\Tests\\\\toolbar\\\\Functional\\\\ToolbarCacheContextsTest\\:\\:assertCacheContext\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php', @@ -47669,18 +46871,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_toolbar\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/toolbar/toolbar.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function toolbar_preprocess_html\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/toolbar/toolbar.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\update\\\\Controller\\\\UpdateController\\:\\:updateStatusManually\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/update/src/Controller/UpdateController.php', @@ -48149,12 +47339,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_update_last_check\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/update/update.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function update_clear_update_disk_cache\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/update/update.module', @@ -48197,24 +47381,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_update_project_status\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/update/update.report.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_update_report\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/update/update.report.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_update_version\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/update/update.report.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\user\\\\AccountForm\\:\\:create\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/user/src/AccountForm.php', @@ -49811,18 +48977,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_user\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/user/user.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_username\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/user/user.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function user_cancel\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/user/user.module', @@ -49877,12 +49031,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function user_preprocess_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/user/user.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function user_role_change_permissions\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/user/user.module', @@ -56969,18 +56117,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view_mapping_test\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/tests/modules/views_test_data/views_test_data.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function views_test_data_preprocess_views_view_table\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/tests/modules/views_test_data/views_test_data.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\views_test_entity_reference\\\\Hook\\\\ViewsTestEntityReferenceHooks\\:\\:viewsDataAlter\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/views/tests/modules/views_test_entity_reference/src/Hook/ViewsTestEntityReferenceHooks.php', @@ -57011,12 +56147,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function views_test_rss_preprocess_views_view_rss\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/tests/modules/views_test_rss/views_test_rss.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\Tests\\\\views\\\\Functional\\\\DefaultViewsTest\\:\\:addDefaultCommentField\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/views/tests/src/Functional/DefaultViewsTest.php', @@ -58271,120 +57401,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function views_preprocess_comment\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function views_preprocess_node\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_exposed_form\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_mini_pager\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view_field\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view_fields\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view_grid\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view_grid_responsive\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view_grouping\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view_list\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view_opml\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view_row_opml\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view_row_rss\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view_rss\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view_summary\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view_summary_unformatted\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view_table\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_view_unformatted\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function views_entity_field_label\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/views/views.views.inc', @@ -59129,12 +58145,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function views_ui_preprocess_views_view\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views_ui/views_ui.module', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function views_ui_theme_suggestions_views_ui_view_preview_section\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/views_ui/views_ui.module', @@ -59159,48 +58169,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_ui_build_group_filter_form\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views_ui/views_ui.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_ui_display_tab_bucket\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views_ui/views_ui.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_ui_display_tab_setting\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views_ui/views_ui.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_ui_rearrange_filter_form\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views_ui/views_ui.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_ui_style_plugin_table\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views_ui/views_ui.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_ui_view_preview_section\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views_ui/views_ui.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function template_preprocess_views_ui_views_listing_table\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views_ui/views_ui.theme.inc', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Method Drupal\\\\workflows\\\\Entity\\\\Workflow\\:\\:preSave\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/modules/workflows/src/Entity/Workflow.php', @@ -61337,66 +60305,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function umami_preprocess_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/profiles/demo_umami/themes/umami/umami.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function umami_preprocess_block__bundle__banner_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/profiles/demo_umami/themes/umami/umami.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function umami_preprocess_block__bundle__footer_promo_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/profiles/demo_umami/themes/umami/umami.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function umami_preprocess_breadcrumb\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/profiles/demo_umami/themes/umami/umami.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function umami_preprocess_field\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/profiles/demo_umami/themes/umami/umami.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function umami_preprocess_html\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/profiles/demo_umami/themes/umami/umami.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function umami_preprocess_image_widget\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/profiles/demo_umami/themes/umami/umami.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function umami_preprocess_links\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/profiles/demo_umami/themes/umami/umami.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function umami_preprocess_links__media_library_menu\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/profiles/demo_umami/themes/umami/umami.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function umami_preprocess_menu_local_task\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/profiles/demo_umami/themes/umami/umami.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function umami_theme_suggestions_block_alter\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/profiles/demo_umami/themes/umami/umami.theme', @@ -68326,12 +67234,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function test_stable_preprocess_theme_test_render_element\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/tests/fixtures/test_stable/test_stable.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function _claro_preprocess_file_and_image_widget\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/themes/claro/claro.theme', @@ -68350,264 +67252,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function claro_preprocess_admin_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_admin_block_content\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_block_content_add_list\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_datetime_wrapper\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_details\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_entity_add_list\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_field_multiple_value_form\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_field_ui_table\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_fieldset\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_fieldset__media_library_widget\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_file_managed_file\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_file_widget_multiple\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_filter_tips\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_form_element\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_form_element__password\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_form_element__password_confirm\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_image_widget\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_input\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_install_page\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_item_list__media_library_add_form_media_list\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_links\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_links__action_links\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_links__dropbutton\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_links__media_library_menu\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_maintenance_page\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_media_library_item__small\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_media_library_item__widget\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_menu_local_action\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_menu_local_task\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_menu_local_task__views_ui\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_menu_local_tasks\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_node_add_list\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_select\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_status_messages\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_system_themes_page\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_table\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_text_format_wrapper\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_toolbar\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_views_exposed_form\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_views_ui_display_tab_bucket\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_views_view_fields__media_library\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function claro_preprocess_views_view_table\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/claro/claro.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function claro_system_module_invoked_library_info_alter\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/themes/claro/claro.theme', @@ -68704,168 +67348,6 @@ $ignoreErrors[] = [ ]; $ignoreErrors[] = [ // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_block\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_checkboxes\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_comment\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_field\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_field__comment\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_field__node__created\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_field_multiple_value_form\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_fieldset\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_filter_caption\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_form_element\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_form_element_label\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_html\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_input\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_item_list__search_results\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_links__comment\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_maintenance_page\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_menu\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_menu_local_task\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_menu_local_tasks\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_node\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_page_title\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_radios\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_search_result\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_select\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_table\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_text_format_wrapper\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function olivero_preprocess_textarea\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/olivero/olivero.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return 'message' => '#^Function olivero_theme_suggestions_block_alter\\(\\) has no return type specified\\.$#', 'count' => 1, 'path' => __DIR__ . '/themes/olivero/olivero.theme', @@ -68894,23 +67376,5 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/themes/olivero/src/OliveroPreRender.php', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function stable9_preprocess_item_list__search_results\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/stable9/stable9.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function stable9_preprocess_views_view\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/stable9/stable9.theme', -]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function starterkit_theme_preprocess_image_widget\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/starterkit_theme/starterkit_theme.theme', -]; return ['parameters' => ['ignoreErrors' => $ignoreErrors]]; diff --git a/core/includes/form.inc b/core/includes/form.inc index 98b6783ec1f8..f209702b6735 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -30,7 +30,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse; * #multiple, #required, #name, #attributes, #size, #sort_options, * #sort_start. */ -function template_preprocess_select(&$variables) { +function template_preprocess_select(&$variables): void { $element = $variables['element']; Element::setAttributes($element, ['id', 'name', 'size']); RenderElementBase::setAttributes($element, ['form-select']); @@ -191,7 +191,7 @@ function form_get_options($element, $key) { * Properties used: #attributes, #children, #description, #id, #title, * #value. */ -function template_preprocess_fieldset(&$variables) { +function template_preprocess_fieldset(&$variables): void { $element = $variables['element']; Element::setAttributes($element, ['id']); RenderElementBase::setAttributes($element); @@ -245,7 +245,7 @@ function template_preprocess_fieldset(&$variables) { * Properties used: #attributes, #children, #description, #required, * #summary_attributes, #title, #value. */ -function template_preprocess_details(&$variables) { +function template_preprocess_details(&$variables): void { $element = $variables['element']; $variables['attributes'] = $element['#attributes']; $variables['summary_attributes'] = new Attribute($element['#summary_attributes']); @@ -282,7 +282,7 @@ function template_preprocess_details(&$variables) { * Properties used: #title, #value, #options, #description, #required, * #attributes, #children. */ -function template_preprocess_radios(&$variables) { +function template_preprocess_radios(&$variables): void { $element = $variables['element']; $variables['attributes'] = []; if (isset($element['#id'])) { @@ -304,7 +304,7 @@ function template_preprocess_radios(&$variables) { * - element: An associative array containing the properties of the element. * Properties used: #children, #attributes. */ -function template_preprocess_checkboxes(&$variables) { +function template_preprocess_checkboxes(&$variables): void { $element = $variables['element']; $variables['attributes'] = []; if (isset($element['#id'])) { @@ -326,7 +326,7 @@ function template_preprocess_checkboxes(&$variables) { * - element: An associative array containing the properties and children of * the details element. Properties used: #children. */ -function template_preprocess_vertical_tabs(&$variables) { +function template_preprocess_vertical_tabs(&$variables): void { $element = $variables['element']; $variables['children'] = (!empty($element['#children'])) ? $element['#children'] : ''; } @@ -341,7 +341,7 @@ function template_preprocess_vertical_tabs(&$variables) { * - element: An associative array containing the properties of the element. * Properties used: #attributes. */ -function template_preprocess_input(&$variables) { +function template_preprocess_input(&$variables): void { $element = $variables['element']; // Remove name attribute if empty, for W3C compliance. if (isset($variables['attributes']['name']) && empty((string) $variables['attributes']['name'])) { @@ -360,7 +360,7 @@ function template_preprocess_input(&$variables) { * - element: An associative array containing the properties of the element. * Properties used: #action, #method, #attributes, #children */ -function template_preprocess_form(&$variables) { +function template_preprocess_form(&$variables): void { $element = $variables['element']; if (isset($element['#action'])) { $element['#attributes']['action'] = UrlHelper::stripDangerousProtocols($element['#action']); @@ -384,7 +384,7 @@ function template_preprocess_form(&$variables) { * Properties used: #title, #value, #description, #rows, #cols, #maxlength, * #placeholder, #required, #attributes, #resizable. */ -function template_preprocess_textarea(&$variables) { +function template_preprocess_textarea(&$variables): void { $element = $variables['element']; $attributes = ['id', 'name', 'rows', 'cols', 'maxlength', 'placeholder']; Element::setAttributes($element, $attributes); @@ -439,7 +439,7 @@ function template_preprocess_textarea(&$variables) { * Properties used: #title, #title_display, #description, #id, #required, * #children, #type, #name, #label_for. */ -function template_preprocess_form_element(&$variables) { +function template_preprocess_form_element(&$variables): void { $element = &$variables['element']; // This function is invoked as theme wrapper, but the rendered form element @@ -532,7 +532,7 @@ function template_preprocess_form_element(&$variables) { * - element: An associative array containing the properties of the element. * Properties used: #required, #title, #id, #value, #description, #for. */ -function template_preprocess_form_element_label(&$variables) { +function template_preprocess_form_element_label(&$variables): void { $element = $variables['element']; // If title and required marker are both empty, output no label. if (isset($element['#title']) && $element['#title'] !== '') { diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 9fb42d56c014..5858525ab41c 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -333,7 +333,7 @@ function theme_settings_convert_to_config(array $theme_settings, Config $config) * - timestamp: * - text: */ -function template_preprocess_time(&$variables) { +function template_preprocess_time(&$variables): void { /** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */ $date_formatter = \Drupal::service('date.formatter'); // Format the 'datetime' attribute based on the timestamp. @@ -371,7 +371,7 @@ function template_preprocess_time(&$variables) { * * @see form_process_datetime() */ -function template_preprocess_datetime_form(&$variables) { +function template_preprocess_datetime_form(&$variables): void { $element = $variables['element']; $variables['attributes'] = []; @@ -397,7 +397,7 @@ function template_preprocess_datetime_form(&$variables) { * - element: An associative array containing the properties of the element. * Properties used: #title, #children, #required, #attributes. */ -function template_preprocess_datetime_wrapper(&$variables) { +function template_preprocess_datetime_wrapper(&$variables): void { $element = $variables['element']; if (!empty($element['#title'])) { @@ -490,7 +490,7 @@ function template_preprocess_datetime_wrapper(&$variables) { * @see \Drupal\Core\Utility\LinkGenerator::generate() * @see system_page_attachments() */ -function template_preprocess_links(&$variables) { +function template_preprocess_links(&$variables): void { $links = $variables['links']; $heading = &$variables['heading']; @@ -621,7 +621,7 @@ function template_preprocess_links(&$variables) { * - sizes: The sizes attribute for viewport-based selection of images. * - http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content.html#introduction-3:viewport-based-selection-2 */ -function template_preprocess_image(&$variables) { +function template_preprocess_image(&$variables): void { /** @var \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator */ $file_url_generator = \Drupal::service('file_url_generator'); @@ -757,7 +757,7 @@ function template_preprocess_image(&$variables) { * - empty: The message to display in an extra row if table does not have any * rows. */ -function template_preprocess_table(&$variables) { +function template_preprocess_table(&$variables): void { // Format the table columns: if (!empty($variables['colgroups'])) { foreach ($variables['colgroups'] as &$colgroup) { @@ -938,7 +938,7 @@ function template_preprocess_table(&$variables) { * * @see https://www.drupal.org/node/1842756 */ -function template_preprocess_item_list(&$variables) { +function template_preprocess_item_list(&$variables): void { $variables['wrapper_attributes'] = new Attribute($variables['wrapper_attributes']); foreach ($variables['items'] as &$item) { $attributes = []; @@ -997,7 +997,7 @@ function template_preprocess_item_list(&$variables) { * - element: An associative array containing the properties of the element. * Properties used: #id, #attributes, #children. */ -function template_preprocess_container(&$variables) { +function template_preprocess_container(&$variables): void { $variables['has_parent'] = FALSE; $element = $variables['element']; // Ensure #attributes is set. @@ -1028,7 +1028,7 @@ function template_preprocess_container(&$variables) { * dangerous HTML such as <script> tags. * - active: The key for the currently active maintenance task. */ -function template_preprocess_maintenance_task_list(&$variables) { +function template_preprocess_maintenance_task_list(&$variables): void { $items = $variables['items']; $active = $variables['active']; @@ -1118,7 +1118,7 @@ function _template_preprocess_default_variables() { * An associative array containing: * - page: A render element representing the page. */ -function template_preprocess_html(&$variables) { +function template_preprocess_html(&$variables): void { $variables['page'] = $variables['html']['page']; unset($variables['html']['page']); $variables['page_top'] = NULL; @@ -1208,7 +1208,7 @@ function template_preprocess_html(&$variables) { * * See the page.html.twig template for the list of variables. */ -function template_preprocess_page(&$variables) { +function template_preprocess_page(&$variables): void { $language_interface = \Drupal::languageManager()->getCurrentLanguage(); foreach (\Drupal::theme()->getActiveTheme()->getRegions() as $region) { @@ -1318,7 +1318,7 @@ function theme_get_suggestions($args, $base, $delimiter = '__') { * * @see system_page_attachments() */ -function template_preprocess_maintenance_page(&$variables) { +function template_preprocess_maintenance_page(&$variables): void { // @todo Rename the templates to page--maintenance + page--install. template_preprocess_page($variables); @@ -1348,7 +1348,7 @@ function template_preprocess_maintenance_page(&$variables) { * * @see template_preprocess_maintenance_page() */ -function template_preprocess_install_page(&$variables) { +function template_preprocess_install_page(&$variables): void { $installer_active_task = NULL; if (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE === 'install' && InstallerKernel::installationAttempted()) { $installer_active_task = $GLOBALS['install_state']['active_task']; @@ -1376,7 +1376,7 @@ function template_preprocess_install_page(&$variables) { * An associative array containing: * - elements: An associative array containing properties of the region. */ -function template_preprocess_region(&$variables) { +function template_preprocess_region(&$variables): void { // Create the $content variable that templates expect. $variables['content'] = $variables['elements']['#children']; $variables['region'] = $variables['elements']['#region']; @@ -1393,7 +1393,7 @@ function template_preprocess_region(&$variables) { * - attributes: A string containing the attributes for the wrapping div. * - title_attributes: A string containing the attributes for the title. */ -function template_preprocess_field(&$variables, $hook) { +function template_preprocess_field(&$variables, $hook): void { $element = $variables['element']; // Creating variables for the template. @@ -1454,7 +1454,7 @@ function template_preprocess_field(&$variables, $hook) { * An associative array containing: * - element: A render element representing the form element. */ -function template_preprocess_field_multiple_value_form(&$variables) { +function template_preprocess_field_multiple_value_form(&$variables): void { $element = $variables['element']; $variables['multiple'] = $element['#cardinality_multiple']; $variables['attributes'] = $element['#attributes']; @@ -1569,7 +1569,7 @@ function template_preprocess_field_multiple_value_form(&$variables) { * An associative array containing: * - links: A list of \Drupal\Core\Link objects which should be rendered. */ -function template_preprocess_breadcrumb(&$variables) { +function template_preprocess_breadcrumb(&$variables): void { $variables['breadcrumb'] = []; /** @var \Drupal\Core\Link $link */ foreach ($variables['links'] as $key => $link) { @@ -1598,7 +1598,7 @@ function template_preprocess_breadcrumb(&$variables) { * - #route_parameters: An associative array of the route parameters. * - #quantity: The number of pages in the list. */ -function template_preprocess_pager(&$variables) { +function template_preprocess_pager(&$variables): void { $element = $variables['pager']['#element']; $parameters = $variables['pager']['#parameters']; $quantity = empty($variables['pager']['#quantity']) ? 0 : $variables['pager']['#quantity']; @@ -1742,7 +1742,7 @@ function template_preprocess_pager(&$variables) { * 'localized_options' keys. * - #active: A boolean indicating whether the local task is active. */ -function template_preprocess_menu_local_task(&$variables) { +function template_preprocess_menu_local_task(&$variables): void { $link = $variables['element']['#link']; $link += [ 'localized_options' => [], @@ -1774,7 +1774,7 @@ function template_preprocess_menu_local_task(&$variables) { * - #link: A menu link array with 'title', 'url', and (optionally) * 'localized_options' keys. */ -function template_preprocess_menu_local_action(&$variables) { +function template_preprocess_menu_local_action(&$variables): void { $link = $variables['element']['#link']; $link += [ 'localized_options' => [], diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc index 9138f742fd58..dab448749dd9 100644 --- a/core/includes/theme.maintenance.inc +++ b/core/includes/theme.maintenance.inc @@ -108,7 +108,7 @@ function _drupal_maintenance_theme() { * An associative array containing: * - messages: An array of result messages. */ -function template_preprocess_authorize_report(&$variables) { +function template_preprocess_authorize_report(&$variables): void { $messages = []; if (!empty($variables['messages'])) { foreach ($variables['messages'] as $heading => $logs) { diff --git a/core/lib/Drupal/Core/Render/theme.api.php b/core/lib/Drupal/Core/Render/theme.api.php index 3a9354c75490..274e92ba5b53 100644 --- a/core/lib/Drupal/Core/Render/theme.api.php +++ b/core/lib/Drupal/Core/Render/theme.api.php @@ -602,7 +602,7 @@ function hook_preprocess(&$variables, $hook) { * @param $variables * The variables array (modify in place). */ -function hook_preprocess_HOOK(&$variables) { +function hook_preprocess_HOOK(&$variables): void { // This example is from node_preprocess_html(). It adds the node type to // the body classes, when on an individual node page or node preview page. if (($node = \Drupal::routeMatch()->getParameter('node')) || ($node = \Drupal::routeMatch()->getParameter('node_preview'))) { diff --git a/core/modules/block/block.module b/core/modules/block/block.module index de17aed9fb99..07961ed4c0cc 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -120,7 +120,7 @@ function block_theme_suggestions_block(array $variables) { * - elements: An associative array containing the properties of the element. * Properties used: #block, #configuration, #children, #plugin_id. */ -function template_preprocess_block(&$variables) { +function template_preprocess_block(&$variables): void { $variables['configuration'] = $variables['elements']['#configuration']; $variables['plugin_id'] = $variables['elements']['#plugin_id']; $variables['base_plugin_id'] = $variables['elements']['#base_plugin_id']; diff --git a/core/modules/block_content/block_content.pages.inc b/core/modules/block_content/block_content.pages.inc index b5124506590a..b73a8349b834 100644 --- a/core/modules/block_content/block_content.pages.inc +++ b/core/modules/block_content/block_content.pages.inc @@ -18,7 +18,7 @@ use Drupal\Core\Url; * * @see block_content_add_page() */ -function template_preprocess_block_content_add_list(&$variables) { +function template_preprocess_block_content_add_list(&$variables): void { $variables['types'] = []; $query = \Drupal::request()->query->all(); foreach ($variables['content'] as $type) { diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index fc3b898dfb33..47f024f3ce15 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -113,7 +113,7 @@ function comment_preview(CommentInterface $comment, FormStateInterface $form_sta /** * Implements hook_preprocess_HOOK() for block templates. */ -function comment_preprocess_block(&$variables) { +function comment_preprocess_block(&$variables): void { if ($variables['configuration']['provider'] == 'comment') { $variables['attributes']['role'] = 'navigation'; } @@ -138,7 +138,7 @@ function comment_preprocess_block(&$variables) { * - elements: An associative array containing the comment and entity objects. * Array keys: #comment, #commented_entity. */ -function template_preprocess_comment(&$variables) { +function template_preprocess_comment(&$variables): void { /** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */ $date_formatter = \Drupal::service('date.formatter'); /** @var \Drupal\comment\CommentInterface $comment */ @@ -278,7 +278,7 @@ function template_preprocess_comment(&$variables) { * @todo Rename to template_preprocess_field__comment() once * https://www.drupal.org/node/939462 is resolved. */ -function comment_preprocess_field(&$variables) { +function comment_preprocess_field(&$variables): void { $element = $variables['element']; if ($element['#field_type'] == 'comment') { // Provide contextual information. diff --git a/core/modules/comment/tests/modules/comment_empty_title_test/comment_empty_title_test.module b/core/modules/comment/tests/modules/comment_empty_title_test/comment_empty_title_test.module index 7c94e9def374..c107fd11466f 100644 --- a/core/modules/comment/tests/modules/comment_empty_title_test/comment_empty_title_test.module +++ b/core/modules/comment/tests/modules/comment_empty_title_test/comment_empty_title_test.module @@ -10,6 +10,6 @@ declare(strict_types=1); /** * Implements hook_preprocess_comment(). */ -function comment_empty_title_test_preprocess_comment(&$variables) { +function comment_empty_title_test_preprocess_comment(&$variables): void { $variables['title'] = ''; } diff --git a/core/modules/content_moderation/content_moderation.module b/core/modules/content_moderation/content_moderation.module index fc3ad6cf133b..fdd55eaec3b1 100644 --- a/core/modules/content_moderation/content_moderation.module +++ b/core/modules/content_moderation/content_moderation.module @@ -9,7 +9,7 @@ use Drupal\content_moderation\ContentPreprocess; /** * Implements hook_preprocess_HOOK(). */ -function content_moderation_preprocess_node(&$variables) { +function content_moderation_preprocess_node(&$variables): void { \Drupal::service('class_resolver') ->getInstanceFromDefinition(ContentPreprocess::class) ->preprocessNode($variables); diff --git a/core/modules/content_translation/content_translation.admin.inc b/core/modules/content_translation/content_translation.admin.inc index b12d94e05bf7..87b511c645b0 100644 --- a/core/modules/content_translation/content_translation.admin.inc +++ b/core/modules/content_translation/content_translation.admin.inc @@ -191,7 +191,7 @@ function _content_translation_is_field_translatability_configurable(EntityTypeIn /** * (proxied) Implements hook_preprocess_HOOK(). */ -function _content_translation_preprocess_language_content_settings_table(&$variables) { +function _content_translation_preprocess_language_content_settings_table(&$variables): void { // Alter the 'build' variable injecting the translation settings if the user // has the required permission. if (!\Drupal::currentUser()->hasPermission('administer content translation')) { diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index b78d838ef509..7b6388deca0b 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -185,7 +185,7 @@ function content_translation_language_configuration_element_submit(array $form, /** * Implements hook_preprocess_HOOK() for language-content-settings-table.html.twig. */ -function content_translation_preprocess_language_content_settings_table(&$variables) { +function content_translation_preprocess_language_content_settings_table(&$variables): void { \Drupal::moduleHandler()->loadInclude('content_translation', 'inc', 'content_translation.admin'); _content_translation_preprocess_language_content_settings_table($variables); } diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index 526468502516..8d0b85997113 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -17,14 +17,14 @@ use Drupal\field_ui\FieldUI; * - elements: An associative array containing a Form API structure to be * rendered as a table. */ -function template_preprocess_field_ui_table(&$variables) { +function template_preprocess_field_ui_table(&$variables): void { template_preprocess_table($variables); } /** * Implements hook_preprocess_HOOK(). */ -function field_ui_preprocess_form_element__new_storage_type(&$variables) { +function field_ui_preprocess_form_element__new_storage_type(&$variables): void { // Add support for a variant string so radios in the add field form can be // programmatically distinguished. $variables['variant'] = $variables['element']['#variant'] ?? NULL; diff --git a/core/modules/file/file.module b/core/modules/file/file.module index 9ade447d83eb..724be28393c5 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -402,7 +402,7 @@ function file_managed_file_save_upload($element, FormStateInterface $form_state) * An associative array containing: * - element: A render element representing the file. */ -function template_preprocess_file_managed_file(&$variables) { +function template_preprocess_file_managed_file(&$variables): void { $element = $variables['element']; $variables['attributes'] = []; @@ -427,7 +427,7 @@ function template_preprocess_file_managed_file(&$variables) { * - description: A description to be displayed instead of the filename. * - attributes: An associative array of attributes to be placed in the a tag. */ -function template_preprocess_file_link(&$variables) { +function template_preprocess_file_link(&$variables): void { $file = $variables['file']; $options = []; @@ -473,7 +473,7 @@ function template_preprocess_file_link(&$variables) { * An associative array containing: * - element: A render element representing the widgets. */ -function template_preprocess_file_widget_multiple(&$variables) { +function template_preprocess_file_widget_multiple(&$variables): void { $element = $variables['element']; // Special ID and classes for draggable tables. $weight_class = $element['#id'] . '-weight'; @@ -589,7 +589,7 @@ function template_preprocess_file_widget_multiple(&$variables) { * - upload_validators: An array of upload validators as used in * $element['#upload_validators']. */ -function template_preprocess_file_upload_help(&$variables) { +function template_preprocess_file_upload_help(&$variables): void { $description = $variables['description']; $upload_validators = $variables['upload_validators']; $cardinality = $variables['cardinality']; diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index 54f959acfc77..ecf074000367 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -294,7 +294,7 @@ function _filter_tips($format_id, $long = FALSE) { * An associative array containing: * - format: An object representing a text format. */ -function template_preprocess_filter_guidelines(&$variables) { +function template_preprocess_filter_guidelines(&$variables): void { $format = $variables['format']; $variables['tips'] = [ '#theme' => 'filter_tips', @@ -314,7 +314,7 @@ function template_preprocess_filter_guidelines(&$variables) { * An associative array containing: * - attributes: An associative array containing properties of the element. */ -function template_preprocess_text_format_wrapper(&$variables) { +function template_preprocess_text_format_wrapper(&$variables): void { $variables['aria_description'] = FALSE; // Add element class and id for screen readers. if (isset($variables['attributes']['aria-describedby'])) { @@ -350,7 +350,7 @@ function template_preprocess_text_format_wrapper(&$variables) { * (TRUE), or are in a short format, i.e. suitable to be displayed below a * form element. Defaults to FALSE. */ -function template_preprocess_filter_tips(&$variables) { +function template_preprocess_filter_tips(&$variables): void { $tips = $variables['tips']; foreach ($variables['tips'] as $name => $tip_list) { diff --git a/core/modules/help/help.module b/core/modules/help/help.module index 91edfa9aabc9..69ab53e14369 100644 --- a/core/modules/help/help.module +++ b/core/modules/help/help.module @@ -7,7 +7,7 @@ /** * Implements hook_preprocess_HOOK() for block templates. */ -function help_preprocess_block(&$variables) { +function help_preprocess_block(&$variables): void { if ($variables['plugin_id'] == 'help_block') { $variables['attributes']['role'] = 'complementary'; } diff --git a/core/modules/image/image.admin.inc b/core/modules/image/image.admin.inc index e515fd64cee5..1b468c913751 100644 --- a/core/modules/image/image.admin.inc +++ b/core/modules/image/image.admin.inc @@ -15,7 +15,7 @@ use Drupal\Core\Render\Element; * An associative array containing: * - style: \Drupal\image\ImageStyleInterface image style being previewed. */ -function template_preprocess_image_style_preview(&$variables) { +function template_preprocess_image_style_preview(&$variables): void { /** @var \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator */ $file_url_generator = \Drupal::service('file_url_generator'); @@ -120,7 +120,7 @@ function template_preprocess_image_style_preview(&$variables) { * An associative array containing: * - element: An associative array containing the image. */ -function template_preprocess_image_anchor(&$variables) { +function template_preprocess_image_anchor(&$variables): void { $element = $variables['element']; $rows = []; diff --git a/core/modules/image/image.field.inc b/core/modules/image/image.field.inc index 9c1883d5044a..891d79ada7bb 100644 --- a/core/modules/image/image.field.inc +++ b/core/modules/image/image.field.inc @@ -15,7 +15,7 @@ use Drupal\Core\Render\Element; * An associative array containing: * - element: A render element representing the image field widget. */ -function template_preprocess_image_widget(&$variables) { +function template_preprocess_image_widget(&$variables): void { $element = $variables['element']; $variables['attributes'] = ['class' => ['image-widget', 'js-form-managed-file', 'form-managed-file', 'clearfix']]; @@ -40,7 +40,7 @@ function template_preprocess_image_widget(&$variables) { * - image_style: An optional image style. * - url: An optional \Drupal\Core\Url object. */ -function template_preprocess_image_formatter(&$variables) { +function template_preprocess_image_formatter(&$variables): void { if ($variables['image_style']) { $variables['image'] = [ '#theme' => 'image_style', diff --git a/core/modules/image/image.module b/core/modules/image/image.module index 52d946250718..8f3e0542e96a 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -75,7 +75,7 @@ function image_style_options($include_empty = TRUE) { * - attributes: Associative array of additional attributes to be placed in * the img tag. */ -function template_preprocess_image_style(&$variables) { +function template_preprocess_image_style(&$variables): void { $style = ImageStyle::load($variables['style_name']); // Determine the dimensions of the styled image. diff --git a/core/modules/inline_form_errors/inline_form_errors.module b/core/modules/inline_form_errors/inline_form_errors.module index 4d2f12be9ede..09fc4d7e2446 100644 --- a/core/modules/inline_form_errors/inline_form_errors.module +++ b/core/modules/inline_form_errors/inline_form_errors.module @@ -7,28 +7,28 @@ /** * Implements hook_preprocess_HOOK() for form element templates. */ -function inline_form_errors_preprocess_form_element(&$variables) { +function inline_form_errors_preprocess_form_element(&$variables): void { _inline_form_errors_set_errors($variables); } /** * Implements hook_preprocess_HOOK() for details element templates. */ -function inline_form_errors_preprocess_details(&$variables) { +function inline_form_errors_preprocess_details(&$variables): void { _inline_form_errors_set_errors($variables); } /** * Implements hook_preprocess_HOOK() for fieldset element templates. */ -function inline_form_errors_preprocess_fieldset(&$variables) { +function inline_form_errors_preprocess_fieldset(&$variables): void { _inline_form_errors_set_errors($variables); } /** * Implements hook_preprocess_HOOK() for datetime form wrapper templates. */ -function inline_form_errors_preprocess_datetime_wrapper(&$variables) { +function inline_form_errors_preprocess_datetime_wrapper(&$variables): void { _inline_form_errors_set_errors($variables); } diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc index 82c07c4bf21e..56719e4c62ae 100644 --- a/core/modules/language/language.admin.inc +++ b/core/modules/language/language.admin.inc @@ -16,7 +16,7 @@ use Drupal\Core\Template\Attribute; * An associative array containing: * - form: A render element representing the form. */ -function template_preprocess_language_negotiation_configure_form(&$variables) { +function template_preprocess_language_negotiation_configure_form(&$variables): void { $form =& $variables['form']; $variables['language_types'] = []; @@ -102,7 +102,7 @@ function template_preprocess_language_negotiation_configure_form(&$variables) { * - element: An associative array containing the properties of the element. * Properties used: #bundle_label, #title. */ -function template_preprocess_language_content_settings_table(&$variables) { +function template_preprocess_language_content_settings_table(&$variables): void { // Add a render element representing the bundle language settings table. $element = $variables['element']; diff --git a/core/modules/language/language.module b/core/modules/language/language.module index 42a72f6e4e87..dba38c258990 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -129,7 +129,7 @@ function language_negotiation_url_prefixes_update() { /** * Implements hook_preprocess_HOOK() for block templates. */ -function language_preprocess_block(&$variables) { +function language_preprocess_block(&$variables): void { if ($variables['configuration']['provider'] == 'language') { $variables['attributes']['role'] = 'navigation'; } diff --git a/core/modules/layout_builder/layout_builder.module b/core/modules/layout_builder/layout_builder.module index ddc5ab8fb34e..c79b92db26d9 100644 --- a/core/modules/layout_builder/layout_builder.module +++ b/core/modules/layout_builder/layout_builder.module @@ -23,7 +23,7 @@ function layout_builder_module_implements_alter(&$implementations, $hook) { /** * Implements hook_preprocess_HOOK() for language-content-settings-table.html.twig. */ -function layout_builder_preprocess_language_content_settings_table(&$variables) { +function layout_builder_preprocess_language_content_settings_table(&$variables): void { foreach ($variables['build']['#rows'] as &$row) { if (isset($row['#field_name']) && $row['#field_name'] === OverridesSectionStorage::FIELD_NAME) { // Rebuild the label to include a warning about using translations with diff --git a/core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.module b/core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.module index a48a553a2871..6a876a7a16f8 100644 --- a/core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.module +++ b/core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.module @@ -29,7 +29,7 @@ function layout_builder_test_node_view(array &$build, EntityInterface $entity, E /** * Implements hook_preprocess_HOOK() for one-column layout template. */ -function layout_builder_test_preprocess_layout__onecol(&$vars) { +function layout_builder_test_preprocess_layout__onecol(&$vars): void { if (!empty($vars['content']['#entity'])) { $vars['content']['content'][\Drupal::service('uuid')->generate()] = [ '#type' => 'markup', @@ -41,7 +41,7 @@ function layout_builder_test_preprocess_layout__onecol(&$vars) { /** * Implements hook_preprocess_HOOK() for two-column layout template. */ -function layout_builder_test_preprocess_layout__twocol_section(&$vars) { +function layout_builder_test_preprocess_layout__twocol_section(&$vars): void { if (!empty($vars['content']['#entity'])) { $vars['content']['first'][\Drupal::service('uuid')->generate()] = [ '#type' => 'markup', diff --git a/core/modules/layout_builder/tests/modules/layout_builder_theme_suggestions_test/layout_builder_theme_suggestions_test.module b/core/modules/layout_builder/tests/modules/layout_builder_theme_suggestions_test/layout_builder_theme_suggestions_test.module index 80708a9cc8d3..5632c3fb8a9e 100644 --- a/core/modules/layout_builder/tests/modules/layout_builder_theme_suggestions_test/layout_builder_theme_suggestions_test.module +++ b/core/modules/layout_builder/tests/modules/layout_builder_theme_suggestions_test/layout_builder_theme_suggestions_test.module @@ -10,7 +10,7 @@ declare(strict_types=1); /** * Implements hook_preprocess_HOOK() for the list of layouts. */ -function layout_builder_theme_suggestions_test_preprocess_item_list__layouts(&$variables) { +function layout_builder_theme_suggestions_test_preprocess_item_list__layouts(&$variables): void { foreach (array_keys($variables['items']) as $layout_id) { if (isset($variables['items'][$layout_id]['value']['#title']['icon'])) { $variables['items'][$layout_id]['value']['#title']['icon'] = ['#markup' => __FUNCTION__]; diff --git a/core/modules/layout_discovery/layout_discovery.module b/core/modules/layout_discovery/layout_discovery.module index 5db696c7c4a8..bbe55b73d359 100644 --- a/core/modules/layout_discovery/layout_discovery.module +++ b/core/modules/layout_discovery/layout_discovery.module @@ -15,7 +15,7 @@ use Drupal\Core\Template\Attribute; * - content: An associative array containing the properties of the element. * Properties used: #settings, #layout, #in_preview. */ -function template_preprocess_layout(&$variables) { +function template_preprocess_layout(&$variables): void { $variables['settings'] = $variables['content']['#settings'] ?? []; $variables['layout'] = $variables['content']['#layout'] ?? []; $variables['in_preview'] = $variables['content']['#in_preview'] ?? FALSE; diff --git a/core/modules/link/link.module b/core/modules/link/link.module index bf08aecb40b3..656f42d4f9e1 100644 --- a/core/modules/link/link.module +++ b/core/modules/link/link.module @@ -20,6 +20,6 @@ use Drupal\Core\Link; * - url_title: The anchor text for the link. * - url: A \Drupal\Core\Url object. */ -function template_preprocess_link_formatter_link_separate(&$variables) { +function template_preprocess_link_formatter_link_separate(&$variables): void { $variables['link'] = Link::fromTextAndUrl($variables['url_title'], $variables['url'])->toString(); } diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index b34432847c54..56083f16dc57 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -439,7 +439,7 @@ function locale_system_file_system_settings_submit(&$form, FormStateInterface $f /** * Implements hook_preprocess_HOOK() for node templates. */ -function locale_preprocess_node(&$variables) { +function locale_preprocess_node(&$variables): void { /** @var \Drupal\node\NodeInterface $node */ $node = $variables['node']; if ($node->language()->getId() != LanguageInterface::LANGCODE_NOT_SPECIFIED) { diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc index c5ac2e5ec3d7..ca6fc45836c0 100644 --- a/core/modules/locale/locale.pages.inc +++ b/core/modules/locale/locale.pages.inc @@ -21,7 +21,7 @@ use Drupal\Core\Url; * * @see \Drupal\locale\Form\TranslationStatusForm */ -function template_preprocess_locale_translation_update_info(array &$variables) { +function template_preprocess_locale_translation_update_info(array &$variables): void { foreach ($variables['updates'] as $update) { $variables['modules'][] = $update['name']; } @@ -43,7 +43,7 @@ function template_preprocess_locale_translation_update_info(array &$variables) { * * @see \Drupal\locale\Form\TranslationStatusForm */ -function template_preprocess_locale_translation_last_check(array &$variables) { +function template_preprocess_locale_translation_last_check(array &$variables): void { $last = $variables['last']; $variables['last_checked'] = ($last != NULL); $variables['time'] = $variables['last_checked'] ? \Drupal::service('date.formatter')->formatTimeDiffSince($last) : NULL; diff --git a/core/modules/media/media.module b/core/modules/media/media.module index d10dd8601955..b23be0e5f5c4 100644 --- a/core/modules/media/media.module +++ b/core/modules/media/media.module @@ -65,7 +65,7 @@ function media_theme_suggestions_media(array $variables) { * - name: The label for the media item. * - view_mode: View mode; e.g., 'full', 'teaser', etc. */ -function template_preprocess_media(array &$variables) { +function template_preprocess_media(array &$variables): void { $variables['media'] = $variables['elements']['#media']; $variables['view_mode'] = $variables['elements']['#view_mode']; $variables['name'] = $variables['media']->label(); @@ -79,7 +79,7 @@ function template_preprocess_media(array &$variables) { /** * Implements hook_preprocess_HOOK() for media reference widgets. */ -function media_preprocess_media_reference_help(&$variables) { +function media_preprocess_media_reference_help(&$variables): void { // Most of these attribute checks are copied from // template_preprocess_fieldset(). Our template extends // field-multiple-value-form.html.twig to provide our help text, but also diff --git a/core/modules/media/tests/modules/media_test_embed/media_test_embed.module b/core/modules/media/tests/modules/media_test_embed/media_test_embed.module index ec3eec8279b6..abb19d895090 100644 --- a/core/modules/media/tests/modules/media_test_embed/media_test_embed.module +++ b/core/modules/media/tests/modules/media_test_embed/media_test_embed.module @@ -10,6 +10,6 @@ declare(strict_types=1); /** * Implements hook_preprocess_HOOK(). */ -function media_test_embed_preprocess_media_embed_error(&$variables) { +function media_test_embed_preprocess_media_embed_error(&$variables): void { $variables['attributes']['class'][] = 'this-error-message-is-themeable'; } diff --git a/core/modules/media/tests/modules/media_test_oembed/media_test_oembed.module b/core/modules/media/tests/modules/media_test_oembed/media_test_oembed.module index 52b4be100c5c..910318dd8681 100644 --- a/core/modules/media/tests/modules/media_test_oembed/media_test_oembed.module +++ b/core/modules/media/tests/modules/media_test_oembed/media_test_oembed.module @@ -10,7 +10,7 @@ declare(strict_types=1); /** * Implements hook_preprocess_media_oembed_iframe(). */ -function media_test_oembed_preprocess_media_oembed_iframe(array &$variables) { +function media_test_oembed_preprocess_media_oembed_iframe(array &$variables): void { if ($variables['resource']->getProvider()->getName() === 'YouTube') { $variables['media'] = str_replace('?feature=oembed', '?feature=oembed&pasta=rigatoni', (string) $variables['media']); } diff --git a/core/modules/media_library/media_library.module b/core/modules/media_library/media_library.module index 14f1969507b8..0e12f0311178 100644 --- a/core/modules/media_library/media_library.module +++ b/core/modules/media_library/media_library.module @@ -23,7 +23,7 @@ use Drupal\media\MediaTypeInterface; * - element: An associative array containing the properties of the element. * Properties used: #menu, #content. */ -function template_preprocess_media_library_wrapper(array &$variables) { +function template_preprocess_media_library_wrapper(array &$variables): void { $variables['menu'] = &$variables['element']['menu']; $variables['content'] = &$variables['element']['content']; } @@ -38,7 +38,7 @@ function template_preprocess_media_library_wrapper(array &$variables) { * - element: An associative array containing the properties and children of * the element. */ -function template_preprocess_media_library_item(array &$variables) { +function template_preprocess_media_library_item(array &$variables): void { $element = &$variables['element']; foreach (Element::children($element) as $key) { $variables['content'][$key] = $element[$key]; @@ -48,7 +48,7 @@ function template_preprocess_media_library_item(array &$variables) { /** * Implements hook_preprocess_media(). */ -function media_library_preprocess_media(&$variables) { +function media_library_preprocess_media(&$variables): void { if ($variables['view_mode'] === 'media_library') { /** @var \Drupal\media\MediaInterface $media */ $media = $variables['media']; @@ -68,14 +68,14 @@ function media_library_preprocess_media(&$variables) { /** * Implements hook_preprocess_views_view() for the 'media_library' view. */ -function media_library_preprocess_views_view__media_library(array &$variables) { +function media_library_preprocess_views_view__media_library(array &$variables): void { $variables['attributes']['data-view-display-id'] = $variables['view']->current_display; } /** * Implements hook_preprocess_views_view_fields(). */ -function media_library_preprocess_views_view_fields(&$variables) { +function media_library_preprocess_views_view_fields(&$variables): void { // Add classes to media rendered entity field so it can be targeted for // JavaScript mouseover and click events. if ($variables['view']->id() === 'media_library' && isset($variables['fields']['rendered_entity'])) { diff --git a/core/modules/menu_ui/menu_ui.module b/core/modules/menu_ui/menu_ui.module index eadff2cb0594..39fcdd4f468e 100644 --- a/core/modules/menu_ui/menu_ui.module +++ b/core/modules/menu_ui/menu_ui.module @@ -204,7 +204,7 @@ function menu_ui_form_node_type_form_builder($entity_type, NodeTypeInterface $ty /** * Implements hook_preprocess_HOOK() for block templates. */ -function menu_ui_preprocess_block(&$variables) { +function menu_ui_preprocess_block(&$variables): void { if ($variables['configuration']['provider'] == 'menu_ui') { $variables['attributes']['role'] = 'navigation'; } diff --git a/core/modules/navigation/tests/navigation_test/navigation_test.module b/core/modules/navigation/tests/navigation_test/navigation_test.module index b59e6ef738f4..3c7eb2fade87 100644 --- a/core/modules/navigation/tests/navigation_test/navigation_test.module +++ b/core/modules/navigation/tests/navigation_test/navigation_test.module @@ -12,7 +12,7 @@ use Drupal\Component\Utility\Html; /** * Implements hook_preprocess_HOOK(). */ -function navigation_test_preprocess_block__navigation(&$variables) { +function navigation_test_preprocess_block__navigation(&$variables): void { // Add some additional classes so we can target the correct contextual link // in tests. $variables['attributes']['class'][] = Html::cleanCssIdentifier('block-' . $variables['elements']['#plugin_id']); diff --git a/core/modules/node/node.module b/core/modules/node/node.module index e1516c529154..917aa8e47f05 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -210,7 +210,7 @@ function node_is_page(NodeInterface $node) { * * @see \Drupal\node\Controller\NodeController::addPage() */ -function template_preprocess_node_add_list(&$variables) { +function template_preprocess_node_add_list(&$variables): void { $variables['types'] = []; if (!empty($variables['content'])) { foreach ($variables['content'] as $type) { @@ -228,7 +228,7 @@ function template_preprocess_node_add_list(&$variables) { /** * Implements hook_preprocess_HOOK() for HTML document templates. */ -function node_preprocess_html(&$variables) { +function node_preprocess_html(&$variables): void { // If on an individual node page or node preview page, add the node type to // the body classes. if (($node = \Drupal::routeMatch()->getParameter('node')) || ($node = \Drupal::routeMatch()->getParameter('node_preview'))) { @@ -241,7 +241,7 @@ function node_preprocess_html(&$variables) { /** * Implements hook_preprocess_HOOK() for block templates. */ -function node_preprocess_block(&$variables) { +function node_preprocess_block(&$variables): void { if ($variables['configuration']['provider'] == 'node') { switch ($variables['elements']['#plugin_id']) { case 'node_syndicate_block': @@ -254,7 +254,7 @@ function node_preprocess_block(&$variables) { /** * Implements hook_preprocess_HOOK() for node field templates. */ -function node_preprocess_field__node(&$variables) { +function node_preprocess_field__node(&$variables): void { // Set a variable 'is_inline' in cases where inline markup is required, // without any block elements such as <div>. @@ -319,7 +319,7 @@ function node_theme_suggestions_node(array $variables) { * @see hook_entity_type_build() * @see \Drupal\Core\Field\BaseFieldDefinition::setDisplayConfigurable() */ -function template_preprocess_node(&$variables) { +function template_preprocess_node(&$variables): void { $variables['view_mode'] = $variables['elements']['#view_mode']; // The teaser variable is deprecated. diff --git a/core/modules/responsive_image/responsive_image.module b/core/modules/responsive_image/responsive_image.module index fd064c3d4410..00744ae91fbe 100644 --- a/core/modules/responsive_image/responsive_image.module +++ b/core/modules/responsive_image/responsive_image.module @@ -24,7 +24,7 @@ use Drupal\breakpoint\BreakpointInterface; * - responsive_image_style_id: A responsive image style. * - url: An optional \Drupal\Core\Url object. */ -function template_preprocess_responsive_image_formatter(&$variables) { +function template_preprocess_responsive_image_formatter(&$variables): void { // Provide fallback to standard image if valid responsive image style is not // provided in the responsive image formatter. $responsive_image_style = ResponsiveImageStyle::load($variables['responsive_image_style_id']); @@ -76,7 +76,7 @@ function template_preprocess_responsive_image_formatter(&$variables) { * - attributes: Associative array of attributes to be placed in the img tag. * - responsive_image_style_id: The ID of the responsive image style. */ -function template_preprocess_responsive_image(&$variables) { +function template_preprocess_responsive_image(&$variables): void { // Make sure that width and height are proper values // If they exists we'll output them // @see https://www.w3.org/community/respimg/2012/06/18/florians-compromise/ diff --git a/core/modules/search/search.module b/core/modules/search/search.module index 49a42bb54832..18bb92b77aa6 100644 --- a/core/modules/search/search.module +++ b/core/modules/search/search.module @@ -18,7 +18,7 @@ function search_theme_suggestions_search_result(array $variables) { /** * Implements hook_preprocess_HOOK() for block templates. */ -function search_preprocess_block(&$variables) { +function search_preprocess_block(&$variables): void { if ($variables['plugin_id'] == 'search_form_block') { $variables['attributes']['role'] = 'search'; } diff --git a/core/modules/search/search.pages.inc b/core/modules/search/search.pages.inc index afdb8fd635fa..cc29fdded2e9 100644 --- a/core/modules/search/search.pages.inc +++ b/core/modules/search/search.pages.inc @@ -23,7 +23,7 @@ use Drupal\Core\Language\LanguageInterface; * - title_attributes: HTML attributes for the title. * - content_attributes: HTML attributes for the content. */ -function template_preprocess_search_result(&$variables) { +function template_preprocess_search_result(&$variables): void { $language_interface = \Drupal::languageManager()->getCurrentLanguage(); $result = $variables['result']; diff --git a/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module b/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module index 45b741e20b07..d21af735ecad 100644 --- a/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module +++ b/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module @@ -14,7 +14,7 @@ declare(strict_types=1); /** * Adds the test form to search results. */ -function search_embedded_form_preprocess_search_result(&$variables) { +function search_embedded_form_preprocess_search_result(&$variables): void { $form = \Drupal::formBuilder()->getForm('Drupal\search_embedded_form\Form\SearchEmbeddedForm'); $variables['snippet'] = array_merge($variables['snippet'], $form); } diff --git a/core/modules/settings_tray/settings_tray.module b/core/modules/settings_tray/settings_tray.module index 409b18e0a389..a1a936d0339c 100644 --- a/core/modules/settings_tray/settings_tray.module +++ b/core/modules/settings_tray/settings_tray.module @@ -27,7 +27,7 @@ function _settings_tray_has_block_overrides(BlockInterface $block) { /** * Implements hook_preprocess_HOOK() for block templates. */ -function settings_tray_preprocess_block(&$variables) { +function settings_tray_preprocess_block(&$variables): void { // Only blocks that have a settings_tray form and have no configuration // overrides will have a "Quick Edit" link. We could wait for the contextual // links to be initialized on the client side, and then add the class and diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index 2b5ef4b8cf63..831e87b0fa7a 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -140,7 +140,7 @@ function shortcut_renderable_links($shortcut_set = NULL) { /** * Implements hook_preprocess_HOOK() for block templates. */ -function shortcut_preprocess_block(&$variables) { +function shortcut_preprocess_block(&$variables): void { if ($variables['configuration']['provider'] == 'shortcut') { $variables['attributes']['role'] = 'navigation'; } @@ -149,7 +149,7 @@ function shortcut_preprocess_block(&$variables) { /** * Implements hook_preprocess_HOOK() for page title templates. */ -function shortcut_preprocess_page_title(&$variables) { +function shortcut_preprocess_page_title(&$variables): void { // Only display the shortcut link if the user has the ability to edit // shortcuts, the feature is enabled for the current theme and if the page's // actual content is being shown (for example, we do not want to display it on diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index dc5961b2e254..b8b38fc7889b 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -25,7 +25,7 @@ use Drupal\Core\Url; * - description: Description of the administrative menu item. * - options: URL options. See \Drupal\Core\Url::fromUri() for details. */ -function template_preprocess_admin_block_content(&$variables) { +function template_preprocess_admin_block_content(&$variables): void { if (!empty($variables['content'])) { $variables['compact'] = system_admin_compact_mode(); foreach ($variables['content'] as $key => $item) { @@ -52,7 +52,7 @@ function template_preprocess_admin_block_content(&$variables) { * will control which container it will be in. This is usually 'left' or * 'right'. */ -function template_preprocess_admin_page(&$variables) { +function template_preprocess_admin_page(&$variables): void { $variables['system_compact_link'] = [ '#type' => 'system_compact_link', ]; @@ -81,7 +81,7 @@ function template_preprocess_admin_page(&$variables) { * An associative array containing: * - menu_items: An array of modules to be displayed. */ -function template_preprocess_system_admin_index(&$variables) { +function template_preprocess_system_admin_index(&$variables): void { $variables['system_compact_link'] = [ '#type' => 'system_compact_link', ]; @@ -131,7 +131,7 @@ function template_preprocess_system_admin_index(&$variables) { * * @see \Drupal\system\Form\ModulesListForm */ -function template_preprocess_system_modules_details(&$variables) { +function template_preprocess_system_modules_details(&$variables): void { $form = $variables['form']; // Identify modules that are depended on by themes. @@ -219,7 +219,7 @@ function template_preprocess_system_modules_details(&$variables) { * * @ingroup themeable */ -function template_preprocess_system_modules_uninstall(&$variables) { +function template_preprocess_system_modules_uninstall(&$variables): void { $form = $variables['form']; $variables['modules'] = []; @@ -256,7 +256,7 @@ function template_preprocess_system_modules_uninstall(&$variables) { * - theme_groups: An associative array containing groups of themes. * - theme_group_titles: An associative array containing titles of themes. */ -function template_preprocess_system_themes_page(&$variables) { +function template_preprocess_system_themes_page(&$variables): void { $groups = []; $theme_groups = $variables['theme_groups']; $variables['attributes']['id'] = 'system-themes-page'; diff --git a/core/modules/system/system.module b/core/modules/system/system.module index af698a011cc6..ab288658449b 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -261,7 +261,7 @@ function system_theme_suggestions_field(array $variables) { * - add_bundle_message: The message shown when there are no bundles. Only * available if the entity type uses bundle entities. */ -function template_preprocess_entity_add_list(&$variables) { +function template_preprocess_entity_add_list(&$variables): void { foreach ($variables['bundles'] as $bundle_name => $bundle_info) { $variables['bundles'][$bundle_name]['description'] = [ '#markup' => $bundle_info['description'], @@ -515,7 +515,7 @@ function _system_page_attachments(array &$page) { /** * Implements hook_preprocess_HOOK() for block templates. */ -function system_preprocess_block(&$variables) { +function system_preprocess_block(&$variables): void { switch ($variables['base_plugin_id']) { case 'system_branding_block': $variables['site_logo'] = ''; @@ -683,7 +683,7 @@ function _system_is_claro_admin_and_not_active() { /** * Implements hook_preprocess_toolbar(). */ -function system_preprocess_toolbar(array &$variables, $hook, $info) { +function system_preprocess_toolbar(array &$variables, $hook, $info): void { // When Claro is the admin theme, Claro overrides the active theme's if that // active theme is not Claro. Because of these potential overrides, the // toolbar cache should be invalidated any time the default or admin theme diff --git a/core/modules/system/tests/modules/common_test/common_test.module b/core/modules/system/tests/modules/common_test/common_test.module index 3adcaacf29d0..526f3f40b8cf 100644 --- a/core/modules/system/tests/modules/common_test/common_test.module +++ b/core/modules/system/tests/modules/common_test/common_test.module @@ -76,7 +76,7 @@ function common_test_preprocess(&$variables, $hook) { * * @see RenderTest::testDrupalRenderThemePreprocessAttached() */ -function common_test_preprocess_common_test_render_element(&$variables) { +function common_test_preprocess_common_test_render_element(&$variables): void { if (!\Drupal::state()->get('theme_preprocess_attached_test', FALSE)) { return; } diff --git a/core/modules/system/tests/modules/js_displace/js_displace.module b/core/modules/system/tests/modules/js_displace/js_displace.module index 59ba92acf771..8b34072bd659 100644 --- a/core/modules/system/tests/modules/js_displace/js_displace.module +++ b/core/modules/system/tests/modules/js_displace/js_displace.module @@ -10,6 +10,6 @@ declare(strict_types=1); /** * Implements hook_preprocess_html(). */ -function js_displace_preprocess_html(&$variables) { +function js_displace_preprocess_html(&$variables): void { $variables['#attached']['library'][] = 'core/drupal.displace'; } diff --git a/core/modules/system/tests/modules/layout_test/layout_test.module b/core/modules/system/tests/modules/layout_test/layout_test.module index 38633d6beb06..18459369b0ae 100644 --- a/core/modules/system/tests/modules/layout_test/layout_test.module +++ b/core/modules/system/tests/modules/layout_test/layout_test.module @@ -10,6 +10,6 @@ declare(strict_types=1); /** * Implements hook_preprocess_HOOK() for layout templates. */ -function template_preprocess_layout_test_2col(&$variables) { +function template_preprocess_layout_test_2col(&$variables): void { $variables['region_attributes']['left']->addClass('class-added-by-preprocess'); } diff --git a/core/modules/system/tests/modules/olivero_test/olivero_test.module b/core/modules/system/tests/modules/olivero_test/olivero_test.module index 40d6ca762f03..5d6977592542 100644 --- a/core/modules/system/tests/modules/olivero_test/olivero_test.module +++ b/core/modules/system/tests/modules/olivero_test/olivero_test.module @@ -10,7 +10,7 @@ declare(strict_types=1); /** * Implements hook_preprocess_field_multiple_value_form(). */ -function olivero_test_preprocess_field_multiple_value_form(&$variables) { +function olivero_test_preprocess_field_multiple_value_form(&$variables): void { // Set test multiple value form field to disabled if ($variables["element"]["#field_name"] === "field_multiple_value_form_field") { $variables['element']['#disabled'] = TRUE; @@ -20,6 +20,6 @@ function olivero_test_preprocess_field_multiple_value_form(&$variables) { /** * Implements hook_preprocess_html(). */ -function olivero_test_preprocess_html(&$variables) { +function olivero_test_preprocess_html(&$variables): void { $variables['#attached']['library'][] = 'olivero_test/log-errors'; } diff --git a/core/modules/system/tests/modules/pager_test/pager_test.module b/core/modules/system/tests/modules/pager_test/pager_test.module index 583d40645f8c..e4556eddba33 100644 --- a/core/modules/system/tests/modules/pager_test/pager_test.module +++ b/core/modules/system/tests/modules/pager_test/pager_test.module @@ -10,7 +10,7 @@ declare(strict_types=1); /** * Implements hook_preprocess_HOOK(). */ -function pager_test_preprocess_pager(&$variables) { +function pager_test_preprocess_pager(&$variables): void { // Nothing to do if there is only one page. $element = $variables['pager']['#element']; /** @var \Drupal\Core\Pager\PagerManagerInterface $pager_manager */ diff --git a/core/modules/system/tests/modules/router_test_directory/router_test.module b/core/modules/system/tests/modules/router_test_directory/router_test.module index 5b26c3f94aef..2158075059cc 100644 --- a/core/modules/system/tests/modules/router_test_directory/router_test.module +++ b/core/modules/system/tests/modules/router_test_directory/router_test.module @@ -17,7 +17,7 @@ use Drupal\Core\Url; * * @see \Drupal\FunctionalTests\Routing\RouteCachingQueryAlteredTest */ -function router_test_preprocess_page(&$variables) { +function router_test_preprocess_page(&$variables): void { $request = \Drupal::request(); if ($request->getPathInfo() === '/router-test/rejects-query-strings') { // Create a URL from the request, e.g. for a breadcrumb or other contextual diff --git a/core/modules/system/tests/modules/theme_region_test/theme_region_test.module b/core/modules/system/tests/modules/theme_region_test/theme_region_test.module index 90c781bc6ee0..5e9dc670a47a 100644 --- a/core/modules/system/tests/modules/theme_region_test/theme_region_test.module +++ b/core/modules/system/tests/modules/theme_region_test/theme_region_test.module @@ -10,7 +10,7 @@ declare(strict_types=1); /** * Implements hook_preprocess_HOOK() for region templates. */ -function theme_region_test_preprocess_region(&$variables) { +function theme_region_test_preprocess_region(&$variables): void { if ($variables['region'] == 'sidebar_first') { $variables['attributes']['class'][] = 'new_class'; } diff --git a/core/modules/system/tests/modules/theme_test/theme_test.inc b/core/modules/system/tests/modules/theme_test/theme_test.inc index 1600ba85743e..12254f9196d8 100644 --- a/core/modules/system/tests/modules/theme_test/theme_test.inc +++ b/core/modules/system/tests/modules/theme_test/theme_test.inc @@ -10,6 +10,6 @@ declare(strict_types=1); /** * Preprocesses variables for theme_theme_test(). */ -function template_preprocess_theme_test(&$variables) { +function template_preprocess_theme_test(&$variables): void { $variables['foo'] = 'template_preprocess_theme_test'; } diff --git a/core/modules/system/tests/modules/theme_test/theme_test.module b/core/modules/system/tests/modules/theme_test/theme_test.module index dd430ba201d6..edf55431bbb0 100644 --- a/core/modules/system/tests/modules/theme_test/theme_test.module +++ b/core/modules/system/tests/modules/theme_test/theme_test.module @@ -10,7 +10,7 @@ declare(strict_types=1); /** * Implements hook_preprocess_HOOK() for HTML document templates. */ -function theme_test_preprocess_html(&$variables) { +function theme_test_preprocess_html(&$variables): void { $variables['html_attributes']['theme_test_html_attribute'] = 'theme test html attribute value'; $variables['attributes']['theme_test_body_attribute'] = 'theme test body attribute value'; @@ -27,14 +27,14 @@ function theme_test_theme_suggestions_theme_test_preprocess_suggestions($variabl /** * Implements hook_preprocess_HOOK(). */ -function theme_test_preprocess_theme_test_preprocess_suggestions(&$variables) { +function theme_test_preprocess_theme_test_preprocess_suggestions(&$variables): void { $variables['foo'] = 'Theme hook implementor=theme_theme_test_preprocess_suggestions().'; } /** * Tests a module overriding a default hook with a suggestion. */ -function theme_test_preprocess_theme_test_preprocess_suggestions__monkey(&$variables) { +function theme_test_preprocess_theme_test_preprocess_suggestions__monkey(&$variables): void { $variables['foo'] = 'Monkey'; } @@ -47,7 +47,7 @@ function theme_test_preprocess_theme_test_preprocess_suggestions__monkey(&$varia * An associative array containing: * - elements: An associative array containing the properties of the element. */ -function template_preprocess_theme_test_render_element(&$variables) { +function template_preprocess_theme_test_render_element(&$variables): void { $variables['attributes']['data-variables-are-preprocessed'] = TRUE; } @@ -71,7 +71,7 @@ function theme_test_theme_suggestions_node(array $variables) { /** * Implements template_preprocess_HOOK() for theme_test_registered_by_module. */ -function template_preprocess_theme_test_registered_by_module() { +function template_preprocess_theme_test_registered_by_module(): void { } /** @@ -82,6 +82,6 @@ function template_preprocess_theme_test_registered_by_module() { * @param array $variables * An associative array of variables. */ -function template_preprocess_theme_test_deprecations_preprocess(array &$variables) { +function template_preprocess_theme_test_deprecations_preprocess(array &$variables): void { $variables = array_merge($variables, \Drupal::state()->get('theme_test.theme_test_deprecations_preprocess')); } diff --git a/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.module b/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.module index e74aa9618378..fb923142fbb7 100644 --- a/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.module +++ b/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.module @@ -49,6 +49,6 @@ function _test_theme_twig_php_values() { /** * Implements template_preprocess_status_messages(). */ -function twig_theme_test_preprocess_status_messages(&$variables) { +function twig_theme_test_preprocess_status_messages(&$variables): void { $variables['attributes']['class'][] = 'custom-test-messages-class'; } diff --git a/core/modules/system/tests/themes/test_subsubtheme/test_subsubtheme.theme b/core/modules/system/tests/themes/test_subsubtheme/test_subsubtheme.theme index 6dce533492b0..641fb5e02879 100644 --- a/core/modules/system/tests/themes/test_subsubtheme/test_subsubtheme.theme +++ b/core/modules/system/tests/themes/test_subsubtheme/test_subsubtheme.theme @@ -10,5 +10,5 @@ declare(strict_types=1); /** * Implements hook_preprocess_HOOK() for theme_test_template_test templates. */ -function test_subsubtheme_preprocess_theme_test_template_test(&$variables) { +function test_subsubtheme_preprocess_theme_test_template_test(&$variables): void { } diff --git a/core/modules/system/tests/themes/test_subtheme/test_subtheme.theme b/core/modules/system/tests/themes/test_subtheme/test_subtheme.theme index c5451ef0de85..36065bfe4ea7 100644 --- a/core/modules/system/tests/themes/test_subtheme/test_subtheme.theme +++ b/core/modules/system/tests/themes/test_subtheme/test_subtheme.theme @@ -32,5 +32,5 @@ function test_subtheme_views_post_render(ViewExecutable $view, &$output, CachePl /** * Implements hook_preprocess_HOOK() for theme_test_template_test templates. */ -function test_subtheme_preprocess_theme_test_template_test(&$variables) { +function test_subtheme_preprocess_theme_test_template_test(&$variables): void { } diff --git a/core/modules/system/tests/themes/test_theme/test_theme.theme b/core/modules/system/tests/themes/test_theme/test_theme.theme index 6c4f3a4b6488..19c7695757c8 100644 --- a/core/modules/system/tests/themes/test_theme/test_theme.theme +++ b/core/modules/system/tests/themes/test_theme/test_theme.theme @@ -10,7 +10,7 @@ declare(strict_types=1); /** * Implements THEME_preprocess_twig_theme_test_php_variables(). */ -function test_theme_preprocess_twig_theme_test_php_variables(&$variables) { +function test_theme_preprocess_twig_theme_test_php_variables(&$variables): void { $variables['php_values'] = _test_theme_twig_php_values(); } @@ -92,42 +92,42 @@ function test_theme_theme_registry_alter(&$registry) { * * Implements hook_preprocess_HOOK(). */ -function test_theme_preprocess_theme_test_preprocess_suggestions(&$variables) { +function test_theme_preprocess_theme_test_preprocess_suggestions(&$variables): void { $variables['foo'] = 'Theme hook implementor=test_theme_preprocess_theme_test_preprocess_suggestions().'; } /** * Tests a theme overriding a default hook with a suggestion. */ -function test_theme_preprocess_theme_test_preprocess_suggestions__suggestion(&$variables) { +function test_theme_preprocess_theme_test_preprocess_suggestions__suggestion(&$variables): void { $variables['foo'] = 'Suggestion'; } /** * Tests a theme overriding a default hook with a suggestion. */ -function test_theme_preprocess_theme_test_preprocess_suggestions__kitten(&$variables) { +function test_theme_preprocess_theme_test_preprocess_suggestions__kitten(&$variables): void { $variables['foo'] = 'Kitten'; } /** * Tests a theme overriding a default hook with a suggestion. */ -function test_theme_preprocess_theme_test_preprocess_suggestions__kitten__flamingo(&$variables) { +function test_theme_preprocess_theme_test_preprocess_suggestions__kitten__flamingo(&$variables): void { $variables['bar'] = 'Flamingo'; } /** * Tests a preprocess function with suggestions. */ -function test_theme_preprocess_theme_test_preprocess_suggestions__kitten__meerkat__tarsier__moose(&$variables) { +function test_theme_preprocess_theme_test_preprocess_suggestions__kitten__meerkat__tarsier__moose(&$variables): void { $variables['bar'] = 'Moose'; } /** * Tests that a class can be loaded within a .theme file. */ -function test_theme_preprocess_theme_test_theme_class(&$variables) { +function test_theme_preprocess_theme_test_theme_class(&$variables): void { if (class_exists('\Drupal\test_theme\ThemeClass')) { $variables['message'] = 'Loading ThemeClass was successful.'; } diff --git a/core/modules/system/tests/themes/test_theme_nyan_cat_engine/test_theme_nyan_cat_engine.theme b/core/modules/system/tests/themes/test_theme_nyan_cat_engine/test_theme_nyan_cat_engine.theme index 763f9ec42393..7aff7e842632 100644 --- a/core/modules/system/tests/themes/test_theme_nyan_cat_engine/test_theme_nyan_cat_engine.theme +++ b/core/modules/system/tests/themes/test_theme_nyan_cat_engine/test_theme_nyan_cat_engine.theme @@ -12,6 +12,6 @@ declare(strict_types=1); /** * Implements hook_preprocess_theme_test_template_test(). */ -function test_theme_nyan_cat_engine_preprocess_theme_test_template_test(&$variables) { +function test_theme_nyan_cat_engine_preprocess_theme_test_template_test(&$variables): void { $variables['kittens'] = 'All of them'; } diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 6ba925c9f498..d00cf3f80502 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -47,7 +47,7 @@ function taxonomy_theme_suggestions_taxonomy_term(array $variables) { * 'full' or 'teaser'. * - attributes: HTML attributes for the containing element. */ -function template_preprocess_taxonomy_term(&$variables) { +function template_preprocess_taxonomy_term(&$variables): void { $variables['view_mode'] = $variables['elements']['#view_mode']; $variables['term'] = $variables['elements']['#taxonomy_term']; /** @var \Drupal\taxonomy\TermInterface $term */ diff --git a/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module b/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module index 9085a1b6f60e..8980eb4a6ef5 100644 --- a/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module +++ b/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module @@ -10,7 +10,7 @@ declare(strict_types=1); /** * Implements hook_preprocess_HOOK(). */ -function toolbar_test_preprocess_menu(&$variables) { +function toolbar_test_preprocess_menu(&$variables): void { // All the standard hook_theme variables should be populated when the // Toolbar module is rendering a menu. foreach (['menu_name', 'items', 'attributes'] as $variable) { diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module index 285c1bc28e65..51986310901c 100644 --- a/core/modules/toolbar/toolbar.module +++ b/core/modules/toolbar/toolbar.module @@ -21,7 +21,7 @@ use Drupal\toolbar\Controller\ToolbarController; * - element: An associative array containing the properties and children of * the tray. Properties used: #children, #attributes and #bar. */ -function template_preprocess_toolbar(&$variables) { +function template_preprocess_toolbar(&$variables): void { $element = $variables['element']; // Prepare the toolbar attributes. @@ -120,7 +120,7 @@ function toolbar_menu_navigation_links(array $tree) { /** * Implements hook_preprocess_HOOK() for HTML document templates. */ -function toolbar_preprocess_html(&$variables) { +function toolbar_preprocess_html(&$variables): void { if (!\Drupal::currentUser()->hasPermission('access toolbar')) { return; } diff --git a/core/modules/update/update.module b/core/modules/update/update.module index f12aecaa74eb..654ce8f37faf 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -270,7 +270,7 @@ function _update_project_status_sort($a, $b) { * * @see theme_update_report() */ -function template_preprocess_update_last_check(&$variables) { +function template_preprocess_update_last_check(&$variables): void { $variables['time'] = \Drupal::service('date.formatter')->formatTimeDiffSince($variables['last']); $variables['link'] = Link::fromTextAndUrl(t('Check manually'), Url::fromRoute('update.manual_status', [], ['query' => \Drupal::destination()->getAsArray()]))->toString(); } diff --git a/core/modules/update/update.report.inc b/core/modules/update/update.report.inc index ec8bc36115e7..75957754bd87 100644 --- a/core/modules/update/update.report.inc +++ b/core/modules/update/update.report.inc @@ -19,7 +19,7 @@ use Drupal\update\UpdateManagerInterface; * An associative array containing: * - data: An array of data about each project's status. */ -function template_preprocess_update_report(&$variables) { +function template_preprocess_update_report(&$variables): void { $data = isset($variables['data']) && is_array($variables['data']) ? $variables['data'] : []; $last = \Drupal::state()->get('update.last_check', 0); @@ -112,7 +112,7 @@ function template_preprocess_update_report(&$variables) { * An associative array containing: * - version: An array of information about the release version. */ -function template_preprocess_update_version(array &$variables) { +function template_preprocess_update_version(array &$variables): void { $release = ProjectRelease::createFromArray($variables['version']); if (!$release->getCoreCompatibilityMessage()) { return; @@ -142,7 +142,7 @@ function template_preprocess_update_version(array &$variables) { * An associative array containing: * - project: An array of information about the project. */ -function template_preprocess_update_project_status(&$variables) { +function template_preprocess_update_project_status(&$variables): void { // Storing by reference because we are sorting the project values. $project = &$variables['project']; diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 98fb803fe130..907fa44f56c9 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -115,7 +115,7 @@ function user_is_blocked($name) { /** * Implements hook_preprocess_HOOK() for block templates. */ -function user_preprocess_block(&$variables) { +function user_preprocess_block(&$variables): void { if ($variables['configuration']['provider'] == 'user') { switch ($variables['elements']['#plugin_id']) { case 'user_login_block': @@ -137,7 +137,7 @@ function user_preprocess_block(&$variables) { * An associative array containing: * - account: The user account (\Drupal\Core\Session\AccountInterface). */ -function template_preprocess_username(&$variables) { +function template_preprocess_username(&$variables): void { $account = $variables['account'] ?: new AnonymousUserSession(); $variables['extra'] = ''; @@ -760,7 +760,7 @@ function user_logout() { * profile being viewed. * - attributes: HTML attributes for the containing element. */ -function template_preprocess_user(&$variables) { +function template_preprocess_user(&$variables): void { $variables['user'] = $variables['elements']['#user']; // Helpful $content variable for templates. foreach (Element::children($variables['elements']) as $key) { diff --git a/core/modules/views/tests/modules/views_test_data/views_test_data.module b/core/modules/views/tests/modules/views_test_data/views_test_data.module index 3d49926c628c..421dff3e88d0 100644 --- a/core/modules/views/tests/modules/views_test_data/views_test_data.module +++ b/core/modules/views/tests/modules/views_test_data/views_test_data.module @@ -46,7 +46,7 @@ function views_test_data_handler_test_access_callback_argument($argument = FALSE /** * Implements hook_preprocess_HOOK() for views table templates. */ -function views_test_data_preprocess_views_view_table(&$variables) { +function views_test_data_preprocess_views_view_table(&$variables): void { if ($variables['view']->storage->id() == 'test_view_render') { $views_render_test = \Drupal::state()->get('views_render.test'); $views_render_test++; @@ -65,7 +65,7 @@ function views_test_data_preprocess_views_view_table(&$variables) { * - options: Various view options, including the row style mapping. * - view: The view object. */ -function template_preprocess_views_view_mapping_test(&$variables) { +function template_preprocess_views_view_mapping_test(&$variables): void { $variables['element'] = []; foreach ($variables['rows'] as $delta => $row) { diff --git a/core/modules/views/tests/modules/views_test_rss/views_test_rss.module b/core/modules/views/tests/modules/views_test_rss/views_test_rss.module index 14f44cd79824..1b0dda574c45 100644 --- a/core/modules/views/tests/modules/views_test_rss/views_test_rss.module +++ b/core/modules/views/tests/modules/views_test_rss/views_test_rss.module @@ -10,7 +10,7 @@ declare(strict_types=1); /** * Implements hook_preprocess_HOOK(). */ -function views_test_rss_preprocess_views_view_rss(&$variables) { +function views_test_rss_preprocess_views_view_rss(&$variables): void { $variables['channel_elements'][] = [ '#type' => 'html_tag', '#tag' => 'copyright', diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 59a4f0b47430..964b1657c613 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -17,7 +17,7 @@ use Drupal\views\Views; * we haven't got a chance to load that file before Drupal builds the * node portion of the theme registry. */ -function views_preprocess_node(&$variables) { +function views_preprocess_node(&$variables): void { // The 'view' attribute of the node is added in // \Drupal\views\Plugin\views\row\EntityRow::preRender(). if (!empty($variables['node']->view) && $variables['node']->view->storage->id()) { @@ -40,7 +40,7 @@ function views_preprocess_node(&$variables) { /** * Allows view-based comment templates if called from a view. */ -function views_preprocess_comment(&$variables) { +function views_preprocess_comment(&$variables): void { // The view data is added to the comment in // \Drupal\views\Plugin\views\row\EntityRow::preRender(). if (!empty($variables['comment']->view) && $variables['comment']->view->storage->id()) { diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index 859ede62114d..72014e80392e 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -19,7 +19,7 @@ use Drupal\Core\Utility\TableSort; * An associative array containing: * - view: The ViewExecutable object. */ -function template_preprocess_views_view(&$variables) { +function template_preprocess_views_view(&$variables): void { $view = $variables['view']; $id = $view->storage->id(); @@ -87,7 +87,7 @@ function template_preprocess_views_view(&$variables) { * visually distinct. * - row: An array containing information about the current row. */ -function template_preprocess_views_view_fields(&$variables) { +function template_preprocess_views_view_fields(&$variables): void { $view = $variables['view']; // Loop through the fields for this view. @@ -210,7 +210,7 @@ function template_preprocess_views_view_fields(&$variables) { * - content: The content to be grouped. * - title: The group heading. */ -function template_preprocess_views_view_grouping(&$variables) { +function template_preprocess_views_view_grouping(&$variables): void { $variables['content'] = $variables['view']->style_plugin->renderGroupingSets($variables['rows'], $variables['grouping_level']); } @@ -226,7 +226,7 @@ function template_preprocess_views_view_grouping(&$variables) { * field. * - view: Instance of the ViewExecutable object for the parent view. */ -function template_preprocess_views_view_field(&$variables) { +function template_preprocess_views_view_field(&$variables): void { $variables['output'] = $variables['field']->advancedRender($variables['row']); } @@ -242,7 +242,7 @@ function template_preprocess_views_view_field(&$variables) { * - view: A ViewExecutable object. * - rows: The raw row data. */ -function template_preprocess_views_view_summary(&$variables) { +function template_preprocess_views_view_summary(&$variables): void { /** @var \Drupal\views\ViewExecutable $view */ $view = $variables['view']; $argument = $view->argument[$view->build_info['summary_level']]; @@ -330,7 +330,7 @@ function template_preprocess_views_view_summary(&$variables) { * - separator: A string to be placed between inline fields to keep them * visually distinct. */ -function template_preprocess_views_view_summary_unformatted(&$variables) { +function template_preprocess_views_view_summary_unformatted(&$variables): void { /** @var \Drupal\views\ViewExecutable $view */ $view = $variables['view']; $argument = $view->argument[$view->build_info['summary_level']]; @@ -413,7 +413,7 @@ function template_preprocess_views_view_summary_unformatted(&$variables) { * - view: A ViewExecutable object. * - rows: The raw row data. */ -function template_preprocess_views_view_table(&$variables) { +function template_preprocess_views_view_table(&$variables): void { $view = $variables['view']; // We need the raw data for this grouping, which is passed in @@ -702,7 +702,7 @@ function template_preprocess_views_view_table(&$variables) { * - view: The view object. * - rows: An array of row items. Each row is an array of content. */ -function template_preprocess_views_view_grid(&$variables) { +function template_preprocess_views_view_grid(&$variables): void { $options = $variables['options'] = $variables['view']->style_plugin->options; $horizontal = ($options['alignment'] === 'horizontal'); @@ -803,7 +803,7 @@ function template_preprocess_views_view_grid(&$variables) { * - view: The view object. * - rows: An array of row items. Each row is an array of content. */ -function template_preprocess_views_view_grid_responsive(&$variables) { +function template_preprocess_views_view_grid_responsive(&$variables): void { $variables['options'] = $variables['view']->style_plugin->options; $view = $variables['view']; @@ -834,7 +834,7 @@ function template_preprocess_views_view_grid_responsive(&$variables) { * - view: The view object. * - rows: An array of row items. Each row is an array of content. */ -function template_preprocess_views_view_unformatted(&$variables) { +function template_preprocess_views_view_unformatted(&$variables): void { $view = $variables['view']; $rows = $variables['rows']; $style = $view->style_plugin; @@ -860,7 +860,7 @@ function template_preprocess_views_view_unformatted(&$variables) { * An associative array containing: * - view: A View object. */ -function template_preprocess_views_view_list(&$variables) { +function template_preprocess_views_view_list(&$variables): void { $handler = $variables['view']->style_plugin; // Fetch classes from handler options. @@ -893,7 +893,7 @@ function template_preprocess_views_view_list(&$variables) { * - view: A ViewExecutable object. * - rows: The raw row data. */ -function template_preprocess_views_view_rss(&$variables) { +function template_preprocess_views_view_rss(&$variables): void { $view = $variables['view']; $items = $variables['rows']; $style = $view->style_plugin; @@ -931,7 +931,7 @@ function template_preprocess_views_view_rss(&$variables) { * An associative array containing: * - row: The raw results rows. */ -function template_preprocess_views_view_row_rss(&$variables) { +function template_preprocess_views_view_row_rss(&$variables): void { $item = $variables['row']; $variables['title'] = $item->title; $variables['link'] = $item->link; @@ -963,7 +963,7 @@ function template_preprocess_views_view_row_rss(&$variables) { * - view: A ViewExecutable object. * - rows: The raw row data. */ -function template_preprocess_views_view_opml(&$variables) { +function template_preprocess_views_view_opml(&$variables): void { $view = $variables['view']; $items = $variables['rows']; @@ -992,7 +992,7 @@ function template_preprocess_views_view_opml(&$variables) { * An associative array containing: * - row: The raw results rows. */ -function template_preprocess_views_view_row_opml(&$variables) { +function template_preprocess_views_view_row_opml(&$variables): void { $item = $variables['row']; $variables['attributes'] = new Attribute($item); @@ -1007,7 +1007,7 @@ function template_preprocess_views_view_row_opml(&$variables) { * An associative array containing: * - form: A render element representing the form. */ -function template_preprocess_views_exposed_form(&$variables) { +function template_preprocess_views_exposed_form(&$variables): void { $form = &$variables['form']; if (!empty($form['q'])) { @@ -1037,7 +1037,7 @@ function template_preprocess_views_exposed_form(&$variables) { * - parameters: Any extra GET parameters that should be retained, such as * exposed input. */ -function template_preprocess_views_mini_pager(&$variables) { +function template_preprocess_views_mini_pager(&$variables): void { /** @var \Drupal\Core\Pager\PagerManagerInterface $pager_manager */ $pager_manager = \Drupal::service('pager.manager'); diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module index f84be5ec62d2..4f056b0f7679 100644 --- a/core/modules/views_ui/views_ui.module +++ b/core/modules/views_ui/views_ui.module @@ -11,7 +11,7 @@ use Drupal\views\ViewExecutable; /** * Implements hook_preprocess_HOOK() for views templates. */ -function views_ui_preprocess_views_view(&$variables) { +function views_ui_preprocess_views_view(&$variables): void { $view = $variables['view']; // Render title for the admin preview. diff --git a/core/modules/views_ui/views_ui.theme.inc b/core/modules/views_ui/views_ui.theme.inc index 996c700aa08d..f58c82b7ef7d 100644 --- a/core/modules/views_ui/views_ui.theme.inc +++ b/core/modules/views_ui/views_ui.theme.inc @@ -28,7 +28,7 @@ use Drupal\Core\Template\Attribute; * - description_separator: A boolean indicating a separator colon should be * appended to the setting's description. */ -function template_preprocess_views_ui_display_tab_setting(&$variables) { +function template_preprocess_views_ui_display_tab_setting(&$variables): void { // Put the primary link to the left side. array_unshift($variables['settings_links'], $variables['link']); @@ -54,7 +54,7 @@ function template_preprocess_views_ui_display_tab_setting(&$variables) { * - rows: An associative array containing the rows data for the view * listing table. */ -function template_preprocess_views_ui_views_listing_table(&$variables) { +function template_preprocess_views_ui_views_listing_table(&$variables): void { // Convert the attributes to valid attribute objects. foreach ($variables['headers'] as $key => $header) { $variables['headers'][$key]['attributes'] = new Attribute($header['#attributes']); @@ -77,7 +77,7 @@ function template_preprocess_views_ui_views_listing_table(&$variables) { * - element: An associative array containing the properties of the element. * Properties used: #name, #overridden, #children, #title, #actions. */ -function template_preprocess_views_ui_display_tab_bucket(&$variables) { +function template_preprocess_views_ui_display_tab_bucket(&$variables): void { $element = $variables['element']; if (!empty($element['#overridden'])) { @@ -100,7 +100,7 @@ function template_preprocess_views_ui_display_tab_bucket(&$variables) { * An associative array containing: * - form: A render element representing the form. */ -function template_preprocess_views_ui_build_group_filter_form(&$variables) { +function template_preprocess_views_ui_build_group_filter_form(&$variables): void { $form = $variables['form']; // Prepare table of options. @@ -200,7 +200,7 @@ function template_preprocess_views_ui_build_group_filter_form(&$variables) { * An associative array containing: * - form: A render element representing the form. */ -function template_preprocess_views_ui_rearrange_filter_form(&$variables) { +function template_preprocess_views_ui_rearrange_filter_form(&$variables): void { $form = &$variables['form']; $rows = $ungroupable_rows = []; // Enable grouping only if > 1 group. @@ -393,7 +393,7 @@ function template_preprocess_views_ui_rearrange_filter_form(&$variables) { * An associative array containing: * - form: A render element representing the form. */ -function template_preprocess_views_ui_style_plugin_table(&$variables) { +function template_preprocess_views_ui_style_plugin_table(&$variables): void { $form = $variables['form']; $header = [ @@ -488,7 +488,7 @@ function template_preprocess_views_ui_style_plugin_table(&$variables) { * - view: The view object. * - section: The section name of a View (e.g. title, rows or pager). */ -function template_preprocess_views_ui_view_preview_section(&$variables) { +function template_preprocess_views_ui_view_preview_section(&$variables): void { switch ($variables['section']) { case 'title': $variables['title'] = t('Title'); diff --git a/core/profiles/demo_umami/themes/umami/umami.theme b/core/profiles/demo_umami/themes/umami/umami.theme index 5af5da332208..d693eb14f070 100644 --- a/core/profiles/demo_umami/themes/umami/umami.theme +++ b/core/profiles/demo_umami/themes/umami/umami.theme @@ -17,7 +17,7 @@ use Drupal\Core\Render\Element; * * Adds body classes if certain regions have content. */ -function umami_preprocess_html(&$variables) { +function umami_preprocess_html(&$variables): void { // Add a sidebar class if the sidebar has content in it. if (!empty($variables['page']['sidebar'])) { $variables['attributes']['class'][] = 'two-columns'; @@ -31,7 +31,7 @@ function umami_preprocess_html(&$variables) { /** * Implements hook_preprocess_field(). */ -function umami_preprocess_field(&$variables, $hook) { +function umami_preprocess_field(&$variables, $hook): void { $element = $variables['element']; // Add class to label and items fields to be styled using the meta styles. if (isset($element['#field_name'])) { @@ -51,7 +51,7 @@ function umami_preprocess_field(&$variables, $hook) { /** * Implements hook_preprocess_block(). */ -function umami_preprocess_block(&$variables) { +function umami_preprocess_block(&$variables): void { $variables['title_attributes']['class'][] = 'block__title'; // Add a class indicating the content block bundle. if (isset($variables['elements']['content']['#block_content'])) { @@ -72,7 +72,7 @@ function umami_theme_suggestions_block_alter(array &$suggestions, array $variabl /** * Implements hook_umami_preprocess_block__bundle__banner_block(). */ -function umami_preprocess_block__bundle__banner_block(&$variables) { +function umami_preprocess_block__bundle__banner_block(&$variables): void { if (isset($variables['content']['field_content_link'])) { foreach (Element::children($variables['content']['field_content_link']) as $key) { $variables['content']['field_content_link'][$key]['#attributes']['class'][] = 'button'; @@ -85,7 +85,7 @@ function umami_preprocess_block__bundle__banner_block(&$variables) { /** * Implements hook_umami_preprocess_block__bundle__footer_promo_block(). */ -function umami_preprocess_block__bundle__footer_promo_block(&$variables) { +function umami_preprocess_block__bundle__footer_promo_block(&$variables): void { if (isset($variables['content']['field_content_link'])) { foreach (Element::children($variables['content']['field_content_link']) as $key) { $variables['content']['field_content_link'][$key]['#attributes']['class'][] = 'footer-block__link'; @@ -96,7 +96,7 @@ function umami_preprocess_block__bundle__footer_promo_block(&$variables) { /** * Implements hook_preprocess_breadcrumb(). */ -function umami_preprocess_breadcrumb(&$variables) { +function umami_preprocess_breadcrumb(&$variables): void { // We are creating a variable for the Current Page Title, to allow us to print // it after the breadcrumbs loop has run. $route_match = \Drupal::routeMatch(); @@ -121,7 +121,7 @@ function umami_preprocess_breadcrumb(&$variables) { /** * Implements hook_preprocess_menu_local_task(). */ -function umami_preprocess_menu_local_task(&$variables) { +function umami_preprocess_menu_local_task(&$variables): void { $variables['link']['#options']['attributes']['class'][] = 'tabs__link'; } @@ -141,7 +141,7 @@ function umami_form_search_block_form_alter(&$form, FormStateInterface $form_sta * @todo Do this in the relevant template once * https://www.drupal.org/project/drupal/issues/3088856 is resolved. */ -function umami_preprocess_links__media_library_menu(array &$variables) { +function umami_preprocess_links__media_library_menu(array &$variables): void { foreach ($variables['links'] as &$link) { $link['link']['#options']['attributes']['class'][] = 'media-library-menu__link'; } @@ -165,7 +165,7 @@ function umami_form_alter(array &$form, FormStateInterface $form_state, $form_id * * @todo Revisit in https://drupal.org/node/3117430 */ -function umami_preprocess_image_widget(&$variables) { +function umami_preprocess_image_widget(&$variables): void { if (!empty($variables['element']['fids']['#value'])) { $file = reset($variables['element']['#files']); $variables['data']["file_{$file->id()}"]['filename']['#suffix'] = ' <span class="file-size">(' . ByteSizeMarkup::create($file->getSize()) . ')</span> '; @@ -181,7 +181,7 @@ function umami_preprocess_image_widget(&$variables) { * * @todo remove in https://drupal.org/node/3120962 */ -function umami_preprocess_links(&$variables) { +function umami_preprocess_links(&$variables): void { if (!empty($variables['links'])) { foreach ($variables['links'] as $key => $value) { if (!is_numeric($key)) { diff --git a/core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php b/core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php index 339eb2b520b6..b6ebe125d801 100644 --- a/core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php +++ b/core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php @@ -173,7 +173,7 @@ YAML // Confirm new .theme file. $dot_theme_file = $this->getWorkspaceDirectory() . '/themes/generated_from_another_theme/generated_from_another_theme.theme'; - $this->assertStringContainsString('function generated_from_another_theme_preprocess_image_widget(array &$variables) {', file_get_contents($dot_theme_file)); + $this->assertStringContainsString('function generated_from_another_theme_preprocess_image_widget(array &$variables): void {', file_get_contents($dot_theme_file)); } /** diff --git a/core/tests/fixtures/test_stable/test_stable.theme b/core/tests/fixtures/test_stable/test_stable.theme index 8498d89ab061..ffa9933ed6c2 100644 --- a/core/tests/fixtures/test_stable/test_stable.theme +++ b/core/tests/fixtures/test_stable/test_stable.theme @@ -8,6 +8,6 @@ /** * Implements hook_preprocess_theme_test_render_element(). */ -function test_stable_preprocess_theme_test_render_element($variables) { +function test_stable_preprocess_theme_test_render_element($variables): void { // This is used for Drupal\Tests\Core\Theme\RegistryTest. } diff --git a/core/themes/claro/claro.theme b/core/themes/claro/claro.theme index 8b411f38656c..6015fdf976bb 100644 --- a/core/themes/claro/claro.theme +++ b/core/themes/claro/claro.theme @@ -79,7 +79,7 @@ function claro_page_attachments_alter(array &$attachments) { * Use preprocess hook to set #attached to child elements because they will be * processed by Twig and \Drupal::service('renderer')->render() will be invoked. */ -function claro_preprocess_menu_local_tasks(&$variables) { +function claro_preprocess_menu_local_tasks(&$variables): void { if (!empty($variables['primary'])) { $variables['primary']['#attached'] = [ 'library' => [ @@ -106,7 +106,7 @@ function claro_preprocess_menu_local_tasks(&$variables) { /** * Implements hook_preprocess_HOOK() for menu-local-task templates. */ -function claro_preprocess_menu_local_task(&$variables) { +function claro_preprocess_menu_local_task(&$variables): void { $variables['link']['#options']['attributes']['class'][] = 'tabs__link'; $variables['link']['#options']['attributes']['class'][] = 'js-tabs-link'; @@ -125,7 +125,7 @@ function claro_preprocess_menu_local_task(&$variables) { /** * Implements hook_preprocess_HOOK() for menu-local-task Views UI templates. */ -function claro_preprocess_menu_local_task__views_ui(&$variables) { +function claro_preprocess_menu_local_task__views_ui(&$variables): void { // Remove 'tabs__link' without adding a new class because it couldn't be used // reliably. // @see https://www.drupal.org/node/3051605 @@ -140,7 +140,7 @@ function claro_preprocess_menu_local_task__views_ui(&$variables) { * * Makes node_add_list variables compatible with entity_add_list. */ -function claro_preprocess_node_add_list(&$variables) { +function claro_preprocess_node_add_list(&$variables): void { if (!empty($variables['content'])) { /** @var \Drupal\node\NodeTypeInterface $type */ foreach ($variables['content'] as $type) { @@ -168,7 +168,7 @@ function claro_preprocess_node_add_list(&$variables) { * * Makes block_content_add_list variables compatible with entity_add_list. */ -function claro_preprocess_block_content_add_list(&$variables) { +function claro_preprocess_block_content_add_list(&$variables): void { if (!empty($variables['content'])) { $query = \Drupal::request()->query->all(); /** @var \Drupal\block_content\BlockContentTypeInterface $type */ @@ -199,7 +199,7 @@ function claro_preprocess_block_content_add_list(&$variables) { /** * Implements template_preprocess_HOOK() for entity_add_list. */ -function claro_preprocess_entity_add_list(&$variables) { +function claro_preprocess_entity_add_list(&$variables): void { // Remove description if empty. foreach ($variables['bundles'] as $type_id => $values) { if (isset($values['description']['#markup']) && empty($values['description']['#markup'])) { @@ -213,7 +213,7 @@ function claro_preprocess_entity_add_list(&$variables) { * * Disables contextual links for all blocks except for layout builder blocks. */ -function claro_preprocess_block(&$variables) { +function claro_preprocess_block(&$variables): void { if (isset($variables['title_suffix']['contextual_links']) && !isset($variables['elements']['#contextual_links']['layout_builder_block'])) { unset($variables['title_suffix']['contextual_links']); unset($variables['elements']['#contextual_links']); @@ -225,7 +225,7 @@ function claro_preprocess_block(&$variables) { /** * Implements template_preprocess_HOOK() for admin_block. */ -function claro_preprocess_admin_block(&$variables) { +function claro_preprocess_admin_block(&$variables): void { if (!empty($variables['block']['content'])) { $variables['block']['content']['#attributes']['class'][] = 'admin-list--panel'; } @@ -234,7 +234,7 @@ function claro_preprocess_admin_block(&$variables) { /** * Implements template_preprocess_HOOK() for admin_block. */ -function claro_preprocess_admin_block_content(&$variables) { +function claro_preprocess_admin_block_content(&$variables): void { foreach ($variables['content'] as &$item) { $link_attributes = $item['url']->getOption('attributes') ?: []; $link_attributes['class'][] = 'admin-item__link'; @@ -250,7 +250,7 @@ function claro_preprocess_admin_block_content(&$variables) { /** * Implements hook_preprocess_HOOK() for menu-local-action templates. */ -function claro_preprocess_menu_local_action(array &$variables) { +function claro_preprocess_menu_local_action(array &$variables): void { $variables['link']['#options']['attributes']['class'][] = 'button--primary'; $variables['attributes']['class'][] = 'local-actions__item'; $legacy_class_key = array_search('button-action', $variables['link']['#options']['attributes']['class']); @@ -314,7 +314,7 @@ function claro_element_info_alter(&$type) { * * @todo Remove when https://www.drupal.org/node/3016343 is fixed. */ -function claro_preprocess_text_format_wrapper(&$variables) { +function claro_preprocess_text_format_wrapper(&$variables): void { $description_attributes = []; if (!empty($variables['attributes']['id'])) { $description_attributes['id'] = $variables['attributes']['aria-describedby'] = $variables['attributes']['id']; @@ -340,7 +340,7 @@ function claro_theme_registry_alter(&$theme_registry) { /** * Implements hook_preprocess_install_page(). */ -function claro_preprocess_install_page(&$variables) { +function claro_preprocess_install_page(&$variables): void { // Claro has custom styling for the install page. $variables['#attached']['library'][] = 'claro/install-page'; } @@ -348,7 +348,7 @@ function claro_preprocess_install_page(&$variables) { /** * Implements hook_preprocess_maintenance_page(). */ -function claro_preprocess_maintenance_page(&$variables) { +function claro_preprocess_maintenance_page(&$variables): void { // Claro has custom styling for the maintenance page. $variables['#attached']['library'][] = 'claro/maintenance-page'; } @@ -379,7 +379,7 @@ function claro_theme_suggestions_maintenance_page_alter(&$suggestions) { * * @todo Revisit when https://www.drupal.org/node/3056089 is in. */ -function claro_preprocess_details(&$variables) { +function claro_preprocess_details(&$variables): void { $element = $variables['element']; if (!empty($element['#accordion_item'])) { @@ -525,7 +525,7 @@ function claro_form_alter(array &$form, FormStateInterface $form_state, $form_id /** * Implements hook_preprocess_HOOK() for links. */ -function claro_preprocess_links(&$variables) { +function claro_preprocess_links(&$variables): void { foreach ($variables['links'] as $links_item) { if (!empty($links_item['link']) && !empty($links_item['link']['#url']) && $links_item['link']['#url'] instanceof Url) { if ($links_item['link']['#url']->isRouted()) { @@ -864,7 +864,7 @@ function claro_views_ui_display_tab_alter(&$element) { /** * Implements hook_preprocess_HOOK() for views_exposed_form. */ -function claro_preprocess_views_exposed_form(&$variables) { +function claro_preprocess_views_exposed_form(&$variables): void { $form = &$variables['form']; // Add BEM classes for items in the form. @@ -947,7 +947,7 @@ function claro_form_system_modules_alter(&$form, FormStateInterface $form_state) /** * Implements hook_preprocess_form_element(). */ -function claro_preprocess_form_element(&$variables) { +function claro_preprocess_form_element(&$variables): void { if (!empty($variables['element']['#errors'])) { $variables['label']['#attributes']['class'][] = 'has-error'; } @@ -964,7 +964,7 @@ function claro_preprocess_form_element(&$variables) { /** * Implements template_preprocess_HOOK() for input. */ -function claro_preprocess_input(&$variables) { +function claro_preprocess_input(&$variables): void { if ( !empty($variables['element']['#title_display']) && $variables['element']['#title_display'] === 'attribute' && @@ -1011,7 +1011,7 @@ function claro_preprocess_input(&$variables) { /** * Implements template_preprocess_HOOK() for select. */ -function claro_preprocess_select(&$variables) { +function claro_preprocess_select(&$variables): void { if (!empty($variables['element']['#title_display']) && $variables['element']['#title_display'] === 'attribute' && !empty((string) $variables['element']['#title'])) { $variables['attributes']['title'] = (string) $variables['element']['#title']; } @@ -1029,7 +1029,7 @@ function claro_preprocess_select(&$variables) { /** * Implements template_preprocess_HOOK() for datetime_wrapper. */ -function claro_preprocess_datetime_wrapper(&$variables) { +function claro_preprocess_datetime_wrapper(&$variables): void { if (!empty($variables['element']['#errors'])) { $variables['title_attributes']['class'][] = 'has-error'; } @@ -1046,7 +1046,7 @@ function claro_preprocess_datetime_wrapper(&$variables) { /** * Implements template_preprocess_HOOK() for fieldset. */ -function claro_preprocess_fieldset(&$variables) { +function claro_preprocess_fieldset(&$variables): void { $element = $variables['element']; $composite_types = ['checkboxes', 'radios']; @@ -1079,7 +1079,7 @@ function claro_preprocess_fieldset(&$variables) { /** * Implements hook_preprocess_HOOK() for field_multiple_value_form. */ -function claro_preprocess_field_multiple_value_form(&$variables) { +function claro_preprocess_field_multiple_value_form(&$variables): void { // Make disabled available for the template. $variables['disabled'] = !empty($variables['element']['#disabled']); @@ -1124,7 +1124,7 @@ function claro_preprocess_field_multiple_value_form(&$variables) { /** * Implements hook_preprocess_HOOK() for form_element__password_confirm. */ -function claro_preprocess_form_element__password_confirm(&$variables) { +function claro_preprocess_form_element__password_confirm(&$variables): void { // Add CSS classes needed for theming the password confirm widget. $variables['attributes']['class'][] = 'password-confirm'; $variables['attributes']['class'][] = 'is-initial'; @@ -1135,7 +1135,7 @@ function claro_preprocess_form_element__password_confirm(&$variables) { /** * Implements hook_preprocess_HOOK() for form_element__password. */ -function claro_preprocess_form_element__password(&$variables) { +function claro_preprocess_form_element__password(&$variables): void { if (!empty($variables['element']['#array_parents']) && in_array('pass1', $variables['element']['#array_parents'], TRUE)) { // This is the main password form element. $variables['attributes']['class'][] = 'password-confirm__password'; @@ -1150,14 +1150,14 @@ function claro_preprocess_form_element__password(&$variables) { /** * Implements template_preprocess_HOOK() for filter_tips. */ -function claro_preprocess_filter_tips(&$variables) { +function claro_preprocess_filter_tips(&$variables): void { $variables['#attached']['library'][] = 'filter/drupal.filter'; } /** * Implements template_preprocess_HOOK() for table. */ -function claro_preprocess_table(&$variables) { +function claro_preprocess_table(&$variables): void { // Adding table sort indicator CSS class for inactive sort link. // @todo Revisit after https://www.drupal.org/node/3025726 or // https://www.drupal.org/node/1973418 is in. @@ -1201,7 +1201,7 @@ function claro_preprocess_table(&$variables) { /** * Implements template_preprocess_HOOK() for field_ui_table. */ -function claro_preprocess_field_ui_table(&$variables) { +function claro_preprocess_field_ui_table(&$variables): void { claro_preprocess_table($variables); } @@ -1211,7 +1211,7 @@ function claro_preprocess_field_ui_table(&$variables) { * @todo Revisit after https://www.drupal.org/node/3025726 or * https://www.drupal.org/node/1973418 is in. */ -function claro_preprocess_views_view_table(&$variables) { +function claro_preprocess_views_view_table(&$variables): void { if (!empty($variables['header'])) { foreach ($variables['header'] as &$header_cell) { if (!empty($header_cell['url'])) { @@ -1229,7 +1229,7 @@ function claro_preprocess_views_view_table(&$variables) { /** * Implements hook_preprocess_HOOK() for links__dropbutton. */ -function claro_preprocess_links__dropbutton(&$variables) { +function claro_preprocess_links__dropbutton(&$variables): void { // Add the right CSS class for the dropbutton list that helps reducing FOUC. if (!empty($variables['links'])) { $variables['attributes']['class'][] = count($variables['links']) > 1 @@ -1245,7 +1245,7 @@ function claro_preprocess_links__dropbutton(&$variables) { /** * Implements hook_preprocess_HOOK() for views_ui_display_tab_bucket. */ -function claro_preprocess_views_ui_display_tab_bucket(&$variables) { +function claro_preprocess_views_ui_display_tab_bucket(&$variables): void { // Instead of re-styling Views UI dropbuttons with module-specific CSS styles, // change dropbutton variants to the extra small version. // @todo Revisit after https://www.drupal.org/node/3057581 is added. @@ -1257,7 +1257,7 @@ function claro_preprocess_views_ui_display_tab_bucket(&$variables) { /** * Implements hook_preprocess_HOOK() for status_messages. */ -function claro_preprocess_status_messages(&$variables) { +function claro_preprocess_status_messages(&$variables): void { $variables['title_ids'] = []; foreach ($variables['message_list'] as $message_type => $messages) { $variables['title_ids'][$message_type] = Html::getUniqueId("message-$message_type-title"); @@ -1267,7 +1267,7 @@ function claro_preprocess_status_messages(&$variables) { /** * Implements hook_preprocess_HOOK() for system_themes_page. */ -function claro_preprocess_system_themes_page(&$variables) { +function claro_preprocess_system_themes_page(&$variables): void { if (!empty($variables['theme_groups'])) { foreach ($variables['theme_groups'] as &$theme_group) { if (!empty($theme_group['themes'])) { @@ -1301,7 +1301,7 @@ function claro_preprocess_system_themes_page(&$variables) { /** * Implements hook_preprocess_HOOK() for links__action_links. */ -function claro_preprocess_links__action_links(&$variables) { +function claro_preprocess_links__action_links(&$variables): void { $variables['attributes']['class'][] = 'action-links'; foreach ($variables['links'] as $delta => $link_item) { $variables['links'][$delta]['attributes']->addClass('action-links__item'); @@ -1311,7 +1311,7 @@ function claro_preprocess_links__action_links(&$variables) { /** * Implements hook_preprocess_HOOK() for file_managed_file. */ -function claro_preprocess_file_managed_file(&$variables) { +function claro_preprocess_file_managed_file(&$variables): void { // Produce the same renderable element structure as image widget has. $child_keys = Element::children($variables['element']); foreach ($child_keys as $child_key) { @@ -1324,7 +1324,7 @@ function claro_preprocess_file_managed_file(&$variables) { /** * Implements hook_preprocess_HOOK() for file_widget_multiple. */ -function claro_preprocess_file_widget_multiple(&$variables) { +function claro_preprocess_file_widget_multiple(&$variables): void { $has_upload = FALSE; if (isset($variables['table']['#type']) && $variables['table']['#type'] === 'table') { @@ -1396,7 +1396,7 @@ function claro_preprocess_file_widget_multiple(&$variables) { /** * Implements hook_preprocess_HOOK() for image_widget. */ -function claro_preprocess_image_widget(&$variables) { +function claro_preprocess_image_widget(&$variables): void { // This prevents image widget templates from rendering preview container HTML // to users that do not have permission to access these previews. // @todo Revisit in https://drupal.org/node/953034 @@ -1478,7 +1478,7 @@ function _claro_preprocess_file_and_image_widget(array &$variables) { * This targets each rendered media item in the grid display of the media * library's modal dialog. */ -function claro_preprocess_views_view_fields__media_library(array &$variables) { +function claro_preprocess_views_view_fields__media_library(array &$variables): void { // Add classes to media rendered entity field so it can be targeted for // styling. Adding this class in a template is very difficult to do. if (isset($variables['fields']['rendered_entity']->wrapper_attributes)) { @@ -1543,7 +1543,7 @@ function claro_form_media_library_add_form_oembed_alter(array &$form, FormStateI * This targets each new, unsaved media item added to the media library, before * they are saved. */ -function claro_preprocess_item_list__media_library_add_form_media_list(array &$variables) { +function claro_preprocess_item_list__media_library_add_form_media_list(array &$variables): void { foreach ($variables['items'] as &$item) { $item['value']['preview']['#attributes']['class'][] = 'media-library-add-form__preview'; $item['value']['fields']['#attributes']['class'][] = 'media-library-add-form__fields'; @@ -1569,7 +1569,7 @@ function claro_preprocess_item_list__media_library_add_form_media_list(array &$v * * This targets each media item selected in an entity reference field. */ -function claro_preprocess_media_library_item__widget(array &$variables) { +function claro_preprocess_media_library_item__widget(array &$variables): void { $variables['content']['remove_button']['#attributes']['class'][] = 'media-library-item__remove'; $variables['content']['remove_button']['#attributes']['class'][] = 'icon-link'; } @@ -1580,7 +1580,7 @@ function claro_preprocess_media_library_item__widget(array &$variables) { * This targets each pre-selected media item selected when adding new media in * the modal media library dialog. */ -function claro_preprocess_media_library_item__small(array &$variables) { +function claro_preprocess_media_library_item__small(array &$variables): void { $variables['content']['select']['#attributes']['class'][] = 'media-library-item__click-to-select-checkbox'; } @@ -1590,7 +1590,7 @@ function claro_preprocess_media_library_item__small(array &$variables) { * * @see \Drupal\media_library\Plugin\Field\FieldWidget\MediaLibraryWidget::formElement() */ -function claro_preprocess_fieldset__media_library_widget(array &$variables) { +function claro_preprocess_fieldset__media_library_widget(array &$variables): void { if (isset($variables['prefix']['weight_toggle'])) { $variables['prefix']['weight_toggle']['#attributes']['class'][] = 'action-link'; $variables['prefix']['weight_toggle']['#attributes']['class'][] = 'action-link--extrasmall'; @@ -1664,7 +1664,7 @@ function claro_views_pre_render(ViewExecutable $view) { * @todo Do this in the relevant template once * https://www.drupal.org/project/drupal/issues/3088856 is resolved. */ -function claro_preprocess_links__media_library_menu(array &$variables) { +function claro_preprocess_links__media_library_menu(array &$variables): void { foreach ($variables['links'] as &$link) { // Add a class to the Media Library menu items. $link['attributes']->addClass('media-library-menu__item'); @@ -1790,7 +1790,7 @@ function claro_form_views_ui_add_handler_form_alter(array &$form, FormStateInter * * @see system_preprocess_toolbar() */ -function claro_preprocess_toolbar(&$variables, $hook, $info) { +function claro_preprocess_toolbar(&$variables, $hook, $info): void { $variables['attributes']['data-drupal-claro-processed-toolbar'] = TRUE; } diff --git a/core/themes/olivero/olivero.theme b/core/themes/olivero/olivero.theme index 7a7b2dedb84e..8742715b2f81 100644 --- a/core/themes/olivero/olivero.theme +++ b/core/themes/olivero/olivero.theme @@ -17,7 +17,7 @@ use Drupal\user\UserInterface; * * Adds body classes if certain regions have content. */ -function olivero_preprocess_html(&$variables) { +function olivero_preprocess_html(&$variables): void { if (theme_get_setting('mobile_menu_all_widths') === 1) { $variables['attributes']['class'][] = 'is-always-mobile-nav'; } @@ -49,7 +49,7 @@ function olivero_preprocess_html(&$variables) { /** * Implements hook_preprocess_HOOK() for page title templates. */ -function olivero_preprocess_page_title(&$variables) { +function olivero_preprocess_page_title(&$variables): void { // Since the title and the shortcut link are both block level elements, // positioning them next to each other is much simpler with a wrapper div. if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) { @@ -78,7 +78,7 @@ function olivero_preprocess_page_title(&$variables) { /** * Implements hook_preprocess_HOOK() for maintenance-page.html.twig. */ -function olivero_preprocess_maintenance_page(&$variables) { +function olivero_preprocess_maintenance_page(&$variables): void { // By default, site_name is set to Drupal if no db connection is available // or during site installation. Setting site_name to an empty string makes // the site and update pages look cleaner. @@ -94,7 +94,7 @@ function olivero_preprocess_maintenance_page(&$variables) { /** * Implements hook_preprocess_HOOK() for node.html.twig. */ -function olivero_preprocess_node(&$variables) { +function olivero_preprocess_node(&$variables): void { // Remove the "Add new comment" link on teasers or when the comment form is // displayed on the page. if ($variables['view_mode'] === 'teaser' || !empty($variables['content']['comments']['comment_form'])) { @@ -117,7 +117,7 @@ function olivero_preprocess_node(&$variables) { /** * Implements hook_preprocess_HOOK() for block.html.twig. */ -function olivero_preprocess_block(&$variables) { +function olivero_preprocess_block(&$variables): void { if (!empty($variables['elements']['#id'])) { /** @var \Drupal\block\BlockInterface $block */ $block = \Drupal::entityTypeManager() @@ -171,7 +171,7 @@ function olivero_theme_suggestions_menu_alter(&$suggestions, array $variables) { /** * Implements hook_preprocess_HOOK(). */ -function olivero_preprocess_menu(&$variables) { +function olivero_preprocess_menu(&$variables): void { if (isset($variables['attributes']['region'])) { if ($variables['attributes']['region'] === 'sidebar') { $variables['attributes']['class'][] = 'menu--sidebar'; @@ -240,7 +240,7 @@ function olivero_theme_suggestions_block_alter(&$suggestions, array $variables) /** * Implements hook_preprocess_HOOK() for menu-local-tasks templates. */ -function olivero_preprocess_menu_local_tasks(&$variables) { +function olivero_preprocess_menu_local_tasks(&$variables): void { foreach (Element::children($variables['primary']) as $key) { $variables['primary'][$key]['#level'] = 'primary'; } @@ -252,7 +252,7 @@ function olivero_preprocess_menu_local_tasks(&$variables) { /** * Implements hook_preprocess_form_element(). */ -function olivero_preprocess_form_element(&$variables) { +function olivero_preprocess_form_element(&$variables): void { if (in_array($variables['element']['#type'] ?? FALSE, ['checkbox', 'radio'], TRUE)) { $variables['attributes']['class'][] = 'form-type-boolean'; } @@ -269,14 +269,14 @@ function olivero_preprocess_form_element(&$variables) { /** * Implements hook_preprocess_HOOK(). */ -function olivero_preprocess_form_element_label(&$variables) { +function olivero_preprocess_form_element_label(&$variables): void { $variables['attributes']['class'][] = 'form-item__label'; } /** * Implements hook_preprocess_HOOK(). */ -function olivero_preprocess_input(&$variables) { +function olivero_preprocess_input(&$variables): void { if ( !empty($variables['element']['#title_display']) && $variables['element']['#title_display'] === 'attribute' && @@ -325,7 +325,7 @@ function olivero_preprocess_input(&$variables) { /** * Implements hook_preprocess_HOOK(). */ -function olivero_preprocess_textarea(&$variables) { +function olivero_preprocess_textarea(&$variables): void { $variables['attributes']['class'][] = 'form-element'; $variables['attributes']['class'][] = 'form-element--type-textarea'; $variables['attributes']['class'][] = 'form-element--api-textarea'; @@ -334,7 +334,7 @@ function olivero_preprocess_textarea(&$variables) { /** * Implements hook_preprocess_HOOK(). */ -function olivero_preprocess_select(&$variables) { +function olivero_preprocess_select(&$variables): void { $variables['attributes']['class'][] = 'form-element'; $variables['attributes']['class'][] = $variables['element']['#multiple'] ? 'form-element--type-select-multiple' : @@ -344,21 +344,21 @@ function olivero_preprocess_select(&$variables) { /** * Implements hook_preprocess_HOOK(). */ -function olivero_preprocess_checkboxes(&$variables) { +function olivero_preprocess_checkboxes(&$variables): void { $variables['attributes']['class'][] = 'form-boolean-group'; } /** * Implements hook_preprocess_HOOK(). */ -function olivero_preprocess_radios(&$variables) { +function olivero_preprocess_radios(&$variables): void { $variables['attributes']['class'][] = 'form-boolean-group'; } /** * Implements hook_preprocess_HOOK(). */ -function olivero_preprocess_field(&$variables) { +function olivero_preprocess_field(&$variables): void { $rich_field_types = ['text_with_summary', 'text', 'text_long']; if (in_array($variables['field_type'], $rich_field_types, TRUE)) { @@ -373,7 +373,7 @@ function olivero_preprocess_field(&$variables) { /** * Implements hook_preprocess_HOOK(). */ -function olivero_preprocess_field_multiple_value_form(&$variables) { +function olivero_preprocess_field_multiple_value_form(&$variables): void { // Make disabled available for the template. $variables['disabled'] = !empty($variables['element']['#disabled']); @@ -428,7 +428,7 @@ function olivero_preprocess_field_multiple_value_form(&$variables) { /** * Implements hook_preprocess_HOOK() for menu-local-task templates. */ -function olivero_preprocess_menu_local_task(&$variables) { +function olivero_preprocess_menu_local_task(&$variables): void { $variables['link']['#options']['attributes']['class'][] = 'tabs__link'; $variables['link']['#options']['attributes']['class'][] = 'js-tabs-link'; @@ -447,7 +447,7 @@ function olivero_preprocess_menu_local_task(&$variables) { /** * Implements template_preprocess_HOOK() for fieldset. */ -function olivero_preprocess_fieldset(&$variables) { +function olivero_preprocess_fieldset(&$variables): void { $element = $variables['element']; $composite_types = ['checkboxes', 'radios']; @@ -487,7 +487,7 @@ function olivero_theme_suggestions_user_alter(&$suggestions, $variables) { /** * Implements hook_preprocess_HOOK(). */ -function olivero_preprocess_field__node__created(&$variables) { +function olivero_preprocess_field__node__created(&$variables): void { foreach (Element::children($variables['items']) as $item) { unset($variables['items'][$item]['content']['#prefix']); } @@ -496,7 +496,7 @@ function olivero_preprocess_field__node__created(&$variables) { /** * Implements hook_preprocess_HOOK() for setting classes. */ -function olivero_preprocess_filter_caption(&$variables) { +function olivero_preprocess_filter_caption(&$variables): void { $variables['classes'] = isset($variables['classes']) && !empty($variables['classes']) ? $variables['classes'] . ' caption' : 'caption'; } @@ -514,7 +514,7 @@ function olivero_form_node_preview_form_select_alter(&$form, FormStateInterface /** * Implements hook_preprocess_HOOK() for comment.html.twig. */ -function olivero_preprocess_comment(&$variables) { +function olivero_preprocess_comment(&$variables): void { // Getting the node creation time stamp from the comment object. $date = $variables['comment']->getCreatedTime(); // Formatting "created" as "X days ago". @@ -524,7 +524,7 @@ function olivero_preprocess_comment(&$variables) { /** * Implements hook_preprocess_HOOK() for field--comment.html.twig. */ -function olivero_preprocess_field__comment(&$variables) { +function olivero_preprocess_field__comment(&$variables): void { // Add a comment_count. $variables['comment_count'] = count(array_filter($variables['comments'], 'is_numeric', ARRAY_FILTER_USE_KEY)); @@ -560,7 +560,7 @@ function olivero_element_info_alter(&$info) { * * @todo Remove when https://www.drupal.org/node/3016343 is fixed. */ -function olivero_preprocess_text_format_wrapper(&$variables) { +function olivero_preprocess_text_format_wrapper(&$variables): void { $description_attributes = []; if (!empty($variables['attributes']['id'])) { $description_attributes['id'] = $variables['attributes']['aria-describedby'] = $variables['attributes']['id']; @@ -572,7 +572,7 @@ function olivero_preprocess_text_format_wrapper(&$variables) { /** * Implements hook_preprocess_search_result(). */ -function olivero_preprocess_search_result(&$variables) { +function olivero_preprocess_search_result(&$variables): void { // Apply custom date formatter to "date" field. if (!empty($variables['result']['date'])) { $variables['info_date'] = \Drupal::service('date.formatter')->format($variables['result']['node']->getCreatedTime(), 'olivero_medium'); @@ -582,7 +582,7 @@ function olivero_preprocess_search_result(&$variables) { /** * Implements hook_preprocess_item_list__search_results(). */ -function olivero_preprocess_item_list__search_results(&$variables) { +function olivero_preprocess_item_list__search_results(&$variables): void { if (isset($variables['empty'])) { $variables['empty']['#attributes']['class'][] = 'empty-search-results-text'; $variables['empty']['#attached']['library'][] = 'olivero/search-results'; @@ -592,7 +592,7 @@ function olivero_preprocess_item_list__search_results(&$variables) { /** * Implements hook_preprocess_links__comment(). */ -function olivero_preprocess_links__comment(&$variables) { +function olivero_preprocess_links__comment(&$variables): void { foreach ($variables['links'] as &$link) { $link['link']['#options']['attributes']['class'][] = 'comment__links-link'; } @@ -601,7 +601,7 @@ function olivero_preprocess_links__comment(&$variables) { /** * Implements hook_preprocess_table(). */ -function olivero_preprocess_table(&$variables) { +function olivero_preprocess_table(&$variables): void { // Mark the whole table and the first cells if rows are draggable. if (!empty($variables['rows'])) { $draggable_row_found = FALSE; diff --git a/core/themes/stable9/stable9.theme b/core/themes/stable9/stable9.theme index 228e3ff0e95f..c40f668b15c5 100644 --- a/core/themes/stable9/stable9.theme +++ b/core/themes/stable9/stable9.theme @@ -10,7 +10,7 @@ * * Converts the markup of #empty for search results. */ -function stable9_preprocess_item_list__search_results(&$variables) { +function stable9_preprocess_item_list__search_results(&$variables): void { if (isset($variables['empty']['#tag'])) { $variables['empty']['#tag'] = 'h3'; } @@ -21,7 +21,7 @@ function stable9_preprocess_item_list__search_results(&$variables) { * * Adds BC classes that were previously added by the Views module. */ -function stable9_preprocess_views_view(&$variables) { +function stable9_preprocess_views_view(&$variables): void { if (!empty($variables['attributes']['class'])) { $bc_classes = preg_replace('/[^a-zA-Z0-9- ]/', '-', $variables['attributes']['class']); $variables['attributes']['class'] = array_merge($variables['attributes']['class'], $bc_classes); diff --git a/core/themes/starterkit_theme/starterkit_theme.theme b/core/themes/starterkit_theme/starterkit_theme.theme index 4c896d710978..30dd15cf9fbe 100644 --- a/core/themes/starterkit_theme/starterkit_theme.theme +++ b/core/themes/starterkit_theme/starterkit_theme.theme @@ -8,7 +8,7 @@ /** * Implements hook_preprocess_image_widget(). */ -function starterkit_theme_preprocess_image_widget(array &$variables) { +function starterkit_theme_preprocess_image_widget(array &$variables): void { $data = &$variables['data']; // This prevents image widget templates from rendering preview container HTML |