From 41281d7cc76ad999e8f6252e46c64efc407d6bed Mon Sep 17 00:00:00 2001
From: catch <6915-catch@users.noreply.drupalcode.org>
Date: Wed, 13 Nov 2024 18:36:43 +0000
Subject: [PATCH] Issue #3483050 by mstrelan, nicxvan: Add int return type to
 all hook_update_last_removed implementations

(cherry picked from commit 3d350b03888944ee354f689ddb9562f39ef0a526)
---
 core/.phpstan-baseline.php                    | 222 ------------------
 core/lib/Drupal/Core/Extension/module.api.php |   2 +-
 core/modules/block/block.install              |   2 +-
 .../block_content/block_content.install       |   2 +-
 core/modules/comment/comment.install          |   2 +-
 .../content_moderation.install                |   2 +-
 .../content_translation.install               |   2 +-
 core/modules/dblog/dblog.install              |   2 +-
 core/modules/editor/editor.install            |   2 +-
 core/modules/field/field.install              |   2 +-
 core/modules/file/file.install                |   2 +-
 core/modules/help/help.install                |   2 +-
 core/modules/history/history.install          |   2 +-
 core/modules/image/image.install              |   2 +-
 core/modules/jsonapi/jsonapi.install          |   2 +-
 core/modules/language/language.install        |   2 +-
 .../layout_builder/layout_builder.install     |   2 +-
 core/modules/locale/locale.install            |   2 +-
 core/modules/media/media.install              |   2 +-
 .../media_library/media_library.install       |   2 +-
 .../menu_link_content.install                 |   2 +-
 core/modules/migrate/migrate.install          |   2 +-
 .../migrate_drupal/migrate_drupal.install     |   2 +-
 core/modules/node/node.install                |   2 +-
 core/modules/path/path.install                |   2 +-
 core/modules/pgsql/pgsql.install              |   2 +-
 core/modules/rest/rest.install                |   2 +-
 .../serialization/serialization.install       |   2 +-
 core/modules/syslog/syslog.install            |   2 +-
 core/modules/system/system.install            |   2 +-
 .../equivalent_update_test.install            |   2 +-
 .../update_script_test.install                |   2 +-
 .../update_test_last_removed.install          |   2 +-
 .../update_test_with_7x.install               |   2 +-
 core/modules/taxonomy/taxonomy.install        |   2 +-
 core/modules/update/update.install            |   2 +-
 core/modules/user/user.install                |   2 +-
 core/modules/views/views.install              |   2 +-
 core/modules/workspaces/workspaces.install    |   2 +-
 39 files changed, 38 insertions(+), 260 deletions(-)

diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php
index a41351ec9664..b7f50366bded 100644
--- a/core/.phpstan-baseline.php
+++ b/core/.phpstan-baseline.php
@@ -12496,12 +12496,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/big_pipe/tests/src/Unit/StackMiddleware/ContentLengthTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function block_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/block/block.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function block_block_build_local_actions_block_alter\\(\\) has no return type specified\\.$#',
@@ -12994,12 +12988,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/block/tests/src/Unit/Plugin/migrate/process/BlockSettingsTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function block_content_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/block_content/block_content.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function block_content_help\\(\\) has no return type specified\\.$#',
@@ -14308,12 +14296,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/comment/comment.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function comment_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/comment/comment.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function comment_cron\\(\\) has no return type specified\\.$#',
@@ -16870,12 +16852,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/contact/tests/src/Unit/MailHandlerTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function content_moderation_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/content_moderation/content_moderation.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function content_moderation_action_info_alter\\(\\) has no return type specified\\.$#',
@@ -18076,12 +18052,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/content_translation/content_translation.admin.inc',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function content_translation_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/content_translation/content_translation.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function _content_translation_install_field_storage_definitions\\(\\) has no return type specified\\.$#',
@@ -19054,12 +19024,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/dblog/dblog.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function dblog_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/dblog/dblog.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function dblog_cron\\(\\) has no return type specified\\.$#',
@@ -19246,12 +19210,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/dynamic_page_cache/tests/dynamic_page_cache_test/src/DynamicPageCacheTestController.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function editor_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/editor/editor.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function _editor_delete_file_usage\\(\\) has no return type specified\\.$#',
@@ -19516,12 +19474,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function field_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/field/field.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function field_config_import_steps_alter\\(\\) has no return type specified\\.$#',
@@ -21394,12 +21346,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/file/file.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function file_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/file/file.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function file_cron\\(\\) has no return type specified\\.$#',
@@ -23014,12 +22960,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/help/help.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function help_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/help/help.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function help_block_view_help_block_alter\\(\\) has no return type specified\\.$#',
@@ -23212,12 +23152,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/history/history.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function history_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/history/history.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function history_cron\\(\\) has no return type specified\\.$#',
@@ -23398,12 +23332,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/image/image.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function image_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/image/image.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function image_entity_presave\\(\\) has no return type specified\\.$#',
@@ -24184,12 +24112,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/jsonapi/jsonapi.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function jsonapi_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/jsonapi/jsonapi.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function jsonapi_entity_bundle_create\\(\\) has no return type specified\\.$#',
@@ -25186,12 +25108,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/language/language.admin.inc',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function language_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/language/language.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function language_configuration_element_submit\\(\\) has no return type specified\\.$#',
@@ -26200,12 +26116,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/layout_builder/layout_builder.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function layout_builder_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/layout_builder/layout_builder.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function layout_builder_block_content_access\\(\\) has no return type specified\\.$#',
@@ -27994,12 +27904,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/locale/locale.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function locale_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/locale/locale.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function _locale_parse_js_file\\(\\) has no return type specified\\.$#',
@@ -28936,12 +28840,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/media/media.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function media_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/media/media.install',
-];
 $ignoreErrors[] = [
 	// identifier: empty.variable
 	'message' => '#^Variable \\$error in empty\\(\\) always exists and is not falsy\\.$#',
@@ -29968,12 +29866,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/media/tests/src/Unit/ResourceTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function media_library_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/media_library/media_library.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function _media_library_media_type_form_submit\\(\\) has no return type specified\\.$#',
@@ -30472,12 +30364,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/media_library/tests/src/Kernel/MediaLibraryWidgetTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function menu_link_content_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/menu_link_content/menu_link_content.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function _menu_link_content_update_path_alias\\(\\) has no return type specified\\.$#',
@@ -31018,12 +30904,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/menu_ui/tests/src/Kernel/MenuBlockTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function migrate_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/migrate/migrate.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function migrate_help\\(\\) has no return type specified\\.$#',
@@ -32150,12 +32030,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/migrate/tests/src/Unit/process/SubstrTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function migrate_drupal_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/migrate_drupal/migrate_drupal.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function migrate_drupal_help\\(\\) has no return type specified\\.$#',
@@ -33558,12 +33432,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/node/node.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function node_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/node/node.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function _node_access_rebuild_batch_finished\\(\\) has no return type specified\\.$#',
@@ -35844,12 +35712,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/page_cache/tests/src/Functional/PageCacheTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function path_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/path/path.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function path_entity_base_field_info\\(\\) has no return type specified\\.$#',
@@ -36264,12 +36126,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/pgsql/pgsql.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function pgsql_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/pgsql/pgsql.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function pgsql_help\\(\\) has no return type specified\\.$#',
@@ -36618,12 +36474,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/responsive_image/tests/src/Kernel/Plugin/migrate/source/d7/ResponsiveImageStylesTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function rest_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/rest/rest.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function rest_help\\(\\) has no return type specified\\.$#',
@@ -38016,12 +37866,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/search/tests/src/Kernel/SearchTokenizerTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function serialization_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/serialization/serialization.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function serialization_help\\(\\) has no return type specified\\.$#',
@@ -38910,12 +38754,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/syslog/src/Logger/SysLog.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function syslog_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/syslog/syslog.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function syslog_help\\(\\) has no return type specified\\.$#',
@@ -39744,12 +39582,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/system/system.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function system_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/system/system.install',
-];
 $ignoreErrors[] = [
 	// identifier: variable.undefined
 	'message' => '#^Variable \\$directories might not be defined\\.$#',
@@ -42656,12 +42488,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function equivalent_update_test_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\error_service_test\\\\Controller\\\\LonelyMonkeyController\\:\\:testBrokenClass\\(\\) has no return type specified\\.$#',
@@ -44877,12 +44703,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/system/tests/modules/update_script_test/update_script_test.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function update_script_test_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/system/tests/modules/update_script_test/update_script_test.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function update_script_test_cache_flush\\(\\) has no return type specified\\.$#',
@@ -45015,12 +44835,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/system/tests/modules/update_test_last_removed/update_test_last_removed.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function update_test_last_removed_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/system/tests/modules/update_test_last_removed/update_test_last_removed.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function update_test_no_preexisting_update_8001\\(\\) has no return type specified\\.$#',
@@ -45111,12 +44925,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/system/tests/modules/update_test_with_7x/update_test_with_7x.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function update_test_with_7x_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/system/tests/modules/update_test_with_7x/update_test_with_7x.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\Tests\\\\system\\\\Functional\\\\Batch\\\\ProcessingTest\\:\\:_resultMessages\\(\\) has no return type specified\\.$#',
@@ -47679,12 +47487,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/taxonomy/src/VocabularyListBuilder.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function taxonomy_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/taxonomy/taxonomy.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function taxonomy_build_node_index\\(\\) has no return type specified\\.$#',
@@ -48981,12 +48783,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/update/update.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function update_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/update/update.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function update_manager_batch_project_get\\(\\) has no return type specified\\.$#',
@@ -50721,12 +50517,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/user/user.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function user_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/user/user.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function _user_cancel\\(\\) has no return type specified\\.$#',
@@ -59253,12 +59043,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/views/tests/src/Unit/WizardPluginBaseTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function views_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/views/views.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function _views_query_tag_alter_condition\\(\\) has no return type specified\\.$#',
@@ -62445,12 +62229,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/workspaces/workspaces.install',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function workspaces_update_last_removed\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/workspaces/workspaces.install',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Function workspaces_cron\\(\\) has no return type specified\\.$#',
diff --git a/core/lib/Drupal/Core/Extension/module.api.php b/core/lib/Drupal/Core/Extension/module.api.php
index 1cca8e355268..c11770d9bf55 100644
--- a/core/lib/Drupal/Core/Extension/module.api.php
+++ b/core/lib/Drupal/Core/Extension/module.api.php
@@ -989,7 +989,7 @@ function hook_update_dependencies() {
  *
  * @see hook_update_N()
  */
-function hook_update_last_removed() {
+function hook_update_last_removed(): int {
   // We've removed the 8.x-1.x version of my_module, including database updates.
   // The next update function is my_module_update_8200().
   return 8103;
diff --git a/core/modules/block/block.install b/core/modules/block/block.install
index 0d2e66503fe4..bba25269c049 100644
--- a/core/modules/block/block.install
+++ b/core/modules/block/block.install
@@ -20,6 +20,6 @@ function block_install(): void {
 /**
  * Implements hook_update_last_removed().
  */
-function block_update_last_removed() {
+function block_update_last_removed(): int {
   return 8003;
 }
diff --git a/core/modules/block_content/block_content.install b/core/modules/block_content/block_content.install
index 8b2652a018dd..07b0bbbb5c39 100644
--- a/core/modules/block_content/block_content.install
+++ b/core/modules/block_content/block_content.install
@@ -8,6 +8,6 @@
 /**
  * Implements hook_update_last_removed().
  */
-function block_content_update_last_removed() {
+function block_content_update_last_removed(): int {
   return 10300;
 }
diff --git a/core/modules/comment/comment.install b/core/modules/comment/comment.install
index 107b5a8f133e..e86e629a3439 100644
--- a/core/modules/comment/comment.install
+++ b/core/modules/comment/comment.install
@@ -114,6 +114,6 @@ function comment_schema() {
 /**
  * Implements hook_update_last_removed().
  */
-function comment_update_last_removed() {
+function comment_update_last_removed(): int {
   return 10100;
 }
diff --git a/core/modules/content_moderation/content_moderation.install b/core/modules/content_moderation/content_moderation.install
index d3e817c56713..546e580e41a3 100644
--- a/core/modules/content_moderation/content_moderation.install
+++ b/core/modules/content_moderation/content_moderation.install
@@ -8,6 +8,6 @@
 /**
  * Implements hook_update_last_removed().
  */
-function content_moderation_update_last_removed() {
+function content_moderation_update_last_removed(): int {
   return 8700;
 }
diff --git a/core/modules/content_translation/content_translation.install b/core/modules/content_translation/content_translation.install
index 85571166885a..a5a8b7dfdf8e 100644
--- a/core/modules/content_translation/content_translation.install
+++ b/core/modules/content_translation/content_translation.install
@@ -41,6 +41,6 @@ function content_translation_install(): void {
 /**
  * Implements hook_update_last_removed().
  */
-function content_translation_update_last_removed() {
+function content_translation_update_last_removed(): int {
   return 8400;
 }
diff --git a/core/modules/dblog/dblog.install b/core/modules/dblog/dblog.install
index 7cabc6addfa5..796799c7b7f9 100644
--- a/core/modules/dblog/dblog.install
+++ b/core/modules/dblog/dblog.install
@@ -96,6 +96,6 @@ function dblog_schema() {
 /**
  * Implements hook_update_last_removed().
  */
-function dblog_update_last_removed() {
+function dblog_update_last_removed(): int {
   return 10101;
 }
diff --git a/core/modules/editor/editor.install b/core/modules/editor/editor.install
index 6e17486a8702..ebc9167b2439 100644
--- a/core/modules/editor/editor.install
+++ b/core/modules/editor/editor.install
@@ -8,6 +8,6 @@
 /**
  * Implements hook_update_last_removed().
  */
-function editor_update_last_removed() {
+function editor_update_last_removed(): int {
   return 8001;
 }
diff --git a/core/modules/field/field.install b/core/modules/field/field.install
index 6b175e6afb33..a4ca7b420eda 100644
--- a/core/modules/field/field.install
+++ b/core/modules/field/field.install
@@ -8,6 +8,6 @@
 /**
  * Implements hook_update_last_removed().
  */
-function field_update_last_removed() {
+function field_update_last_removed(): int {
   return 8500;
 }
diff --git a/core/modules/file/file.install b/core/modules/file/file.install
index 7745a54041fc..cc816f6ec00c 100644
--- a/core/modules/file/file.install
+++ b/core/modules/file/file.install
@@ -108,6 +108,6 @@ function file_requirements($phase) {
 /**
  * Implements hook_update_last_removed().
  */
-function file_update_last_removed() {
+function file_update_last_removed(): int {
   return 8700;
 }
diff --git a/core/modules/help/help.install b/core/modules/help/help.install
index 6d646eb024a2..442aca8d277c 100644
--- a/core/modules/help/help.install
+++ b/core/modules/help/help.install
@@ -53,6 +53,6 @@ function help_schema() {
 /**
  * Implements hook_update_last_removed().
  */
-function help_update_last_removed() {
+function help_update_last_removed(): int {
   return 10200;
 }
diff --git a/core/modules/history/history.install b/core/modules/history/history.install
index 7222299842c0..80ff36378d36 100644
--- a/core/modules/history/history.install
+++ b/core/modules/history/history.install
@@ -45,6 +45,6 @@ function history_schema() {
 /**
  * Implements hook_update_last_removed().
  */
-function history_update_last_removed() {
+function history_update_last_removed(): int {
   return 10100;
 }
diff --git a/core/modules/image/image.install b/core/modules/image/image.install
index f4170dc6bc2e..e23421795441 100644
--- a/core/modules/image/image.install
+++ b/core/modules/image/image.install
@@ -73,6 +73,6 @@ function image_requirements($phase) {
 /**
  * Implements hook_update_last_removed().
  */
-function image_update_last_removed() {
+function image_update_last_removed(): int {
   return 8201;
 }
diff --git a/core/modules/jsonapi/jsonapi.install b/core/modules/jsonapi/jsonapi.install
index 3cc0ee0a8218..8db31414e1e4 100644
--- a/core/modules/jsonapi/jsonapi.install
+++ b/core/modules/jsonapi/jsonapi.install
@@ -79,6 +79,6 @@ function jsonapi_requirements($phase) {
 /**
  * Implements hook_update_last_removed().
  */
-function jsonapi_update_last_removed() {
+function jsonapi_update_last_removed(): int {
   return 9401;
 }
diff --git a/core/modules/language/language.install b/core/modules/language/language.install
index e3ab47e25099..b9d52e4f93be 100644
--- a/core/modules/language/language.install
+++ b/core/modules/language/language.install
@@ -8,6 +8,6 @@
 /**
  * Implements hook_update_last_removed().
  */
-function language_update_last_removed() {
+function language_update_last_removed(): int {
   return 8001;
 }
diff --git a/core/modules/layout_builder/layout_builder.install b/core/modules/layout_builder/layout_builder.install
index 2629b72c0963..587aa49153f9 100644
--- a/core/modules/layout_builder/layout_builder.install
+++ b/core/modules/layout_builder/layout_builder.install
@@ -79,6 +79,6 @@ function layout_builder_schema() {
 /**
  * Implements hook_update_last_removed().
  */
-function layout_builder_update_last_removed() {
+function layout_builder_update_last_removed(): int {
   return 8602;
 }
diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install
index 97422682472c..3ca2ce3db24f 100644
--- a/core/modules/locale/locale.install
+++ b/core/modules/locale/locale.install
@@ -319,7 +319,7 @@ function locale_requirements($phase) {
 /**
  * Implements hook_update_last_removed().
  */
-function locale_update_last_removed() {
+function locale_update_last_removed(): int {
   return 10100;
 }
 
diff --git a/core/modules/media/media.install b/core/modules/media/media.install
index b901db70ebea..0d4f40889302 100644
--- a/core/modules/media/media.install
+++ b/core/modules/media/media.install
@@ -178,6 +178,6 @@ function media_requirements($phase) {
 /**
  * Implements hook_update_last_removed().
  */
-function media_update_last_removed() {
+function media_update_last_removed(): int {
   return 8700;
 }
diff --git a/core/modules/media_library/media_library.install b/core/modules/media_library/media_library.install
index 92dbf65385e3..2aa41afe813c 100644
--- a/core/modules/media_library/media_library.install
+++ b/core/modules/media_library/media_library.install
@@ -22,6 +22,6 @@ function media_library_install($is_syncing): void {
 /**
  * Implements hook_update_last_removed().
  */
-function media_library_update_last_removed() {
+function media_library_update_last_removed(): int {
   return 8704;
 }
diff --git a/core/modules/menu_link_content/menu_link_content.install b/core/modules/menu_link_content/menu_link_content.install
index 6086ac08f59a..67630702efaa 100644
--- a/core/modules/menu_link_content/menu_link_content.install
+++ b/core/modules/menu_link_content/menu_link_content.install
@@ -8,6 +8,6 @@
 /**
  * Implements hook_update_last_removed().
  */
-function menu_link_content_update_last_removed() {
+function menu_link_content_update_last_removed(): int {
   return 8601;
 }
diff --git a/core/modules/migrate/migrate.install b/core/modules/migrate/migrate.install
index 8df7dd47ea6f..81872f497c59 100644
--- a/core/modules/migrate/migrate.install
+++ b/core/modules/migrate/migrate.install
@@ -8,6 +8,6 @@
 /**
  * Implements hook_update_last_removed().
  */
-function migrate_update_last_removed() {
+function migrate_update_last_removed(): int {
   return 10100;
 }
diff --git a/core/modules/migrate_drupal/migrate_drupal.install b/core/modules/migrate_drupal/migrate_drupal.install
index f5de03a7aca0..2a0a9c2d3942 100644
--- a/core/modules/migrate_drupal/migrate_drupal.install
+++ b/core/modules/migrate_drupal/migrate_drupal.install
@@ -8,6 +8,6 @@
 /**
  * Implements hook_update_last_removed().
  */
-function migrate_drupal_update_last_removed() {
+function migrate_drupal_update_last_removed(): int {
   return 8901;
 }
diff --git a/core/modules/node/node.install b/core/modules/node/node.install
index 85a3794b6986..d4bc1c5b717f 100644
--- a/core/modules/node/node.install
+++ b/core/modules/node/node.install
@@ -157,6 +157,6 @@ function node_uninstall(): void {
 /**
  * Implements hook_update_last_removed().
  */
-function node_update_last_removed() {
+function node_update_last_removed(): int {
   return 8700;
 }
diff --git a/core/modules/path/path.install b/core/modules/path/path.install
index 78efdc997d06..6e4d9c370df9 100644
--- a/core/modules/path/path.install
+++ b/core/modules/path/path.install
@@ -8,6 +8,6 @@
 /**
  * Implements hook_update_last_removed().
  */
-function path_update_last_removed() {
+function path_update_last_removed(): int {
   return 8200;
 }
diff --git a/core/modules/pgsql/pgsql.install b/core/modules/pgsql/pgsql.install
index 1c505fbb3574..881e871bff73 100644
--- a/core/modules/pgsql/pgsql.install
+++ b/core/modules/pgsql/pgsql.install
@@ -44,6 +44,6 @@ function pgsql_requirements() {
 /**
  * Implements hook_update_last_removed().
  */
-function pgsql_update_last_removed() {
+function pgsql_update_last_removed(): int {
   return 10101;
 }
diff --git a/core/modules/rest/rest.install b/core/modules/rest/rest.install
index 776f4591098c..6a80d19f0f96 100644
--- a/core/modules/rest/rest.install
+++ b/core/modules/rest/rest.install
@@ -8,6 +8,6 @@
 /**
  * Implements hook_update_last_removed().
  */
-function rest_update_last_removed() {
+function rest_update_last_removed(): int {
   return 8401;
 }
diff --git a/core/modules/serialization/serialization.install b/core/modules/serialization/serialization.install
index 0529e296f1a6..3114e7a3e615 100644
--- a/core/modules/serialization/serialization.install
+++ b/core/modules/serialization/serialization.install
@@ -8,6 +8,6 @@
 /**
  * Implements hook_update_last_removed().
  */
-function serialization_update_last_removed() {
+function serialization_update_last_removed(): int {
   return 8401;
 }
diff --git a/core/modules/syslog/syslog.install b/core/modules/syslog/syslog.install
index 6661887324e6..b204bf432db7 100644
--- a/core/modules/syslog/syslog.install
+++ b/core/modules/syslog/syslog.install
@@ -17,6 +17,6 @@ function syslog_install(): void {
 /**
  * Implements hook_update_last_removed().
  */
-function syslog_update_last_removed() {
+function syslog_update_last_removed(): int {
   return 8400;
 }
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index b903e574b5a7..5b921ee4696a 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -1661,7 +1661,7 @@ function system_schema() {
 /**
  * Implements hook_update_last_removed().
  */
-function system_update_last_removed() {
+function system_update_last_removed(): int {
   return 10201;
 }
 
diff --git a/core/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install b/core/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install
index 3a11103aa1f0..e264734728af 100644
--- a/core/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install
+++ b/core/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install
@@ -14,7 +14,7 @@
   /**
    * Implements hook_update_last_removed().
    */
-  function equivalent_update_test_update_last_removed() {
+  function equivalent_update_test_update_last_removed(): int {
     return \Drupal::state()->get('equivalent_update_test_update_last_removed', 100000);
   }
 
diff --git a/core/modules/system/tests/modules/update_script_test/update_script_test.install b/core/modules/system/tests/modules/update_script_test/update_script_test.install
index 6780fecd99f3..617444b82dd5 100644
--- a/core/modules/system/tests/modules/update_script_test/update_script_test.install
+++ b/core/modules/system/tests/modules/update_script_test/update_script_test.install
@@ -52,7 +52,7 @@ function update_script_test_requirements_alter(array &$requirements): void {
 /**
  * Implements hook_update_last_removed().
  */
-function update_script_test_update_last_removed() {
+function update_script_test_update_last_removed(): int {
   return 7110;
 }
 
diff --git a/core/modules/system/tests/modules/update_test_last_removed/update_test_last_removed.install b/core/modules/system/tests/modules/update_test_last_removed/update_test_last_removed.install
index 9fc56d1be8cb..e97f0d0e8613 100644
--- a/core/modules/system/tests/modules/update_test_last_removed/update_test_last_removed.install
+++ b/core/modules/system/tests/modules/update_test_last_removed/update_test_last_removed.install
@@ -10,7 +10,7 @@
 /**
  * Implements hook_update_last_removed().
  */
-function update_test_last_removed_update_last_removed() {
+function update_test_last_removed_update_last_removed(): int {
   return 8002;
 }
 
diff --git a/core/modules/system/tests/modules/update_test_with_7x/update_test_with_7x.install b/core/modules/system/tests/modules/update_test_with_7x/update_test_with_7x.install
index 74f4f9c6c034..6a53f0febae0 100644
--- a/core/modules/system/tests/modules/update_test_with_7x/update_test_with_7x.install
+++ b/core/modules/system/tests/modules/update_test_with_7x/update_test_with_7x.install
@@ -22,6 +22,6 @@ function update_test_with_7x_update_7201() {
 /**
  * Implements hook_update_last_removed().
  */
-function update_test_with_7x_update_last_removed() {
+function update_test_with_7x_update_last_removed(): int {
   return 7110;
 }
diff --git a/core/modules/taxonomy/taxonomy.install b/core/modules/taxonomy/taxonomy.install
index 04fa3fe2be5c..0df8b4dc68ec 100644
--- a/core/modules/taxonomy/taxonomy.install
+++ b/core/modules/taxonomy/taxonomy.install
@@ -8,6 +8,6 @@
 /**
  * Implements hook_update_last_removed().
  */
-function taxonomy_update_last_removed() {
+function taxonomy_update_last_removed(): int {
   return 10100;
 }
diff --git a/core/modules/update/update.install b/core/modules/update/update.install
index 3fb6136ab708..ad1f9bc20ee0 100644
--- a/core/modules/update/update.install
+++ b/core/modules/update/update.install
@@ -172,6 +172,6 @@ function _update_requirement_check($project, $type) {
 /**
  * Implements hook_update_last_removed().
  */
-function update_update_last_removed() {
+function update_update_last_removed(): int {
   return 8001;
 }
diff --git a/core/modules/user/user.install b/core/modules/user/user.install
index 0475c47d3758..0d4211433c00 100644
--- a/core/modules/user/user.install
+++ b/core/modules/user/user.install
@@ -122,6 +122,6 @@ function user_requirements($phase): array {
 /**
  * Implements hook_update_last_removed().
  */
-function user_update_last_removed() {
+function user_update_last_removed(): int {
   return 10000;
 }
diff --git a/core/modules/views/views.install b/core/modules/views/views.install
index cef5efae59f0..2f61cda60323 100644
--- a/core/modules/views/views.install
+++ b/core/modules/views/views.install
@@ -15,6 +15,6 @@ function views_install(): void {
 /**
  * Implements hook_update_last_removed().
  */
-function views_update_last_removed() {
+function views_update_last_removed(): int {
   return 8500;
 }
diff --git a/core/modules/workspaces/workspaces.install b/core/modules/workspaces/workspaces.install
index 96f45aad5ba6..d89b446a55b4 100644
--- a/core/modules/workspaces/workspaces.install
+++ b/core/modules/workspaces/workspaces.install
@@ -123,6 +123,6 @@ function workspaces_schema() {
 /**
  * Implements hook_update_last_removed().
  */
-function workspaces_update_last_removed() {
+function workspaces_update_last_removed(): int {
   return 8803;
 }
-- 
GitLab