diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php index 77874ce9a17..7cce357cc46 100644 --- a/core/.phpstan-baseline.php +++ b/core/.phpstan-baseline.php @@ -12166,12 +12166,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/announcements_feed/announcements_feed.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function announcements_feed_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/announcements_feed/announcements_feed.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function announcements_feed_toolbar\\(\\) has no return type specified\\.$#', @@ -12346,12 +12340,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/big_pipe/big_pipe.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function big_pipe_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/big_pipe/big_pipe.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function big_pipe_theme_suggestions_big_pipe_interface_preview\\(\\) has no return type specified\\.$#', @@ -12442,12 +12430,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/big_pipe/tests/modules/big_pipe_bypass_js/big_pipe_bypass_js.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function big_pipe_regression_test_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/big_pipe/tests/modules/big_pipe_regression_test/big_pipe_regression_test.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Method Drupal\\\\big_pipe_regression_test\\\\BigPipeRegressionTestController\\:\\:largeContent\\(\\) has no return type specified\\.$#', @@ -12580,12 +12562,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/block/block.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function block_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/block/block.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function block_theme_initialize\\(\\) has no return type specified\\.$#', @@ -13066,12 +13042,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/block_content/block_content.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function block_content_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/block_content/block_content.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function block_content_theme_suggestions_block_alter\\(\\) has no return type specified\\.$#', @@ -13666,12 +13636,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/ckeditor5/ckeditor5.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function ckeditor5_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/ckeditor5/ckeditor5.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function ckeditor5_removed_post_updates\\(\\) has no return type specified\\.$#', @@ -14542,12 +14506,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/comment/comment.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function comment_theme\\(\\) 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\\.$#', @@ -16210,12 +16168,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/config_translation/config_translation.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function config_translation_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/config_translation/config_translation.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function config_translation_themes_installed\\(\\) has no return type specified\\.$#', @@ -17212,12 +17164,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/content_moderation/content_moderation.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function content_moderation_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/content_moderation/content_moderation.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function content_moderation_views_post_execute\\(\\) has no return type specified\\.$#', @@ -21226,12 +21172,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/field_ui/field_ui.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function field_ui_theme\\(\\) 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\\.$#', @@ -21874,12 +21814,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/file/file.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function file_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/file/file.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function file_token_info\\(\\) has no return type specified\\.$#', @@ -23122,12 +23056,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/filter/filter.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function filter_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/filter/filter.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function template_preprocess_filter_guidelines\\(\\) has no return type specified\\.$#', @@ -23524,12 +23452,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/help/help.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function help_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/help/help.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function help_themes_installed\\(\\) has no return type specified\\.$#', @@ -23950,12 +23872,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/image/image.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function image_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/image/image.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function template_preprocess_image_style\\(\\) has no return type specified\\.$#', @@ -25774,12 +25690,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/language/language.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function language_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/language/language.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function language_tour_tips_alter\\(\\) has no return type specified\\.$#', @@ -27628,12 +27538,6 @@ $ignoreErrors[] = [ '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_theme\\(\\) 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\\\\Plugin\\\\Block\\\\TestAjaxBlock\\:\\:ajaxCallback\\(\\) has no return type specified\\.$#', @@ -27712,12 +27616,6 @@ $ignoreErrors[] = [ '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' => '#^Function layout_builder_theme_suggestions_test_theme\\(\\) 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\\.$#', @@ -28270,12 +28168,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/layout_discovery/layout_discovery.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function layout_discovery_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/layout_discovery/layout_discovery.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function template_preprocess_layout\\(\\) has no return type specified\\.$#', @@ -28312,12 +28204,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/link/link.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function link_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/link/link.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function template_preprocess_link_formatter_link_separate\\(\\) has no return type specified\\.$#', @@ -28738,12 +28624,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/locale/locale.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function locale_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/locale/locale.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function locale_themes_installed\\(\\) has no return type specified\\.$#', @@ -29284,12 +29164,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/locale/tests/modules/locale_test/locale_test.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function locale_test_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/locale/tests/modules/locale_test/locale_test.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function locale_test_token_info\\(\\) has no return type specified\\.$#', @@ -29650,12 +29524,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/media/media.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function media_theme\\(\\) 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\\.$#', @@ -30712,12 +30580,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/media_library/media_library.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function media_library_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/media_library/media_library.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function media_library_views_post_render\\(\\) has no return type specified\\.$#', @@ -34122,12 +33984,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/navigation/navigation.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function navigation_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/navigation/navigation.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function navigation_post_update_set_logo_dimensions_default\\(\\) has no return type specified\\.$#', @@ -34458,12 +34314,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/node/node.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function node_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/node/node.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function node_theme_suggestions_node\\(\\) has no return type specified\\.$#', @@ -37302,12 +37152,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/responsive_image/responsive_image.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function responsive_image_theme\\(\\) 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\\(\\) has no return type specified\\.$#', @@ -38190,12 +38034,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/search/search.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function search_theme\\(\\) 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\\.$#', @@ -40794,12 +40632,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/system/system.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function system_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/system.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function system_theme_registry_alter\\(\\) has no return type specified\\.$#', @@ -41544,12 +41376,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/modules/common_test/common_test.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function common_test_theme\\(\\) 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\\.$#', @@ -41724,12 +41550,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/modules/deprecated_module_test/deprecated_module_test.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function deprecated_twig_template_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/deprecated_twig_template/deprecated_twig_template.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function deprecation_test_deprecated_alter_alter\\(\\) has no return type specified\\.$#', @@ -45657,12 +45477,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/modules/theme_test/theme_test.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function theme_test_theme\\(\\) 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_registry_alter\\(\\) has no return type specified\\.$#', @@ -45735,12 +45549,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/modules/twig_extension_test/src/TwigExtensionTestController.php', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function twig_extension_test_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/twig_extension_test/twig_extension_test.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Method Drupal\\\\twig_theme_test\\\\TwigThemeTestController\\:\\:attachLibraryRender\\(\\) has no return type specified\\.$#', @@ -45825,12 +45633,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/modules/twig_theme_test/twig_theme_test.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function twig_theme_test_theme\\(\\) 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' => '#^Function unique_field_constraint_test_entity_base_field_info_alter\\(\\) has no return type specified\\.$#', @@ -45975,12 +45777,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/modules/update_test_3/update_test_3.install', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function update_test_broken_theme_hook_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/modules/update_test_broken_theme_hook/update_test_broken_theme_hook.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function update_test_description_update_8001\\(\\) has no return type specified\\.$#', @@ -48099,12 +47895,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/themes/engines/nyan_cat/nyan_cat.engine', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function nyan_cat_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/themes/engines/nyan_cat/nyan_cat.engine', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function test_subsubtheme_preprocess_theme_test_template_test\\(\\) has no return type specified\\.$#', @@ -48783,12 +48573,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/taxonomy/taxonomy.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function taxonomy_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/taxonomy/taxonomy.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function taxonomy_theme_suggestions_taxonomy_term\\(\\) has no return type specified\\.$#', @@ -49641,12 +49425,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/toolbar/toolbar.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function toolbar_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/toolbar/toolbar.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function toolbar_toolbar\\(\\) has no return type specified\\.$#', @@ -50157,12 +49935,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/update/update.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function update_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/update/update.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function update_themes_installed\\(\\) has no return type specified\\.$#', @@ -51981,12 +51753,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/user/user.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function user_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/user/user.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function user_toolbar\\(\\) has no return type specified\\.$#', @@ -60513,12 +60279,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/views/views.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function views_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/views.module', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function views_theme_suggestions_comment_alter\\(\\) has no return type specified\\.$#', @@ -61455,12 +61215,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/modules/views_ui/views_ui.module', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function views_ui_theme\\(\\) 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\\.$#', @@ -71552,12 +71306,6 @@ $ignoreErrors[] = [ 'count' => 1, 'path' => __DIR__ . '/themes/engines/twig/twig.engine', ]; -$ignoreErrors[] = [ - // identifier: missingType.return - 'message' => '#^Function twig_theme\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/themes/engines/twig/twig.engine', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Function olivero_removed_post_updates\\(\\) has no return type specified\\.$#', diff --git a/core/lib/Drupal/Core/Render/theme.api.php b/core/lib/Drupal/Core/Render/theme.api.php index fa447c20063..3a9354c7549 100644 --- a/core/lib/Drupal/Core/Render/theme.api.php +++ b/core/lib/Drupal/Core/Render/theme.api.php @@ -1248,7 +1248,7 @@ function hook_page_bottom(array &$page_bottom) { * @see themeable * @see hook_theme_registry_alter() */ -function hook_theme($existing, $type, $theme, $path) { +function hook_theme($existing, $type, $theme, $path): array { return [ 'my_module_display' => [ 'variables' => [ diff --git a/core/modules/announcements_feed/announcements_feed.module b/core/modules/announcements_feed/announcements_feed.module index dafa74ec3e5..1a5406cbc0e 100644 --- a/core/modules/announcements_feed/announcements_feed.module +++ b/core/modules/announcements_feed/announcements_feed.module @@ -87,7 +87,7 @@ function announcements_feed_toolbar_alter(&$items) { /** * Implements hook_theme(). */ -function announcements_feed_theme($existing, $type, $theme, $path) { +function announcements_feed_theme($existing, $type, $theme, $path): array { return [ 'announcements_feed' => [ 'variables' => [ diff --git a/core/modules/big_pipe/big_pipe.module b/core/modules/big_pipe/big_pipe.module index 1eac8c5baa3..aff90f945f8 100644 --- a/core/modules/big_pipe/big_pipe.module +++ b/core/modules/big_pipe/big_pipe.module @@ -80,7 +80,7 @@ function big_pipe_page_attachments(array &$page) { /** * Implements hook_theme(). */ -function big_pipe_theme() { +function big_pipe_theme(): array { return [ 'big_pipe_interface_preview' => [ 'variables' => [ diff --git a/core/modules/big_pipe/tests/modules/big_pipe_regression_test/big_pipe_regression_test.module b/core/modules/big_pipe/tests/modules/big_pipe_regression_test/big_pipe_regression_test.module index 850313babee..aed08ec5f00 100644 --- a/core/modules/big_pipe/tests/modules/big_pipe_regression_test/big_pipe_regression_test.module +++ b/core/modules/big_pipe/tests/modules/big_pipe_regression_test/big_pipe_regression_test.module @@ -12,7 +12,7 @@ declare(strict_types=1); * * @see \Drupal\Tests\big_pipe\FunctionalJavascript\BigPipeRegressionTest::testBigPipeLargeContent */ -function big_pipe_regression_test_theme() { +function big_pipe_regression_test_theme(): array { return [ 'big_pipe_test_large_content' => [ 'variables' => [], diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 75ac30ab60c..eac594c0165 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -54,7 +54,7 @@ function block_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function block_theme() { +function block_theme(): array { return [ 'block' => [ 'render element' => 'elements', diff --git a/core/modules/block_content/block_content.module b/core/modules/block_content/block_content.module index 00fc5a5320d..3c0b72db128 100644 --- a/core/modules/block_content/block_content.module +++ b/core/modules/block_content/block_content.module @@ -40,7 +40,7 @@ function block_content_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function block_content_theme($existing, $type, $theme, $path) { +function block_content_theme($existing, $type, $theme, $path): array { return [ 'block_content_add_list' => [ 'variables' => ['content' => NULL], diff --git a/core/modules/ckeditor5/ckeditor5.module b/core/modules/ckeditor5/ckeditor5.module index 0c6c44938d8..e79e3fbdb27 100644 --- a/core/modules/ckeditor5/ckeditor5.module +++ b/core/modules/ckeditor5/ckeditor5.module @@ -78,7 +78,7 @@ function ckeditor5_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function ckeditor5_theme() { +function ckeditor5_theme(): array { return [ // The theme hook is used for rendering the CKEditor 5 toolbar settings in // the Drupal admin UI. The toolbar settings UI is internal, and utilizing diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 0928695ed15..8a356efe151 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -110,7 +110,7 @@ function comment_entity_extra_field_info() { /** * Implements hook_theme(). */ -function comment_theme() { +function comment_theme(): array { return [ 'comment' => [ 'render element' => 'elements', diff --git a/core/modules/config_translation/config_translation.module b/core/modules/config_translation/config_translation.module index 5e8482752a6..7705edfc23e 100644 --- a/core/modules/config_translation/config_translation.module +++ b/core/modules/config_translation/config_translation.module @@ -40,7 +40,7 @@ function config_translation_help($route_name, RouteMatchInterface $route_match) /** * Implements hook_theme(). */ -function config_translation_theme() { +function config_translation_theme(): array { return [ 'config_translation_manage_form_element' => [ 'render element' => 'element', diff --git a/core/modules/content_moderation/content_moderation.module b/core/modules/content_moderation/content_moderation.module index 71bb1025398..4f726768bd1 100644 --- a/core/modules/content_moderation/content_moderation.module +++ b/core/modules/content_moderation/content_moderation.module @@ -275,7 +275,7 @@ function content_moderation_entity_field_access($operation, FieldDefinitionInter /** * Implements hook_theme(). */ -function content_moderation_theme() { +function content_moderation_theme(): array { return ['entity_moderation_form' => ['render element' => 'form']]; } diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index 3e5d38c1e52..eb4b896a19d 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -50,7 +50,7 @@ function field_ui_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function field_ui_theme() { +function field_ui_theme(): array { return [ 'field_ui_table' => [ 'variables' => [ diff --git a/core/modules/file/file.module b/core/modules/file/file.module index 452f573e55b..65584c747cd 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -90,7 +90,7 @@ function file_get_content_headers(FileInterface $file) { /** * Implements hook_theme(). */ -function file_theme() { +function file_theme(): array { return [ // From file.module. 'file_link' => [ diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index 09367b65c1b..e3fbaafdfda 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -55,7 +55,7 @@ function filter_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function filter_theme() { +function filter_theme(): array { return [ 'filter_tips' => [ 'variables' => ['tips' => NULL, 'long' => FALSE], diff --git a/core/modules/help/help.module b/core/modules/help/help.module index 659ad8d9417..7e0d8070447 100644 --- a/core/modules/help/help.module +++ b/core/modules/help/help.module @@ -65,7 +65,7 @@ function help_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function help_theme($existing, $type, $theme, $path) { +function help_theme($existing, $type, $theme, $path): array { return [ 'help_section' => [ 'variables' => [ diff --git a/core/modules/image/image.module b/core/modules/image/image.module index 2fe43be3643..6807f2c02b7 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -66,7 +66,7 @@ function image_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function image_theme() { +function image_theme(): array { return [ // Theme functions in image.module. 'image_style' => [ diff --git a/core/modules/language/language.module b/core/modules/language/language.module index 1e2064ae8aa..38e74e68473 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -102,7 +102,7 @@ function language_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function language_theme() { +function language_theme(): array { return [ 'language_negotiation_configure_form' => [ 'render element' => 'form', 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 aae30c4b9d7..cc50fb67bed 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 @@ -182,7 +182,7 @@ function layout_builder_test_module_implements_alter(&$implementations, $hook) { /** * Implements hook_theme(). */ -function layout_builder_test_theme() { +function layout_builder_test_theme(): array { return [ 'block__preview_aware_block' => [ 'base hook' => 'block', 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 53d6b1083eb..00cdc82c18f 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_theme(). */ -function layout_builder_theme_suggestions_test_theme() { +function layout_builder_theme_suggestions_test_theme(): array { // It is necessary to explicitly register the template via hook_theme() // because it is added via a module, not a theme. return [ diff --git a/core/modules/layout_discovery/layout_discovery.module b/core/modules/layout_discovery/layout_discovery.module index 02bedc53534..9411244371d 100644 --- a/core/modules/layout_discovery/layout_discovery.module +++ b/core/modules/layout_discovery/layout_discovery.module @@ -24,7 +24,7 @@ function layout_discovery_help($route_name) { /** * Implements hook_theme(). */ -function layout_discovery_theme() { +function layout_discovery_theme(): array { return \Drupal::service('plugin.manager.core.layout')->getThemeImplementations(); } diff --git a/core/modules/link/link.module b/core/modules/link/link.module index fdc94e287e9..27bbaead958 100644 --- a/core/modules/link/link.module +++ b/core/modules/link/link.module @@ -41,7 +41,7 @@ function link_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function link_theme() { +function link_theme(): array { return [ 'link_formatter_link_separate' => [ 'variables' => ['title' => NULL, 'url_title' => NULL, 'url' => NULL], diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index 9124aa29cc7..5f1b6275ee6 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -188,7 +188,7 @@ function locale_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function locale_theme() { +function locale_theme(): array { return [ 'locale_translation_last_check' => [ 'variables' => ['last' => NULL], diff --git a/core/modules/locale/tests/modules/locale_test/locale_test.module b/core/modules/locale/tests/modules/locale_test/locale_test.module index be4a8318f5c..d35a2db70e1 100644 --- a/core/modules/locale/tests/modules/locale_test/locale_test.module +++ b/core/modules/locale/tests/modules/locale_test/locale_test.module @@ -162,7 +162,7 @@ function locale_test_language_fallback_candidates_locale_lookup_alter(array &$ca /** * Implements hook_theme(). */ -function locale_test_theme() { +function locale_test_theme(): array { $return = []; $return['locale_test_tokenized'] = [ diff --git a/core/modules/media/media.module b/core/modules/media/media.module index 9267942e9e9..6923cd948d0 100644 --- a/core/modules/media/media.module +++ b/core/modules/media/media.module @@ -67,7 +67,7 @@ function media_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function media_theme() { +function media_theme(): array { return [ 'media' => [ 'render element' => 'elements', diff --git a/core/modules/media_library/media_library.module b/core/modules/media_library/media_library.module index 34865772eb8..1722a4688ea 100644 --- a/core/modules/media_library/media_library.module +++ b/core/modules/media_library/media_library.module @@ -100,7 +100,7 @@ function media_library_media_source_info_alter(array &$sources) { /** * Implements hook_theme(). */ -function media_library_theme() { +function media_library_theme(): array { return [ 'media__media_library' => [ 'base hook' => 'media', diff --git a/core/modules/navigation/navigation.module b/core/modules/navigation/navigation.module index 578b73205e9..01ff7c75aae 100644 --- a/core/modules/navigation/navigation.module +++ b/core/modules/navigation/navigation.module @@ -87,7 +87,7 @@ function navigation_module_implements_alter(&$implementations, $hook) { /** * Implements hook_theme(). */ -function navigation_theme($existing, $type, $theme, $path) { +function navigation_theme($existing, $type, $theme, $path): array { $items['top_bar'] = [ 'variables' => [ 'local_tasks' => [], diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 2c897fb9fb3..c9013d33e02 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -104,7 +104,7 @@ function node_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function node_theme() { +function node_theme(): array { return [ 'node' => [ 'render element' => 'elements', diff --git a/core/modules/responsive_image/responsive_image.module b/core/modules/responsive_image/responsive_image.module index 864f52dbfbe..c1c0ce94ae3 100644 --- a/core/modules/responsive_image/responsive_image.module +++ b/core/modules/responsive_image/responsive_image.module @@ -52,7 +52,7 @@ function responsive_image_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function responsive_image_theme() { +function responsive_image_theme(): array { return [ 'responsive_image' => [ 'variables' => [ diff --git a/core/modules/search/search.module b/core/modules/search/search.module index 0944c53dcfe..5e94452041e 100644 --- a/core/modules/search/search.module +++ b/core/modules/search/search.module @@ -43,7 +43,7 @@ function search_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function search_theme() { +function search_theme(): array { return [ 'search_result' => [ 'variables' => ['result' => NULL, 'plugin_id' => NULL], diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 50c90b57721..ab34a12863c 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -151,7 +151,7 @@ function system_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function system_theme() { +function system_theme(): array { return array_merge(drupal_common_theme(), [ // Normally theme suggestion templates are only picked up when they are in // themes. We explicitly define theme suggestions here so that the block 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 db95c4e05af..3c62ad003c1 100644 --- a/core/modules/system/tests/modules/common_test/common_test.module +++ b/core/modules/system/tests/modules/common_test/common_test.module @@ -108,7 +108,7 @@ function common_test_module_implements_alter(&$implementations, $hook) { /** * Implements hook_theme(). */ -function common_test_theme() { +function common_test_theme(): array { return [ 'common_test_foo' => [ 'variables' => ['foo' => 'foo', 'bar' => 'bar'], diff --git a/core/modules/system/tests/modules/deprecated_twig_template/deprecated_twig_template.module b/core/modules/system/tests/modules/deprecated_twig_template/deprecated_twig_template.module index 1309c3b9b7b..cdac30dab65 100644 --- a/core/modules/system/tests/modules/deprecated_twig_template/deprecated_twig_template.module +++ b/core/modules/system/tests/modules/deprecated_twig_template/deprecated_twig_template.module @@ -10,7 +10,7 @@ declare(strict_types=1); /** * Implements hook_theme(). */ -function deprecated_twig_template_theme() { +function deprecated_twig_template_theme(): array { return [ 'deprecated_template' => [ 'variables' => [ 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 545c0141e1e..1f4dca68c3d 100644 --- a/core/modules/system/tests/modules/theme_test/theme_test.module +++ b/core/modules/system/tests/modules/theme_test/theme_test.module @@ -13,7 +13,7 @@ use Drupal\Core\Extension\Extension; /** * Implements hook_theme(). */ -function theme_test_theme($existing, $type, $theme, $path) { +function theme_test_theme($existing, $type, $theme, $path): array { $items['theme_test'] = [ 'file' => 'theme_test.inc', 'variables' => ['foo' => ''], diff --git a/core/modules/system/tests/modules/twig_extension_test/twig_extension_test.module b/core/modules/system/tests/modules/twig_extension_test/twig_extension_test.module index 149cb41354e..44e8d9ecf8e 100644 --- a/core/modules/system/tests/modules/twig_extension_test/twig_extension_test.module +++ b/core/modules/system/tests/modules/twig_extension_test/twig_extension_test.module @@ -10,7 +10,7 @@ declare(strict_types=1); /** * Implements hook_theme(). */ -function twig_extension_test_theme($existing, $type, $theme, $path) { +function twig_extension_test_theme($existing, $type, $theme, $path): array { return [ 'twig_extension_test_filter' => [ 'variables' => ['message' => NULL, 'safe_join_items' => NULL], 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 4e2fc05a302..70893327557 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 @@ -10,7 +10,7 @@ declare(strict_types=1); /** * Implements hook_theme(). */ -function twig_theme_test_theme($existing, $type, $theme, $path) { +function twig_theme_test_theme($existing, $type, $theme, $path): array { $items['twig_theme_test_filter'] = [ 'variables' => ['quote' => [], 'attributes' => []], 'template' => 'twig_theme_test.filter', diff --git a/core/modules/system/tests/modules/update_test_broken_theme_hook/update_test_broken_theme_hook.module b/core/modules/system/tests/modules/update_test_broken_theme_hook/update_test_broken_theme_hook.module index 76bcd999b70..9bbc73f8b75 100644 --- a/core/modules/system/tests/modules/update_test_broken_theme_hook/update_test_broken_theme_hook.module +++ b/core/modules/system/tests/modules/update_test_broken_theme_hook/update_test_broken_theme_hook.module @@ -10,6 +10,6 @@ declare(strict_types=1); /** * Implements hook_theme(). */ -function update_test_broken_theme_hook_theme($existing, $type, $theme, $path) { +function update_test_broken_theme_hook_theme($existing, $type, $theme, $path): array { throw new \Exception('This mimics an exception caused by unstable dependencies.'); } diff --git a/core/modules/system/tests/themes/engines/nyan_cat/nyan_cat.engine b/core/modules/system/tests/themes/engines/nyan_cat/nyan_cat.engine index 423dcae8115..ec74b2aa163 100644 --- a/core/modules/system/tests/themes/engines/nyan_cat/nyan_cat.engine +++ b/core/modules/system/tests/themes/engines/nyan_cat/nyan_cat.engine @@ -14,7 +14,7 @@ use Drupal\Component\Utility\Html; /** * Implements hook_theme(). */ -function nyan_cat_theme($existing, $type, $theme, $path) { +function nyan_cat_theme($existing, $type, $theme, $path): array { return drupal_find_theme_templates($existing, '.nyan-cat.html', $path); } diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index e98b465cc3e..0dbfae0cb5c 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -49,7 +49,7 @@ function taxonomy_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function taxonomy_theme() { +function taxonomy_theme(): array { return [ 'taxonomy_term' => [ 'render element' => 'elements', diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module index ff395da0fcf..57dc701ef88 100644 --- a/core/modules/toolbar/toolbar.module +++ b/core/modules/toolbar/toolbar.module @@ -36,7 +36,7 @@ function toolbar_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function toolbar_theme($existing, $type, $theme, $path) { +function toolbar_theme($existing, $type, $theme, $path): array { $items['toolbar'] = [ 'render element' => 'element', ]; diff --git a/core/modules/update/update.module b/core/modules/update/update.module index 11c8fcb6135..9bd58f98e14 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -132,7 +132,7 @@ function _update_manager_access() { /** * Implements hook_theme(). */ -function update_theme() { +function update_theme(): array { return [ 'update_last_check' => [ 'variables' => ['last' => 0], diff --git a/core/modules/user/user.module b/core/modules/user/user.module index ad4002c9c09..6644b9bd5ea 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -78,7 +78,7 @@ function user_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_theme(). */ -function user_theme() { +function user_theme(): array { return [ 'user' => [ 'render element' => 'elements', diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 58f87e70eff..84bec7df7a1 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -80,7 +80,7 @@ function views_views_pre_render($view) { * Register views theming functions and those that are defined via views plugin * definitions. */ -function views_theme($existing, $type, $theme, $path) { +function views_theme($existing, $type, $theme, $path): array { \Drupal::moduleHandler()->loadInclude('views', 'inc', 'views.theme'); // Some quasi clever array merging here. diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module index f008218525d..face0734d40 100644 --- a/core/modules/views_ui/views_ui.module +++ b/core/modules/views_ui/views_ui.module @@ -63,7 +63,7 @@ function views_ui_entity_type_build(array &$entity_types) { /** * Implements hook_theme(). */ -function views_ui_theme() { +function views_ui_theme(): array { return [ // Edit a view 'views_ui_display_tab_setting' => [ diff --git a/core/themes/engines/twig/twig.engine b/core/themes/engines/twig/twig.engine index 45a95cae786..d8a5a65dc55 100644 --- a/core/themes/engines/twig/twig.engine +++ b/core/themes/engines/twig/twig.engine @@ -12,7 +12,7 @@ use Twig\Error\RuntimeError; /** * Implements hook_theme(). */ -function twig_theme($existing, $type, $theme, $path) { +function twig_theme($existing, $type, $theme, $path): array { return drupal_find_theme_templates($existing, '.html.twig', $path); }