Issue #3483065 by nicxvan, mstrelan: Add void return type to all hook_form_alter, hook_form_FORM_ID_alter and hook_form_BASE_FORM_ID_alter implementations

(cherry picked from commit d5437bd5d8c29e8e3d14598104423c1ed82dec95)
merge-requests/10228/head
catch 2024-11-13 16:53:16 +00:00
parent 546aee1a98
commit 5e722c4266
51 changed files with 92 additions and 626 deletions

View File

@ -12196,12 +12196,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/announcements_feed/tests/src/Kernel/AnnounceFetcherUserTest.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function automated_cron_form_system_cron_settings_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/automated_cron/automated_cron.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function automated_cron_help\\(\\) has no return type specified\\.$#',
@ -13576,12 +13570,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/ckeditor5/ckeditor5.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function ckeditor5_form_filter_format_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/ckeditor5/ckeditor5.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function ckeditor5_help\\(\\) has no return type specified\\.$#',
@ -14404,24 +14392,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/comment/comment.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function comment_form_field_ui_display_overview_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/comment/comment.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function comment_form_field_ui_field_storage_add_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/comment/comment.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function comment_form_field_ui_form_display_overview_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/comment/comment.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function comment_help\\(\\) has no return type specified\\.$#',
@ -16318,24 +16288,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/config_translation/tests/modules/config_translation_test/config_translation_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function config_translation_test_form_config_translation_add_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/config_translation/tests/modules/config_translation_test/config_translation_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function config_translation_test_form_config_translation_edit_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/config_translation/tests/modules/config_translation_test/config_translation_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function config_translation_test_form_config_translation_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/config_translation/tests/modules/config_translation_test/config_translation_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function config_translation_test_system_info_alter\\(\\) has no return type specified\\.$#',
@ -16408,24 +16360,12 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/contact/contact.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function contact_form_user_admin_settings_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/contact/contact.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function contact_form_user_admin_settings_submit\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/contact/contact.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function contact_form_user_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/contact/contact.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function contact_help\\(\\) has no return type specified\\.$#',
@ -16624,12 +16564,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/contact/tests/modules/contact_storage_test/contact_storage_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function contact_storage_test_form_contact_form_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/contact/tests/modules/contact_storage_test/contact_storage_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Method Drupal\\\\Tests\\\\contact\\\\Functional\\\\ContactPersonalTest\\:\\:assertCacheContext\\(\\) has no return type specified\\.$#',
@ -17044,12 +16978,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/content_moderation/content_moderation.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function content_moderation_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/content_moderation/content_moderation.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function content_moderation_help\\(\\) has no return type specified\\.$#',
@ -18118,12 +18046,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/content_moderation/tests/src/Unit/StateTransitionValidationTest.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function _content_translation_form_language_content_settings_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/content_translation/content_translation.admin.inc',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function _content_translation_preprocess_language_content_settings_table\\(\\) has no return type specified\\.$#',
@ -18214,24 +18136,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/content_translation/content_translation.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function content_translation_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/content_translation/content_translation.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function content_translation_form_field_config_edit_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/content_translation/content_translation.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function content_translation_form_language_content_settings_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/content_translation/content_translation.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function content_translation_help\\(\\) has no return type specified\\.$#',
@ -18532,12 +18436,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/content_translation/tests/modules/content_translation_test/content_translation_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function content_translation_test_form_node_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/content_translation/tests/modules/content_translation_test/content_translation_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function content_translation_test_form_node_form_submit\\(\\) has no return type specified\\.$#',
@ -19168,12 +19066,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/dblog/dblog.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function dblog_form_system_logging_settings_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/dblog/dblog.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function dblog_help\\(\\) has no return type specified\\.$#',
@ -19438,18 +19330,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/editor/editor.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function editor_form_filter_admin_overview_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/editor/editor.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function editor_form_filter_format_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/editor/editor.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function editor_help\\(\\) has no return type specified\\.$#',
@ -19696,12 +19576,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/field/field.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function field_form_config_admin_import_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/field/field.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function field_form_field_config_edit_form_entity_builder\\(\\) has no return type specified\\.$#',
@ -20746,12 +20620,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/field_layout/field_layout.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function field_layout_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/field_layout/field_layout.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function field_layout_help\\(\\) has no return type specified\\.$#',
@ -20926,18 +20794,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/field_ui/field_ui.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function field_ui_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/field_ui/field_ui.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function field_ui_form_field_ui_field_storage_add_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/field_ui/field_ui.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function field_ui_form_manage_field_form_submit\\(\\) has no return type specified\\.$#',
@ -21322,24 +21178,12 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function field_ui_test_form_entity_view_display_edit_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function field_ui_test_region_callback\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function field_ui_test_deprecated_form_field_storage_config_edit_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/field_ui/tests/modules/field_ui_test_deprecated/field_ui_test_deprecated.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Method Drupal\\\\Tests\\\\field_ui\\\\Functional\\\\FieldUIDeleteTest\\:\\:assertFieldDoesNotExist\\(\\) has no return type specified\\.$#',
@ -21580,12 +21424,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/file/file.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function file_form_system_file_system_settings_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/file/file.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function file_help\\(\\) has no return type specified\\.$#',
@ -25390,12 +25228,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/language/language.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function language_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/language/language.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function language_help\\(\\) has no return type specified\\.$#',
@ -26428,12 +26260,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/layout_builder/layout_builder.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function layout_builder_form_entity_form_display_edit_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/layout_builder/layout_builder.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function layout_builder_help\\(\\) has no return type specified\\.$#',
@ -27208,18 +27034,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_form_layout_builder_configure_block_alter\\(\\) 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_form_layout_builder_configure_section_alter\\(\\) 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_module_implements_alter\\(\\) has no return type specified\\.$#',
@ -28234,42 +28048,18 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/locale/locale.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function locale_form_language_admin_add_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/locale/locale.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function locale_form_language_admin_add_form_alter_submit\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/locale/locale.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function locale_form_language_admin_edit_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/locale/locale.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function locale_form_language_admin_edit_form_alter_submit\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/locale/locale.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function locale_form_language_admin_overview_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/locale/locale.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function locale_form_system_file_system_settings_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/locale/locale.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function locale_help\\(\\) has no return type specified\\.$#',
@ -29194,24 +28984,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/media/media.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function media_form_field_ui_field_storage_add_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/media/media.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function media_form_filter_format_add_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/media/media.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function media_form_filter_format_edit_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/media/media.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function media_help\\(\\) has no return type specified\\.$#',
@ -30220,18 +29992,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/media_library/media_library.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function media_library_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/media_library/media_library.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function media_library_form_views_form_media_library_page_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/media_library/media_library.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function media_library_help\\(\\) has no return type specified\\.$#',
@ -31084,24 +30844,12 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/menu_ui/menu_ui.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function menu_ui_form_node_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/menu_ui/menu_ui.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function menu_ui_form_node_form_submit\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/menu_ui/menu_ui.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function menu_ui_form_node_type_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/menu_ui/menu_ui.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function menu_ui_form_node_type_form_builder\\(\\) has no return type specified\\.$#',
@ -33882,12 +33630,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/node/node.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function node_form_system_themes_admin_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/node/node.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function node_form_system_themes_admin_form_submit\\(\\) has no return type specified\\.$#',
@ -34668,12 +34410,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/node/tests/modules/node_test/node_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function node_test_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/node/tests/modules/node_test/node_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function node_test_node_access_records\\(\\) has no return type specified\\.$#',
@ -35652,12 +35388,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/options/tests/options_test/options_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function options_test_form_entity_test_entity_test_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/options/tests/options_test/options_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function options_test_options_list_alter\\(\\) has no return type specified\\.$#',
@ -37596,12 +37326,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/search/search.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function search_form_search_block_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/search/search.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function search_help\\(\\) has no return type specified\\.$#',
@ -39192,12 +38916,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/syslog/syslog.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function syslog_form_system_logging_settings_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/syslog/syslog.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function syslog_help\\(\\) has no return type specified\\.$#',
@ -41936,12 +41654,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/entity_test/entity_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function entity_test_form_entity_test_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/entity_test/entity_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function entity_test_form_entity_test_form_validate\\(\\) has no return type specified\\.$#',
@ -41954,12 +41666,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/entity_test/entity_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function entity_test_form_node_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/entity_test/entity_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function entity_test_query_entity_test_access_alter\\(\\) has no return type specified\\.$#',
@ -43016,36 +42722,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/form_test/form_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function block_form_form_test_alter_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/form_test/form_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function form_test_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/form_test/form_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function form_test_form_form_test_alter_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/form_test/form_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function form_test_form_form_test_vertical_tabs_access_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/form_test/form_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function form_test_form_user_register_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/form_test/form_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function form_test_tableselect_ajax_callback\\(\\) has no return type specified\\.$#',
@ -43058,12 +42734,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/form_test/form_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function system_form_form_test_alter_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/form_test/form_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Method Drupal\\\\form_test\\\\Callbacks\\:\\:validateName\\(\\) has no return type specified\\.$#',
@ -47541,24 +47211,12 @@ $ignoreErrors[] = [
'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_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/themes/test_theme_settings/theme-settings.php',
];
$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',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function test_theme_theme_form_system_theme_settings_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/themes/test_theme_theme/test_theme_theme.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function test_theme_theme_form_system_theme_settings_submit\\(\\) has no return type specified\\.$#',
@ -48141,12 +47799,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/taxonomy/tests/modules/taxonomy_term_display_configurable_test/taxonomy_term_display_configurable_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function taxonomy_test_form_taxonomy_term_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/taxonomy/tests/modules/taxonomy_test/taxonomy_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function taxonomy_test_query_alter\\(\\) has no return type specified\\.$#',
@ -50271,12 +49923,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/user/tests/modules/user_access_test/user_access_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function user_form_test_form_user_cancel_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/user/tests/modules/user_form_test/user_form_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Method Drupal\\\\user_language_test\\\\Controller\\\\UserLanguageTestController\\:\\:buildPostResponse\\(\\) has no return type specified\\.$#',
@ -51153,12 +50799,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/user/user.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function user_form_system_regional_settings_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/user/user.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function user_form_system_regional_settings_submit\\(\\) has no return type specified\\.$#',
@ -57819,12 +57459,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/views/tests/modules/views_entity_test/views_entity_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function views_form_test_form_views_form_media_media_page_list_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/views/tests/modules/views_form_test/views_form_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Method Drupal\\\\views_test_cacheable_metadata_calculation\\\\Plugin\\\\views\\\\access\\\\CacheableMetadataCalculationTest\\:\\:alterRouteDefinition\\(\\) has no return type specified\\.$#',
@ -58161,12 +57795,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/views/tests/modules/views_test_data/views_test_data.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function views_test_data_form_views_form_test_form_multiple_default_alter\\(\\) 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\\.$#',
@ -59625,12 +59253,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/views/tests/src/Unit/WizardPluginBaseTest.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function views_test_checkboxes_theme_form_views_exposed_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/views/tests/themes/views_test_checkboxes_theme/views_test_checkboxes_theme.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function views_update_last_removed\\(\\) has no return type specified\\.$#',
@ -59703,12 +59325,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/views/views.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function views_form_views_exposed_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/views/views.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function views_help\\(\\) has no return type specified\\.$#',
@ -60483,12 +60099,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/views_ui/tests/modules/views_ui_test/views_ui_test.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function views_ui_test_field_form_views_ui_add_handler_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/views_ui/tests/modules/views_ui_test_field/views_ui_test_field.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function views_ui_test_field_views_data\\(\\) has no return type specified\\.$#',
@ -62919,12 +62529,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/modules/workspaces/workspaces.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function workspaces_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/workspaces/workspaces.module',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function workspaces_help\\(\\) has no return type specified\\.$#',
@ -62955,12 +62559,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/profiles/demo_umami/demo_umami.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function demo_umami_form_install_configure_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/profiles/demo_umami/demo_umami.profile',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function demo_umami_form_install_configure_submit\\(\\) has no return type specified\\.$#',
@ -63075,18 +62673,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function umami_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/profiles/demo_umami/themes/umami/umami.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function umami_form_search_block_form_alter\\(\\) 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\\(\\) has no return type specified\\.$#',
@ -63195,12 +62781,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/profiles/minimal/tests/src/Functional/MinimalTest.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function standard_form_install_configure_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/profiles/standard/standard.profile',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function standard_form_install_configure_submit\\(\\) has no return type specified\\.$#',
@ -70298,90 +69878,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_form_media_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_form_media_library_add_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_form_media_library_add_form_oembed_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_form_media_library_add_form_upload_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_form_menu_link_content_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_form_menu_link_edit_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_form_node_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_form_node_preview_form_select_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_form_system_modules_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_form_user_admin_permissions_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_form_views_exposed_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_form_views_ui_add_handler_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_form_views_ui_config_item_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_page_attachments_alter\\(\\) has no return type specified\\.$#',
@ -70634,12 +70130,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/themes/claro/claro.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function claro_preprocess_views_ui_rearrange_filter_form\\(\\) 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\\.$#',
@ -70748,24 +70238,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/themes/olivero/olivero.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function olivero_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/olivero/olivero.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function olivero_form_node_preview_form_select_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/olivero/olivero.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function olivero_form_views_exposed_form_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/olivero/olivero.theme',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function olivero_preprocess_block\\(\\) has no return type specified\\.$#',
@ -70958,12 +70430,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/themes/olivero/src/OliveroPreRender.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function olivero_form_system_theme_settings_alter\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/themes/olivero/theme-settings.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function stable9_preprocess_item_list__search_results\\(\\) has no return type specified\\.$#',

View File

@ -201,7 +201,7 @@ function hook_ajax_render_alter(array &$data) {
*
* @ingroup form_api
*/
function hook_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
function hook_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id): void {
if (isset($form['type']) && $form['type']['#value'] . '_node_settings' == $form_id) {
$upload_enabled_types = \Drupal::config('my_module.settings')->get('upload_enabled_types');
$form['workflow']['upload_' . $form['type']['#value']] = [
@ -251,7 +251,7 @@ function hook_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_stat
*
* @ingroup form_api
*/
function hook_form_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
function hook_form_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id): void {
// Modification for the form with the given form ID goes here. For example, if
// FORM_ID is "user_register_form" this code would run only on the user
// registration form.
@ -307,7 +307,7 @@ function hook_form_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $f
*
* @ingroup form_api
*/
function hook_form_BASE_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
function hook_form_BASE_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id): void {
// Modification for the form with the given BASE_FORM_ID goes here. For
// example, if BASE_FORM_ID is "node_form", this code would run on every
// node form, regardless of node type.

View File

@ -32,7 +32,7 @@ function automated_cron_help($route_name, RouteMatchInterface $route_match) {
/**
* Implements hook_form_FORM_ID_alter() for the system_cron_settings() form.
*/
function automated_cron_form_system_cron_settings_alter(&$form, &$form_state) {
function automated_cron_form_system_cron_settings_alter(&$form, &$form_state): void {
$automated_cron_settings = \Drupal::config('automated_cron.settings');
$options = [3600, 10800, 21600, 43200, 86400, 604800];

View File

@ -119,7 +119,7 @@ function ckeditor5_module_implements_alter(&$implementations, $hook) {
/**
* Implements hook_form_FORM_ID_alter().
*/
function ckeditor5_form_filter_format_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
function ckeditor5_form_filter_format_form_alter(array &$form, FormStateInterface $form_state, $form_id): void {
$editor = $form_state->get('editor');
// CKEditor 5 plugin config determines the available HTML tags. If an HTML

View File

@ -232,7 +232,7 @@ function comment_node_view_alter(array &$build, EntityInterface $node, EntityVie
/**
* Implements hook_form_FORM_ID_alter() for field_ui_field_storage_add_form.
*/
function comment_form_field_ui_field_storage_add_form_alter(&$form, FormStateInterface $form_state) {
function comment_form_field_ui_field_storage_add_form_alter(&$form, FormStateInterface $form_state): void {
$route_match = \Drupal::routeMatch();
if ($form_state->get('entity_type_id') == 'comment' && $route_match->getParameter('commented_entity_type')) {
$form['#title'] = \Drupal::service('comment.manager')->getFieldUIPageTitle($route_match->getParameter('commented_entity_type'), $route_match->getParameter('field_name'));
@ -251,7 +251,7 @@ function comment_field_info_entity_type_ui_definitions_alter(array &$ui_definiti
/**
* Implements hook_form_FORM_ID_alter().
*/
function comment_form_field_ui_form_display_overview_form_alter(&$form, FormStateInterface $form_state) {
function comment_form_field_ui_form_display_overview_form_alter(&$form, FormStateInterface $form_state): void {
$route_match = \Drupal::routeMatch();
if ($form['#entity_type'] == 'comment' && $route_match->getParameter('commented_entity_type')) {
$form['#title'] = \Drupal::service('comment.manager')->getFieldUIPageTitle($route_match->getParameter('commented_entity_type'), $route_match->getParameter('field_name'));
@ -261,7 +261,7 @@ function comment_form_field_ui_form_display_overview_form_alter(&$form, FormStat
/**
* Implements hook_form_FORM_ID_alter().
*/
function comment_form_field_ui_display_overview_form_alter(&$form, FormStateInterface $form_state) {
function comment_form_field_ui_display_overview_form_alter(&$form, FormStateInterface $form_state): void {
$route_match = \Drupal::routeMatch();
if ($form['#entity_type'] == 'comment' && $route_match->getParameter('commented_entity_type')) {
$form['#title'] = \Drupal::service('comment.manager')->getFieldUIPageTitle($route_match->getParameter('commented_entity_type'), $route_match->getParameter('field_name'));

View File

@ -50,7 +50,7 @@ function config_translation_test_config_translation_info_alter(&$info) {
*
* @see \Drupal\config_translation\Form\ConfigTranslationFormBase
*/
function config_translation_test_form_config_translation_form_alter(&$form, FormStateInterface $form_state) {
function config_translation_test_form_config_translation_form_alter(&$form, FormStateInterface $form_state): void {
if (\Drupal::state()->get('config_translation_test_alter_form_alter')) {
$form['#base_altered'] = TRUE;
}
@ -63,7 +63,7 @@ function config_translation_test_form_config_translation_form_alter(&$form, Form
*
* @see \Drupal\config_translation\Form\ConfigTranslationAddForm
*/
function config_translation_test_form_config_translation_add_form_alter(&$form, FormStateInterface $form_state) {
function config_translation_test_form_config_translation_add_form_alter(&$form, FormStateInterface $form_state): void {
if (\Drupal::state()->get('config_translation_test_alter_form_alter')) {
$form['#altered'] = TRUE;
}
@ -80,7 +80,7 @@ function config_translation_test_form_config_translation_add_form_alter(&$form,
*
* @see \Drupal\config_translation\Form\ConfigTranslationEditForm
*/
function config_translation_test_form_config_translation_edit_form_alter(&$form, FormStateInterface $form_state) {
function config_translation_test_form_config_translation_edit_form_alter(&$form, FormStateInterface $form_state): void {
if (\Drupal::state()->get('config_translation_test_alter_form_alter')) {
$form['#altered'] = TRUE;
}

View File

@ -183,7 +183,7 @@ function contact_mail($key, &$message, $params) {
*
* @see \Drupal\user\ProfileForm::form()
*/
function contact_form_user_form_alter(&$form, FormStateInterface $form_state) {
function contact_form_user_form_alter(&$form, FormStateInterface $form_state): void {
$form['contact'] = [
'#type' => 'details',
'#title' => t('Contact settings'),
@ -220,7 +220,7 @@ function contact_user_profile_form_submit($form, FormStateInterface $form_state)
*
* Adds the default personal contact setting on the user settings page.
*/
function contact_form_user_admin_settings_alter(&$form, FormStateInterface $form_state) {
function contact_form_user_admin_settings_alter(&$form, FormStateInterface $form_state): void {
$form['contact'] = [
'#type' => 'details',
'#title' => t('Contact settings'),

View File

@ -46,7 +46,7 @@ function contact_storage_test_entity_type_alter(array &$entity_types): void {
/**
* Implements hook_form_FORM_ID_alter() for contact_form_form().
*/
function contact_storage_test_form_contact_form_form_alter(&$form, FormStateInterface $form_state) {
function contact_storage_test_form_contact_form_form_alter(&$form, FormStateInterface $form_state): void {
/** @var \Drupal\contact\ContactFormInterface $contact_form */
$contact_form = $form_state->getFormObject()->getEntity();
$form['send_a_pony'] = [

View File

@ -159,7 +159,7 @@ function content_moderation_entity_prepare_form(EntityInterface $entity, $operat
/**
* Implements hook_form_alter().
*/
function content_moderation_form_alter(&$form, FormStateInterface $form_state, $form_id) {
function content_moderation_form_alter(&$form, FormStateInterface $form_state, $form_id): void {
\Drupal::service('class_resolver')
->getInstanceFromDefinition(EntityTypeInfo::class)
->formAlter($form, $form_state, $form_id);

View File

@ -78,7 +78,7 @@ function content_translation_field_sync_widget(FieldDefinitionInterface $field,
/**
* (proxied) Implements hook_form_FORM_ID_alter().
*/
function _content_translation_form_language_content_settings_form_alter(array &$form, FormStateInterface $form_state) {
function _content_translation_form_language_content_settings_form_alter(array &$form, FormStateInterface $form_state): void {
// Inject into the content language settings the translation settings if the
// user has the required permission.
if (!\Drupal::currentUser()->hasPermission('administer content translation')) {

View File

@ -383,7 +383,7 @@ function content_translation_translate_access(EntityInterface $entity) {
/**
* Implements hook_form_alter().
*/
function content_translation_form_alter(array &$form, FormStateInterface $form_state) {
function content_translation_form_alter(array &$form, FormStateInterface $form_state): void {
$form_object = $form_state->getFormObject();
if (!($form_object instanceof ContentEntityFormInterface)) {
return;
@ -483,7 +483,7 @@ function content_translation_entity_extra_field_info() {
/**
* Implements hook_form_FORM_ID_alter() for 'field_config_edit_form'.
*/
function content_translation_form_field_config_edit_form_alter(array &$form, FormStateInterface $form_state) {
function content_translation_form_field_config_edit_form_alter(array &$form, FormStateInterface $form_state): void {
$field = $form_state->getFormObject()->getEntity();
$bundle_is_translatable = \Drupal::service('content_translation.manager')->isEnabled($field->getTargetEntityTypeId(), $field->getTargetBundle());
@ -649,7 +649,7 @@ function content_translation_language_configuration_element_submit(array $form,
/**
* Implements hook_form_FORM_ID_alter() for language_content_settings_form().
*/
function content_translation_form_language_content_settings_form_alter(array &$form, FormStateInterface $form_state) {
function content_translation_form_language_content_settings_form_alter(array &$form, FormStateInterface $form_state): void {
\Drupal::moduleHandler()->loadInclude('content_translation', 'inc', 'content_translation.admin');
_content_translation_form_language_content_settings_form_alter($form, $form_state);
}

View File

@ -46,7 +46,7 @@ function content_translation_test_entity_access(EntityInterface $entity, $operat
*
* Adds a textfield to node forms based on a request parameter.
*/
function content_translation_test_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id) {
function content_translation_test_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id): void {
$langcode = $form_state->getFormObject()->getFormLangcode($form_state);
if (in_array($langcode, ['en', 'fr']) && \Drupal::request()->get('test_field_only_en_fr')) {
$form['test_field_only_en_fr'] = [

View File

@ -99,7 +99,7 @@ function _dblog_get_message_types() {
/**
* Implements hook_form_FORM_ID_alter() for system_logging_settings().
*/
function dblog_form_system_logging_settings_alter(&$form, FormStateInterface $form_state) {
function dblog_form_system_logging_settings_alter(&$form, FormStateInterface $form_state): void {
$row_limits = [100, 1000, 10000, 100000, 1000000];
$form['dblog_row_limit'] = [
'#type' => 'select',

View File

@ -71,7 +71,7 @@ function editor_element_info_alter(&$types) {
/**
* Implements hook_form_FORM_ID_alter().
*/
function editor_form_filter_admin_overview_alter(&$form, FormStateInterface $form_state) {
function editor_form_filter_admin_overview_alter(&$form, FormStateInterface $form_state): void {
// @todo Cleanup column injection: https://www.drupal.org/node/1876718.
// Splice in the column for "Text editor" into the header.
$position = array_search('name', $form['formats']['#header']) + 1;
@ -93,7 +93,7 @@ function editor_form_filter_admin_overview_alter(&$form, FormStateInterface $for
/**
* Implements hook_form_BASE_FORM_ID_alter() for \Drupal\filter\FilterFormatEditForm.
*/
function editor_form_filter_format_form_alter(&$form, FormStateInterface $form_state) {
function editor_form_filter_format_form_alter(&$form, FormStateInterface $form_state): void {
$editor = $form_state->get('editor');
if ($editor === NULL) {
$format = $form_state->getFormObject()->getEntity();

View File

@ -313,7 +313,7 @@ function field_config_import_steps_alter(&$sync_steps, ConfigImporter $config_im
*
* @see \Drupal\field\ConfigImporterFieldPurger
*/
function field_form_config_admin_import_form_alter(&$form, FormStateInterface $form_state) {
function field_form_config_admin_import_form_alter(&$form, FormStateInterface $form_state): void {
// Only display the message when core.extension is available in the source
// storage and the form is not submitted.
$user_input = $form_state->getUserInput();

View File

@ -57,7 +57,7 @@ function field_layout_entity_view_alter(array &$build, EntityInterface $entity,
/**
* Implements hook_form_alter().
*/
function field_layout_form_alter(&$form, FormStateInterface $form_state, $form_id) {
function field_layout_form_alter(&$form, FormStateInterface $form_state, $form_id): void {
$form_object = $form_state->getFormObject();
if ($form_object instanceof ContentEntityFormInterface && $display = $form_object->getFormDisplay($form_state)) {
if ($display instanceof EntityDisplayWithLayoutInterface) {

View File

@ -221,7 +221,7 @@ function field_ui_local_tasks_alter(&$local_tasks) {
/**
* Implements hook_form_FORM_ID_alter() for 'field_ui_field_storage_add_form'.
*/
function field_ui_form_field_ui_field_storage_add_form_alter(array &$form) {
function field_ui_form_field_ui_field_storage_add_form_alter(array &$form): void {
$optgroup = (string) t('Reference');
// Move the "Entity reference" option to the end of the list and rename it to
// "Other".
@ -249,7 +249,7 @@ function field_ui_preprocess_form_element__new_storage_type(&$variables) {
* @see \Drupal\block_content\BlockContentTypeForm
* @see field_ui_form_manage_field_form_submit()
*/
function field_ui_form_alter(&$form, FormStateInterface $form_state, $form_id) {
function field_ui_form_alter(&$form, FormStateInterface $form_state, $form_id): void {
$forms = [
'node_type_add_form',
'comment_type_add_form',

View File

@ -22,7 +22,7 @@ function field_ui_test_field_config_access(FieldConfigInterface $field) {
/**
* Implements hook_form_FORM_BASE_ID_alter().
*/
function field_ui_test_form_entity_view_display_edit_form_alter(&$form, FormStateInterface $form_state) {
function field_ui_test_form_entity_view_display_edit_form_alter(&$form, FormStateInterface $form_state): void {
$table = &$form['fields'];
foreach (Element::children($table) as $name) {

View File

@ -14,7 +14,7 @@ use Drupal\field_ui\Form\FieldStorageConfigEditForm;
/**
* Implements hook_form_FORM_ID_alter() for field_storage_config_edit_form.
*/
function field_ui_test_deprecated_form_field_storage_config_edit_form_alter(&$form, FormStateInterface $form_state) {
function field_ui_test_deprecated_form_field_storage_config_edit_form_alter(&$form, FormStateInterface $form_state): void {
if (!($form_state->getFormObject() instanceof FieldStorageConfigEditForm)) {
throw new \LogicException('field_storage_config_edit_form() expects to get access to the field storage config entity edit form.');
}

View File

@ -1094,7 +1094,7 @@ function file_field_find_file_reference_column(FieldDefinitionInterface $field)
* @see \Drupal\Core\File\Event\FileUploadSanitizeNameEvent
* @see \Drupal\file\EventSubscriber\FileEventSubscriber
*/
function file_form_system_file_system_settings_alter(array &$form, FormStateInterface $form_state) {
function file_form_system_file_system_settings_alter(array &$form, FormStateInterface $form_state): void {
$config = \Drupal::config('file.settings');
$form['filename_sanitization'] = [
'#type' => 'details',

View File

@ -370,7 +370,7 @@ function language_get_browser_drupal_langcode_mappings() {
/**
* Implements hook_form_alter().
*/
function language_form_alter(&$form, FormStateInterface $form_state) {
function language_form_alter(&$form, FormStateInterface $form_state): void {
// Content entity forms may have added a langcode field. But content language
// configuration should decide if it should be exposed or not in the forms.
$form_object = $form_state->getFormObject();

View File

@ -87,7 +87,7 @@ function layout_builder_entity_type_alter(array &$entity_types): void {
/**
* Implements hook_form_FORM_ID_alter() for \Drupal\field_ui\Form\EntityFormDisplayEditForm.
*/
function layout_builder_form_entity_form_display_edit_form_alter(&$form, FormStateInterface $form_state) {
function layout_builder_form_entity_form_display_edit_form_alter(&$form, FormStateInterface $form_state): void {
// Hides the Layout Builder field. It is rendered directly in
// \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::buildMultiple().
unset($form['fields'][OverridesSectionStorage::FIELD_NAME]);

View File

@ -81,7 +81,7 @@ function layout_builder_test_node_view(array &$build, EntityInterface $entity, E
/**
* Implements hook_form_BASE_FORM_ID_alter() for layout_builder_configure_block.
*/
function layout_builder_test_form_layout_builder_configure_block_alter(&$form, FormStateInterface $form_state, $form_id) {
function layout_builder_test_form_layout_builder_configure_block_alter(&$form, FormStateInterface $form_state, $form_id): void {
/** @var \Drupal\layout_builder\Form\ConfigureBlockFormBase $form_object */
$form_object = $form_state->getFormObject();
@ -102,7 +102,7 @@ function layout_builder_test_form_layout_builder_configure_block_alter(&$form, F
/**
* Implements hook_form_BASE_FORM_ID_alter() for layout_builder_configure_section.
*/
function layout_builder_test_form_layout_builder_configure_section_alter(&$form, FormStateInterface $form_state, $form_id) {
function layout_builder_test_form_layout_builder_configure_section_alter(&$form, FormStateInterface $form_state, $form_id): void {
/** @var \Drupal\layout_builder\Form\ConfigureSectionForm $form_object */
$form_object = $form_state->getFormObject();

View File

@ -585,7 +585,7 @@ function locale_library_info_alter(array &$libraries, $module) {
/**
* Implements hook_form_FORM_ID_alter() for language_admin_overview_form().
*/
function locale_form_language_admin_overview_form_alter(&$form, FormStateInterface $form_state) {
function locale_form_language_admin_overview_form_alter(&$form, FormStateInterface $form_state): void {
$languages = $form['languages']['#languages'];
$total_strings = \Drupal::service('locale.storage')->countStrings();
@ -635,7 +635,7 @@ function locale_form_language_admin_overview_form_alter(&$form, FormStateInterfa
/**
* Implements hook_form_FORM_ID_alter() for language_admin_add_form().
*/
function locale_form_language_admin_add_form_alter(&$form, FormStateInterface $form_state) {
function locale_form_language_admin_add_form_alter(&$form, FormStateInterface $form_state): void {
$form['predefined_submit']['#submit'][] = 'locale_form_language_admin_add_form_alter_submit';
$form['custom_language']['submit']['#submit'][] = 'locale_form_language_admin_add_form_alter_submit';
}
@ -676,7 +676,7 @@ function locale_form_language_admin_add_form_alter_submit($form, FormStateInterf
/**
* Implements hook_form_FORM_ID_alter() for language_admin_edit_form().
*/
function locale_form_language_admin_edit_form_alter(&$form, FormStateInterface $form_state) {
function locale_form_language_admin_edit_form_alter(&$form, FormStateInterface $form_state): void {
if ($form['langcode']['#type'] == 'value' && $form['langcode']['#value'] == 'en') {
$form['locale_translate_english'] = [
'#title' => t('Enable interface translation to English'),
@ -712,7 +712,7 @@ function locale_is_translatable($langcode) {
*
* Add interface translation directory setting to directories configuration.
*/
function locale_form_system_file_system_settings_alter(&$form, FormStateInterface $form_state) {
function locale_form_system_file_system_settings_alter(&$form, FormStateInterface $form_state): void {
$form['translation_path'] = [
'#type' => 'textfield',
'#title' => t('Interface translations directory'),

View File

@ -193,7 +193,7 @@ function media_field_ui_preconfigured_options_alter(array &$options, $field_type
/**
* Implements hook_form_FORM_ID_alter().
*/
function media_form_field_ui_field_storage_add_form_alter(&$form, FormStateInterface $form_state, $form_id) {
function media_form_field_ui_field_storage_add_form_alter(&$form, FormStateInterface $form_state, $form_id): void {
// Provide some help text to aid users decide whether they need a Media,
// File, or Image reference field.
$description_text = t('Use <em>Media</em> reference fields for most files, images, audio, videos, and remote media. Use <em>File</em> or <em>Image</em> reference fields when creating your own media types, or for legacy files and images created before installing the Media module.');
@ -365,7 +365,7 @@ function media_entity_type_alter(array &$entity_types): void {
/**
* Implements hook_form_FORM_ID_alter().
*/
function media_form_filter_format_edit_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
function media_form_filter_format_edit_form_alter(array &$form, FormStateInterface $form_state, $form_id): void {
// Add an additional validate callback so we can ensure the order of filters
// is correct.
$form['#validate'][] = 'media_filter_format_edit_form_validate';
@ -374,7 +374,7 @@ function media_form_filter_format_edit_form_alter(array &$form, FormStateInterfa
/**
* Implements hook_form_FORM_ID_alter().
*/
function media_form_filter_format_add_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
function media_form_filter_format_add_form_alter(array &$form, FormStateInterface $form_state, $form_id): void {
// Add an additional validate callback so we can ensure the order of filters
// is correct.
$form['#validate'][] = 'media_filter_format_edit_form_validate';

View File

@ -272,7 +272,7 @@ function media_library_preprocess_views_view_fields(&$variables) {
*
* @todo Remove in https://www.drupal.org/node/2983454
*/
function media_library_form_views_form_media_library_page_alter(array &$form, FormStateInterface $form_state) {
function media_library_form_views_form_media_library_page_alter(array &$form, FormStateInterface $form_state): void {
if (isset($form['media_bulk_form']) && isset($form['output'])) {
/** @var \Drupal\views\ViewExecutable $view */
$view = $form['output'][0]['#view'];
@ -288,7 +288,7 @@ function media_library_form_views_form_media_library_page_alter(array &$form, Fo
/**
* Implements hook_form_alter().
*/
function media_library_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
function media_library_form_alter(array &$form, FormStateInterface $form_state, $form_id): void {
// Add a process callback to ensure that the media library view's exposed
// filters submit button is not moved to the modal dialog's button area.
if ($form_id === 'views_exposed_form' && str_starts_with($form['#id'], 'views-exposed-form-media-library-widget')) {

View File

@ -213,7 +213,7 @@ function menu_ui_get_menu_link_defaults(NodeInterface $node) {
*
* @see menu_ui_form_node_form_submit()
*/
function menu_ui_form_node_form_alter(&$form, FormStateInterface $form_state) {
function menu_ui_form_node_form_alter(&$form, FormStateInterface $form_state): void {
// Generate a list of possible parents (not including this link or descendants).
// @todo This must be handled in a #process handler.
$node = $form_state->getFormObject()->getEntity();
@ -359,7 +359,7 @@ function menu_ui_form_node_form_submit($form, FormStateInterface $form_state) {
* @see NodeTypeForm::form()
* @see menu_ui_form_node_type_form_builder()
*/
function menu_ui_form_node_type_form_alter(&$form, FormStateInterface $form_state) {
function menu_ui_form_node_type_form_alter(&$form, FormStateInterface $form_state): void {
/** @var \Drupal\Core\Menu\MenuParentFormSelectorInterface $menu_parent_selector */
$menu_parent_selector = \Drupal::service('menu.parent_form_selector');
$menu_options = array_map(function (MenuInterface $menu) {

View File

@ -660,7 +660,7 @@ function node_page_top(array &$page_top) {
*
* @see node_form_system_themes_admin_form_submit()
*/
function node_form_system_themes_admin_form_alter(&$form, FormStateInterface $form_state, $form_id) {
function node_form_system_themes_admin_form_alter(&$form, FormStateInterface $form_state, $form_id): void {
$form['admin_theme']['use_admin_theme'] = [
'#type' => 'checkbox',
'#title' => t('Use the administration theme when editing or creating content'),

View File

@ -183,7 +183,7 @@ function node_test_node_insert(NodeInterface $node) {
/**
* Implements hook_form_alter().
*/
function node_test_form_alter(&$form, FormStateInterface $form_state, $form_id) {
function node_test_form_alter(&$form, FormStateInterface $form_state, $form_id): void {
if (!$form_state->get('node_test_form_alter')) {
\Drupal::messenger()->addStatus('Storage is not set');
$form_state->set('node_test_form_alter', TRUE);

View File

@ -61,7 +61,7 @@ function options_test_dynamic_values_callback(FieldStorageDefinitionInterface $d
/**
* Implements hook_form_FORM_ID_alter().
*/
function options_test_form_entity_test_entity_test_form_alter(&$form, FormStateInterface $form_state, $form_id) {
function options_test_form_entity_test_entity_test_form_alter(&$form, FormStateInterface $form_state, $form_id): void {
if (\Drupal::state()->get('options_test.form_alter_enable', FALSE)) {
$form['card_1']['widget']['#required_error'] = t('This is custom message for required field.');
}

View File

@ -414,7 +414,7 @@ function _search_find_match_with_simplify($key, $text, $boundary, $langcode = NU
*
* @see \Drupal\search\Form\SearchBlockForm
*/
function search_form_search_block_form_alter(&$form, FormStateInterface $form_state) {
function search_form_search_block_form_alter(&$form, FormStateInterface $form_state): void {
$form['form_build_id']['#access'] = FALSE;
$form['form_token']['#access'] = FALSE;
$form['form_id']['#access'] = FALSE;

View File

@ -33,7 +33,7 @@ function syslog_help($route_name, RouteMatchInterface $route_match) {
/**
* Implements hook_form_FORM_ID_alter().
*/
function syslog_form_system_logging_settings_alter(&$form, FormStateInterface $form_state) {
function syslog_form_system_logging_settings_alter(&$form, FormStateInterface $form_state): void {
$config = \Drupal::configFactory()->getEditable('syslog.settings');
$help = \Drupal::moduleHandler()->moduleExists('help') ? ' ' . Link::fromTextAndUrl(t('More information'), Url::fromRoute('help.page', ['name' => 'syslog']))->toString() . '.' : NULL;
$form['syslog_identity'] = [

View File

@ -335,7 +335,7 @@ function entity_test_entity_extra_field_info() {
/**
* Implements hook_form_BASE_FORM_ID_alter().
*/
function entity_test_form_entity_test_form_alter(&$form) {
function entity_test_form_entity_test_form_alter(&$form): void {
switch (\Drupal::state()->get('entity_test.form.validate.test')) {
case 'form-level':
$form['#validate'][] = 'entity_test_form_entity_test_form_validate';
@ -366,7 +366,7 @@ function entity_test_form_entity_test_form_validate_check(array &$form, FormStat
/**
* Implements hook_form_BASE_FORM_ID_alter().
*/
function entity_test_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id) {
function entity_test_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id): void {
$langcode = $form_state->getFormObject()->getFormLangcode($form_state);
\Drupal::state()->set('entity_test.form_langcode', $langcode);
}

View File

@ -12,14 +12,14 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Implements hook_form_FORM_ID_alter().
*/
function block_form_form_test_alter_form_alter(&$form, FormStateInterface $form_state) {
function block_form_form_test_alter_form_alter(&$form, FormStateInterface $form_state): void {
\Drupal::messenger()->addStatus('block_form_form_test_alter_form_alter() executed.');
}
/**
* Implements hook_form_alter().
*/
function form_test_form_alter(&$form, FormStateInterface $form_state, $form_id) {
function form_test_form_alter(&$form, FormStateInterface $form_state, $form_id): void {
if ($form_id == 'form_test_alter_form') {
\Drupal::messenger()->addStatus('form_test_form_alter() executed.');
}
@ -28,14 +28,14 @@ function form_test_form_alter(&$form, FormStateInterface $form_state, $form_id)
/**
* Implements hook_form_FORM_ID_alter().
*/
function form_test_form_form_test_alter_form_alter(&$form, FormStateInterface $form_state) {
function form_test_form_form_test_alter_form_alter(&$form, FormStateInterface $form_state): void {
\Drupal::messenger()->addStatus('form_test_form_form_test_alter_form_alter() executed.');
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function system_form_form_test_alter_form_alter(&$form, FormStateInterface $form_state) {
function system_form_form_test_alter_form_alter(&$form, FormStateInterface $form_state): void {
\Drupal::messenger()->addStatus('system_form_form_test_alter_form_alter() executed.');
}
@ -80,7 +80,7 @@ function _form_test_tableselect_get_data() {
/**
* Implements hook_form_FORM_ID_alter() for the registration form.
*/
function form_test_form_user_register_form_alter(&$form, FormStateInterface $form_state) {
function form_test_form_user_register_form_alter(&$form, FormStateInterface $form_state): void {
$form['test_rebuild'] = [
'#type' => 'submit',
'#value' => t('Rebuild'),
@ -99,7 +99,7 @@ function form_test_user_register_form_rebuild($form, FormStateInterface $form_st
/**
* Implements hook_form_FORM_ID_alter() for form_test_vertical_tabs_access_form().
*/
function form_test_form_form_test_vertical_tabs_access_form_alter(&$form, &$form_state, $form_id) {
function form_test_form_form_test_vertical_tabs_access_form_alter(&$form, &$form_state, $form_id): void {
$form['vertical_tabs1']['#access'] = FALSE;
$form['vertical_tabs2']['#access'] = FALSE;
$form['tabs3']['#access'] = TRUE;

View File

@ -13,7 +13,7 @@ use Drupal\file\Entity\File;
/**
* Implements hook_form_system_theme_settings_alter().
*/
function test_theme_settings_form_system_theme_settings_alter(&$form, FormStateInterface $form_state) {
function test_theme_settings_form_system_theme_settings_alter(&$form, FormStateInterface $form_state): void {
$form['custom_logo'] = [
'#type' => 'managed_file',
'#title' => t('Secondary logo.'),

View File

@ -13,7 +13,7 @@ use Drupal\file\Entity\File;
/**
* Implements hook_form_system_theme_settings_alter().
*/
function test_theme_theme_form_system_theme_settings_alter(&$form, FormStateInterface $form_state) {
function test_theme_theme_form_system_theme_settings_alter(&$form, FormStateInterface $form_state): void {
$form['custom_logo'] = [
'#type' => 'managed_file',

View File

@ -62,7 +62,7 @@ function taxonomy_test_query_taxonomy_term_access_alter(AlterableInterface $quer
/**
* Implements hook_form_BASE_FORM_ID_alter() for the taxonomy term form.
*/
function taxonomy_test_form_taxonomy_term_form_alter(&$form, FormStateInterface $form_state, $form_id) {
function taxonomy_test_form_taxonomy_term_form_alter(&$form, FormStateInterface $form_state, $form_id): void {
if (\Drupal::state()->get('taxonomy_test.disable_parent_form_element', FALSE)) {
$form['relations']['parent']['#disabled'] = TRUE;
}

View File

@ -10,7 +10,7 @@ declare(strict_types=1);
/**
* Implements hook_form_FORM_ID_alter() for user_cancel_form().
*/
function user_form_test_form_user_cancel_form_alter(&$form, &$form_state) {
function user_form_test_form_user_cancel_form_alter(&$form, &$form_state): void {
$form['user_cancel_confirm']['#default_value'] = FALSE;
$form['access']['#value'] = \Drupal::currentUser()->hasPermission('cancel other accounts');
}

View File

@ -1153,7 +1153,7 @@ function template_preprocess_user(&$variables) {
/**
* Implements hook_form_FORM_ID_alter() for \Drupal\system\Form\RegionalForm.
*/
function user_form_system_regional_settings_alter(&$form, FormStateInterface $form_state) {
function user_form_system_regional_settings_alter(&$form, FormStateInterface $form_state): void {
$config = \Drupal::config('system.date');
$form['timezone']['configurable_timezones'] = [

View File

@ -12,7 +12,7 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Implements hook_form_BASE_FORM_ID_alter().
*/
function views_form_test_form_views_form_media_media_page_list_alter(&$form, FormStateInterface $form_state, $form_id) {
function views_form_test_form_views_form_media_media_page_list_alter(&$form, FormStateInterface $form_state, $form_id): void {
$state = \Drupal::state();
$count = $state->get('hook_form_BASE_FORM_ID_alter_count', 0);
$state->set('hook_form_BASE_FORM_ID_alter_count', $count + 1);

View File

@ -117,7 +117,7 @@ function template_preprocess_views_view_mapping_test(&$variables) {
/**
* Implements hook_form_BASE_FORM_ID_alter().
*/
function views_test_data_form_views_form_test_form_multiple_default_alter(&$form, FormStateInterface $form_state, $form_id) {
function views_test_data_form_views_form_test_form_multiple_default_alter(&$form, FormStateInterface $form_state, $form_id): void {
\Drupal::messenger()->addStatus(t('Test base form ID with Views forms and arguments.'));
}

View File

@ -12,7 +12,7 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Changes an exposed "type" filter from a multi-select to checkboxes.
*/
function views_test_checkboxes_theme_form_views_exposed_form_alter(&$form, FormStateInterface $form_state) {
function views_test_checkboxes_theme_form_views_exposed_form_alter(&$form, FormStateInterface $form_state): void {
if (isset($form['type'])) {
$form['type']['#type'] = 'checkboxes';
}

View File

@ -632,7 +632,7 @@ function views_disable_view(View $view) {
* Since the exposed form is a GET form, we don't want it to send a wide
* variety of information.
*/
function views_form_views_exposed_form_alter(&$form, FormStateInterface $form_state) {
function views_form_views_exposed_form_alter(&$form, FormStateInterface $form_state): void {
$form['form_build_id']['#access'] = FALSE;
$form['form_token']['#access'] = FALSE;
$form['form_id']['#access'] = FALSE;

View File

@ -15,6 +15,6 @@ use Drupal\Core\Form\FormStateInterface;
* Changes the label for one of the tests fields to validate this label is not
* searched on.
*/
function views_ui_test_field_form_views_ui_add_handler_form_alter(&$form, FormStateInterface $form_state) {
function views_ui_test_field_form_views_ui_add_handler_form_alter(&$form, FormStateInterface $form_state): void {
$form['options']['name']['#options']['views.views_test_field_1']['title']['data']['#title'] .= ' FIELD_1_LABEL';
}

View File

@ -79,7 +79,7 @@ function workspaces_entity_type_alter(array &$entity_types): void {
/**
* Implements hook_form_alter().
*/
function workspaces_form_alter(&$form, FormStateInterface $form_state, $form_id) {
function workspaces_form_alter(&$form, FormStateInterface $form_state, $form_id): void {
if ($form_state->getFormObject() instanceof EntityFormInterface) {
\Drupal::service('class_resolver')
->getInstanceFromDefinition(EntityOperations::class)

View File

@ -35,7 +35,7 @@ function demo_umami_help($route_name, RouteMatchInterface $route_match) {
*
* Allows the profile to alter the site configuration form.
*/
function demo_umami_form_install_configure_form_alter(&$form, FormStateInterface $form_state) {
function demo_umami_form_install_configure_form_alter(&$form, FormStateInterface $form_state): void {
$form['site_information']['site_name']['#default_value'] = 'Umami Food Magazine';
$form['#submit'][] = 'demo_umami_form_install_configure_submit';
}

View File

@ -128,7 +128,7 @@ function umami_preprocess_menu_local_task(&$variables) {
/**
* Implements hook_form_FORM_ID_alter().
*/
function umami_form_search_block_form_alter(&$form, FormStateInterface $form_state) {
function umami_form_search_block_form_alter(&$form, FormStateInterface $form_state): void {
$form['keys']['#attributes']['placeholder'] = t('Search by keyword, ingredient, dish');
}
@ -152,7 +152,7 @@ function umami_preprocess_links__media_library_menu(array &$variables) {
*
* @todo revisit in https://drupal.org/node/3110132
*/
function umami_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
function umami_form_alter(array &$form, FormStateInterface $form_state, $form_id): void {
$form_object = $form_state->getFormObject();
if ($form_object instanceof ViewsForm && str_starts_with($form_object->getBaseFormId(), 'views_form_media_library')) {

View File

@ -13,7 +13,7 @@ use Drupal\Core\Form\FormStateInterface;
*
* Allows the profile to alter the site configuration form.
*/
function standard_form_install_configure_form_alter(&$form, FormStateInterface $form_state) {
function standard_form_install_configure_form_alter(&$form, FormStateInterface $form_state): void {
$form['#submit'][] = 'standard_form_install_configure_submit';
}

View File

@ -412,7 +412,7 @@ function claro_preprocess_details(&$variables) {
/**
* Implements hook_form_alter().
*/
function claro_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
function claro_form_alter(array &$form, FormStateInterface $form_state, $form_id): void {
$build_info = $form_state->getBuildInfo();
$form_object = $form_state->getFormObject();
@ -669,7 +669,7 @@ function _claro_convert_link_to_action_link(array $link, $icon_name = NULL, $siz
*
* Changes vertical tabs to container.
*/
function claro_form_node_form_alter(&$form, FormStateInterface $form_state) {
function claro_form_node_form_alter(&$form, FormStateInterface $form_state): void {
$form['#theme'] = ['node_edit_form'];
$form['#attached']['library'][] = 'claro/form-two-columns';
@ -689,7 +689,7 @@ function claro_form_node_form_alter(&$form, FormStateInterface $form_state) {
* Alters the menu_link_content_form by organizing form elements into different
* 'details' sections.
*/
function claro_form_menu_link_content_form_alter(&$form, FormStateInterface $form_state) {
function claro_form_menu_link_content_form_alter(&$form, FormStateInterface $form_state): void {
$form['#theme'] = ['menu_link_form'];
$form['#attached']['library'][] = 'claro/form-two-columns';
$form['advanced'] = [
@ -739,14 +739,14 @@ function claro_form_menu_link_content_form_alter(&$form, FormStateInterface $for
* Alters the menu_link_edit form by organizing form elements into different
* 'details' sections.
*/
function claro_form_menu_link_edit_alter(&$form, FormStateInterface $form_state) {
function claro_form_menu_link_edit_alter(&$form, FormStateInterface $form_state): void {
claro_form_menu_link_content_form_alter($form, $form_state);
}
/**
* Implements hook_form_BASE_FORM_ID_alter() for \Drupal\media\MediaForm.
*/
function claro_form_media_form_alter(&$form, FormStateInterface $form_state) {
function claro_form_media_form_alter(&$form, FormStateInterface $form_state): void {
// Only attach CSS from core if this form comes from Media core, and not from
// the contrib Media Entity 1.x branch.
if (\Drupal::moduleHandler()->moduleExists('media') && $form_state->getFormObject() instanceof MediaForm) {
@ -898,7 +898,7 @@ function claro_preprocess_views_exposed_form(&$variables) {
/**
* Implements hook_form_FORM_ID_alter() for views_exposed_form.
*/
function claro_form_views_exposed_form_alter(&$form, FormStateInterface $form_state) {
function claro_form_views_exposed_form_alter(&$form, FormStateInterface $form_state): void {
$view = $form_state->getStorage()['view'];
$view_title = $view->getTitle();
@ -910,7 +910,7 @@ function claro_form_views_exposed_form_alter(&$form, FormStateInterface $form_st
/**
* Implements hook_form_FORM_ID_alter() for the system_modules form.
*/
function claro_form_system_modules_alter(&$form, FormStateInterface $form_state) {
function claro_form_system_modules_alter(&$form, FormStateInterface $form_state): void {
if (isset($form['filters'])) {
$form['filters']['#attributes']['class'][] = 'modules-table-filter';
if (isset($form['filters']['text'])) {
@ -1489,7 +1489,7 @@ function claro_preprocess_views_view_fields__media_library(array &$variables) {
/**
* Implements hook_form_BASE_FORM_ID_alter().
*/
function claro_form_media_library_add_form_alter(array &$form, FormStateInterface $form_state) {
function claro_form_media_library_add_form_alter(array &$form, FormStateInterface $form_state): void {
$form['#attributes']['class'][] = 'media-library-add-form';
$form['#attached']['library'][] = 'claro/media_library.theme';
@ -1510,7 +1510,7 @@ function claro_form_media_library_add_form_alter(array &$form, FormStateInterfac
/**
* Implements hook_form_FORM_ID_alter().
*/
function claro_form_media_library_add_form_upload_alter(array &$form, FormStateInterface $form_state) {
function claro_form_media_library_add_form_upload_alter(array &$form, FormStateInterface $form_state): void {
$form['#attributes']['class'][] = 'media-library-add-form--upload';
if (isset($form['container']['upload'])) {
// Set this flag so we can prevent the details element from being added
@ -1525,7 +1525,7 @@ function claro_form_media_library_add_form_upload_alter(array &$form, FormStateI
/**
* Implements hook_form_FORM_ID_alter().
*/
function claro_form_media_library_add_form_oembed_alter(array &$form, FormStateInterface $form_state) {
function claro_form_media_library_add_form_oembed_alter(array &$form, FormStateInterface $form_state): void {
$form['#attributes']['class'][] = 'media-library-add-form--oembed';
// If no media items have been added yet, add a couple of styling classes
@ -1675,7 +1675,7 @@ function claro_preprocess_links__media_library_menu(array &$variables) {
/**
* Implements hook_form_FORM_ID_alter() for the Views UI rearrange filter form.
*/
function claro_preprocess_views_ui_rearrange_filter_form(array &$variables) {
function claro_preprocess_views_ui_rearrange_filter_form(array &$variables): void {
foreach ($variables['table']['#rows'] as &$row) {
// Remove the container-inline class from the operator table cell.
if (isset($row['data'][0]['class'])) {
@ -1687,7 +1687,7 @@ function claro_preprocess_views_ui_rearrange_filter_form(array &$variables) {
/**
* Implements hook_form_FORM_ID_alter() for the Views UI config form.
*/
function claro_form_views_ui_config_item_form_alter(array &$form, FormStateInterface $form_state) {
function claro_form_views_ui_config_item_form_alter(array &$form, FormStateInterface $form_state): void {
$type = $form_state->get('type');
if ($type === 'filter') {
@ -1757,7 +1757,7 @@ function claro_form_views_ui_config_item_form_alter(array &$form, FormStateInter
/**
* Implements hook_form_FORM_ID_alter() for Views UI add handler form.
*/
function claro_form_views_ui_add_handler_form_alter(array &$form, FormStateInterface $form_state) {
function claro_form_views_ui_add_handler_form_alter(array &$form, FormStateInterface $form_state): void {
// Remove container-inline class to allow more control over styling.
if (isset($form['selected']['#attributes']['class'])) {
$form['selected']['#attributes']['class'] = array_diff($form['selected']['#attributes']['class'], ['container-inline']);
@ -1844,7 +1844,7 @@ function claro_system_module_invoked_theme_registry_alter(array &$theme_registry
/**
* Implements hook_form_FORM_ID_alter() for the user_admin_permissions form.
*/
function claro_form_user_admin_permissions_alter(&$form, FormStateInterface $form_state) {
function claro_form_user_admin_permissions_alter(&$form, FormStateInterface $form_state): void {
if (isset($form['filters'])) {
$form['filters']['#attributes']['class'][] = 'permissions-table-filter';
if (isset($form['filters']['text'])) {
@ -1857,7 +1857,7 @@ function claro_form_user_admin_permissions_alter(&$form, FormStateInterface $for
/**
* Implements hook_form_FORM_ID_alter().
*/
function claro_form_node_preview_form_select_alter(array &$form, FormStateInterface $form_state) {
function claro_form_node_preview_form_select_alter(array &$form, FormStateInterface $form_state): void {
if (isset($form['backlink'])) {
$form['backlink']['#options']['attributes']['class'][] = 'action-link';
$form['backlink']['#options']['attributes']['class'][] = 'action-link--icon-chevron-left';

View File

@ -192,7 +192,7 @@ function olivero_theme_suggestions_form_alter(array &$suggestions, array $variab
/**
* Implements hook_form_alter() for adding classes and placeholder text to the search forms.
*/
function olivero_form_alter(&$form, FormStateInterface $form_state, $form_id) {
function olivero_form_alter(&$form, FormStateInterface $form_state, $form_id): void {
if (isset($form['actions']['submit']) && (count($form['actions'])) <= 2) {
$form['actions']['submit']['#attributes']['class'][] = 'button--primary';
}
@ -503,7 +503,7 @@ function olivero_preprocess_filter_caption(&$variables) {
/**
* Implements hook_form_FORM_ID_alter().
*/
function olivero_form_node_preview_form_select_alter(&$form, FormStateInterface $form_state, $form_id) {
function olivero_form_node_preview_form_select_alter(&$form, FormStateInterface $form_state, $form_id): void {
$form['backlink']['#options']['attributes']['class'][] = 'button';
$form['backlink']['#options']['attributes']['class'][] = 'button--small';
$form['backlink']['#options']['attributes']['class'][] = 'button--icon-back';
@ -620,7 +620,7 @@ function olivero_preprocess_table(&$variables) {
/**
* Implements hook_form_views_exposed_form_alter().
*/
function olivero_form_views_exposed_form_alter(&$form) {
function olivero_form_views_exposed_form_alter(&$form): void {
$form['#attributes']['class'][] = 'form--inline';
}

View File

@ -10,7 +10,7 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Implements hook_form_FORM_ID_alter() for system_theme_settings.
*/
function olivero_form_system_theme_settings_alter(&$form, FormStateInterface $form_state) {
function olivero_form_system_theme_settings_alter(&$form, FormStateInterface $form_state): void {
$form['#attached']['library'][] = 'olivero/color-picker';
$color_config = [