diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php
index 2a9e91999164272d26634bb88abf26e17be309d3..875156117c7e75772101b4ba4c88dcd3bf8c9222 100644
--- a/core/.phpstan-baseline.php
+++ b/core/.phpstan-baseline.php
@@ -11530,12 +11530,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/big_pipe/src/Hook/BigPipeHooks.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\big_pipe\\\\Hook\\\\BigPipeHooks\\:\\:pageAttachments\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/big_pipe/src/Hook/BigPipeHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\big_pipe\\\\Render\\\\BigPipe\\:\\:performPostSendTasks\\(\\) has no return type specified\\.$#',
@@ -11644,12 +11638,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/big_pipe/tests/modules/big_pipe_test/src/Form/BigPipeTestForm.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\big_pipe_test\\\\Hook\\\\BigPipeTestHooks\\:\\:pageTop\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/big_pipe/tests/modules/big_pipe_test/src/Hook/BigPipeTestHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\Tests\\\\big_pipe\\\\Unit\\\\Render\\\\BigPipeResponseAttachmentsProcessorTest\\:\\:attachmentsProvider\\(\\) has no return type specified\\.$#',
@@ -11836,12 +11824,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/block/src/Hook/BlockHooks.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\block\\\\Hook\\\\BlockHooks\\:\\:pageTop\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/block/src/Hook/BlockHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\block\\\\Hook\\\\BlockHooks\\:\\:rebuild\\(\\) has no return type specified\\.$#',
@@ -16774,12 +16756,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/content_translation/src/Hook/ContentTranslationHooks.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\content_translation\\\\Hook\\\\ContentTranslationHooks\\:\\:pageAttachments\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/content_translation/src/Hook/ContentTranslationHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\content_translation\\\\Plugin\\\\Validation\\\\Constraint\\\\ContentTranslationSynchronizedFieldsConstraintValidator\\:\\:create\\(\\) has no return type specified\\.$#',
@@ -17122,12 +17098,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/contextual/src/Hook/ContextualHooks.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\contextual\\\\Hook\\\\ContextualHooks\\:\\:pageAttachments\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/contextual/src/Hook/ContextualHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\contextual\\\\Hook\\\\ContextualHooks\\:\\:toolbar\\(\\) has no return type specified\\.$#',
@@ -23434,12 +23404,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/language/tests/language_test/src/Hook/LanguageTestHooks.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\language_test\\\\Hook\\\\LanguageTestHooks\\:\\:pageTop\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/language/tests/language_test/src/Hook/LanguageTestHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\Tests\\\\language\\\\Functional\\\\ConfigurableLanguageManagerTest\\:\\:setWaitForTerminate\\(\\) has no return type specified\\.$#',
@@ -30114,12 +30078,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/navigation/src/Hook/NavigationHooks.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\navigation\\\\Hook\\\\NavigationHooks\\:\\:pageTop\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/navigation/src/Hook/NavigationHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\navigation\\\\NavigationContentLinks\\:\\:create\\(\\) has no return type specified\\.$#',
@@ -30492,12 +30450,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/node/src/Hook/NodeHooks1.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\node\\\\Hook\\\\NodeHooks1\\:\\:pageTop\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/node/src/Hook/NodeHooks1.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\node\\\\Hook\\\\NodeHooks1\\:\\:ranking\\(\\) has no return type specified\\.$#',
@@ -34176,12 +34128,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/settings_tray/tests/modules/settings_tray_test/src/Plugin/Block/ValidationErrorBlock.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\settings_tray_test_css\\\\Hook\\\\SettingsTrayTestCssHooks\\:\\:pageAttachments\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/settings_tray/tests/modules/settings_tray_test_css/src/Hook/SettingsTrayTestCssHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\Tests\\\\settings_tray\\\\FunctionalJavascript\\\\SettingsTrayBlockFormTest\\:\\:getBlockTests\\(\\) has no return type specified\\.$#',
@@ -35388,12 +35334,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/system/src/Hook/SystemHooks.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\system\\\\Hook\\\\SystemHooks\\:\\:pageTop\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/system/src/Hook/SystemHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\system\\\\Hook\\\\SystemHooks\\:\\:updaterInfo\\(\\) has no return type specified\\.$#',
@@ -36306,12 +36246,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/system/tests/modules/common_test/src/Hook/CommonTestHooks.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\common_test\\\\Hook\\\\CommonTestHooks\\:\\:pageAttachments\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/system/tests/modules/common_test/src/Hook/CommonTestHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\condition_test\\\\FormController\\:\\:submitForm\\(\\) has no return type specified\\.$#',
@@ -36390,12 +36324,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/system/tests/modules/cron_queue_test/src/Plugin/QueueWorker/CronQueueTestSuspendQueue.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\css_disable_transitions_test\\\\Hook\\\\CssDisableTransitionsTestHooks\\:\\:pageAttachments\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/system/tests/modules/css_disable_transitions_test/src/Hook/CssDisableTransitionsTestHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\database_test\\\\Form\\\\DatabaseTestForm\\:\\:submitForm\\(\\) has no return type specified\\.$#',
@@ -38840,18 +38768,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/system/tests/modules/js_interaction_test/src/Controller/JSInteractionTestForm.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\js_testing_ajax_request_test\\\\Hook\\\\JsTestingAjaxRequestTestHooks\\:\\:pageAttachments\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/system/tests/modules/js_testing_ajax_request_test/src/Hook/JsTestingAjaxRequestTestHooks.php',
-];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\js_testing_log_test\\\\Hook\\\\JsTestingLogTestHooks\\:\\:pageAttachments\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/system/tests/modules/js_testing_log_test/src/Hook/JsTestingLogTestHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\jswebassert_test\\\\Controller\\\\TestController\\:\\:page\\(\\) has no return type specified\\.$#',
@@ -39060,12 +38976,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/system/tests/modules/new_dependency_test/src/SetterInjection.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\off_canvas_test\\\\Hook\\\\OffCanvasTestHooks\\:\\:pageAttachments\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/system/tests/modules/off_canvas_test/src/Hook/OffCanvasTestHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\pager_test\\\\Controller\\\\PagerTestController\\:\\:multiplePagers\\(\\) has no return type specified\\.$#',
@@ -39555,12 +39465,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/system/tests/modules/services_defaults_test/src/TestService.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\session_exists_cache_context_test\\\\Hook\\\\SessionExistsCacheContextTestHooks\\:\\:pageTop\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/system/tests/modules/session_exists_cache_context_test/src/Hook/SessionExistsCacheContextTestHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\session_test\\\\Controller\\\\SessionTestController\\:\\:triggerWriteException\\(\\) has no return type specified\\.$#',
@@ -39723,12 +39627,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/system/tests/modules/system_test/src/Hook/SystemTestHooks.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\system_test\\\\Hook\\\\SystemTestHooks\\:\\:pageAttachments\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/system/tests/modules/system_test/src/Hook/SystemTestHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\system_test\\\\MockFileTransfer\\:\\:getSettingsForm\\(\\) has no return type specified\\.$#',
@@ -39837,12 +39735,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/system/tests/modules/theme_test/src/EventSubscriber/ThemeTestSubscriber.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\theme_test\\\\Hook\\\\ThemeTestHooks\\:\\:pageBottom\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/system/tests/modules/theme_test/src/Hook/ThemeTestHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\theme_test\\\\ThemeTestController\\:\\:generalSuggestionAlter\\(\\) has no return type specified\\.$#',
@@ -43317,12 +43209,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/toolbar/src/Hook/ToolbarHooks.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\toolbar\\\\Hook\\\\ToolbarHooks\\:\\:pageTop\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/toolbar/src/Hook/ToolbarHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\toolbar\\\\Hook\\\\ToolbarHooks\\:\\:toolbar\\(\\) has no return type specified\\.$#',
@@ -43437,12 +43323,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/update/src/Hook/UpdateHooks.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Method Drupal\\\\update\\\\Hook\\\\UpdateHooks\\:\\:pageTop\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/update/src/Hook/UpdateHooks.php',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\update\\\\Hook\\\\UpdateHooks\\:\\:themesInstalled\\(\\) has no return type specified\\.$#',
diff --git a/core/lib/Drupal/Core/Render/theme.api.php b/core/lib/Drupal/Core/Render/theme.api.php
index 274e92ba5b53e87d593f0e3f275258d916f3d587..7926d15fdcc1f06c90f8dc0b653988d5d1842d10 100644
--- a/core/lib/Drupal/Core/Render/theme.api.php
+++ b/core/lib/Drupal/Core/Render/theme.api.php
@@ -1093,7 +1093,7 @@ function hook_css_alter(&$css, \Drupal\Core\Asset\AttachedAssetsInterface $asset
  *
  * @see hook_page_attachments_alter()
  */
-function hook_page_attachments(array &$attachments) {
+function hook_page_attachments(array &$attachments): void {
   // Unconditionally attach an asset to the page.
   $attachments['#attached']['library'][] = 'core/drupalSettings';
 
@@ -1119,7 +1119,7 @@ function hook_page_attachments(array &$attachments) {
  *
  * @see hook_page_attachments()
  */
-function hook_page_attachments_alter(array &$attachments) {
+function hook_page_attachments_alter(array &$attachments): void {
   // Conditionally remove an asset.
   if (in_array('core/jquery', $attachments['#attached']['library'])) {
     $index = array_search('core/jquery', $attachments['#attached']['library']);
@@ -1133,7 +1133,7 @@ function hook_page_attachments_alter(array &$attachments) {
  * @param array $page_top
  *   A renderable array representing the top of the page.
  */
-function hook_page_top(array &$page_top) {
+function hook_page_top(array &$page_top): void {
   $page_top['my_module'] = ['#markup' => 'This is the top.'];
 }
 
@@ -1143,7 +1143,7 @@ function hook_page_top(array &$page_top) {
  * @param array $page_bottom
  *   A renderable array representing the bottom of the page.
  */
-function hook_page_bottom(array &$page_bottom) {
+function hook_page_bottom(array &$page_bottom): void {
   $page_bottom['my_module'] = ['#markup' => 'This is the bottom.'];
 }
 
diff --git a/core/modules/big_pipe/src/Hook/BigPipeHooks.php b/core/modules/big_pipe/src/Hook/BigPipeHooks.php
index 370bfb899ccaca7f03bbe36afd28bf6eca98da99..72451b09c8771b043215070a6b85381c8d3a15bc 100644
--- a/core/modules/big_pipe/src/Hook/BigPipeHooks.php
+++ b/core/modules/big_pipe/src/Hook/BigPipeHooks.php
@@ -38,7 +38,7 @@ public function help($route_name, RouteMatchInterface $route_match) {
    * @see \Drupal\big_pipe\Controller\BigPipeController::setNoJsCookie()
    */
   #[Hook('page_attachments')]
-  public function pageAttachments(array &$page) {
+  public function pageAttachments(array &$page): void {
     // Routes that don't use BigPipe also don't need no-JS detection.
     if (\Drupal::routeMatch()->getRouteObject()->getOption('_no_big_pipe')) {
       return;
diff --git a/core/modules/big_pipe/tests/modules/big_pipe_test/src/Hook/BigPipeTestHooks.php b/core/modules/big_pipe/tests/modules/big_pipe_test/src/Hook/BigPipeTestHooks.php
index 691ef5837c32b0d39f634c6a46e7c64216d542c8..3a935fae6380a45bd07f20a41a41cc066c3dbc20 100644
--- a/core/modules/big_pipe/tests/modules/big_pipe_test/src/Hook/BigPipeTestHooks.php
+++ b/core/modules/big_pipe/tests/modules/big_pipe_test/src/Hook/BigPipeTestHooks.php
@@ -15,7 +15,7 @@ class BigPipeTestHooks {
    * Implements hook_page_top().
    */
   #[Hook('page_top')]
-  public function pageTop(array &$page_top) {
+  public function pageTop(array &$page_top): void {
     // Ensure this hook is invoked on every page load.
     $page_top['#cache']['max-age'] = 0;
     $request = \Drupal::request();
diff --git a/core/modules/block/src/Hook/BlockHooks.php b/core/modules/block/src/Hook/BlockHooks.php
index 4ded5e2660bf7f162aa6d429d692228ff11e2dbf..32eb48c323bacc33ce662b4391411269f26a86eb 100644
--- a/core/modules/block/src/Hook/BlockHooks.php
+++ b/core/modules/block/src/Hook/BlockHooks.php
@@ -65,7 +65,7 @@ public function theme() : array {
    * Implements hook_page_top().
    */
   #[Hook('page_top')]
-  public function pageTop(array &$page_top) {
+  public function pageTop(array &$page_top): void {
     if (\Drupal::routeMatch()->getRouteName() === 'block.admin_demo') {
       $theme = \Drupal::theme()->getActiveTheme()->getName();
       $page_top['backlink'] = [
diff --git a/core/modules/content_translation/src/Hook/ContentTranslationHooks.php b/core/modules/content_translation/src/Hook/ContentTranslationHooks.php
index 5307ebf4d5710ac83a9099af883ec9699730ceec..89e82dda8db303d4bcedb84dfadbcba7730dad9e 100644
--- a/core/modules/content_translation/src/Hook/ContentTranslationHooks.php
+++ b/core/modules/content_translation/src/Hook/ContentTranslationHooks.php
@@ -505,7 +505,7 @@ public function formLanguageContentSettingsFormAlter(array &$form, FormStateInte
    * Implements hook_page_attachments().
    */
   #[Hook('page_attachments')]
-  public function pageAttachments(&$page) {
+  public function pageAttachments(&$page): void {
     $cache = CacheableMetadata::createFromRenderArray($page);
     $route_match = \Drupal::routeMatch();
     // If the current route has no parameters, return.
diff --git a/core/modules/contextual/src/Hook/ContextualHooks.php b/core/modules/contextual/src/Hook/ContextualHooks.php
index f266c4227b4c81a72b2b517be670c88356ddaee4..bd1ddbf6c04216991229373fe6efa7f415826fd5 100644
--- a/core/modules/contextual/src/Hook/ContextualHooks.php
+++ b/core/modules/contextual/src/Hook/ContextualHooks.php
@@ -61,7 +61,7 @@ public function toolbar() {
    * @see contextual_preprocess()
    */
   #[Hook('page_attachments')]
-  public function pageAttachments(array &$page) {
+  public function pageAttachments(array &$page): void {
     if (!\Drupal::currentUser()->hasPermission('access contextual links')) {
       return;
     }
diff --git a/core/modules/language/tests/language_test/src/Hook/LanguageTestHooks.php b/core/modules/language/tests/language_test/src/Hook/LanguageTestHooks.php
index 3ea440db704260fbc2ed574b84d5a3857966044a..0288acc76cb98dac9186f01f7d0d78833c5f9308 100644
--- a/core/modules/language/tests/language_test/src/Hook/LanguageTestHooks.php
+++ b/core/modules/language/tests/language_test/src/Hook/LanguageTestHooks.php
@@ -18,7 +18,7 @@ class LanguageTestHooks {
    * Implements hook_page_top().
    */
   #[Hook('page_top')]
-  public function pageTop() {
+  public function pageTop(): void {
     if (\Drupal::moduleHandler()->moduleExists('language')) {
       language_test_store_language_negotiation();
       \Drupal::messenger()->addStatus(t('Language negotiation method: @name', [
diff --git a/core/modules/navigation/src/Hook/NavigationHooks.php b/core/modules/navigation/src/Hook/NavigationHooks.php
index 71b9a40791a036f0bb9c7594148cb50cdd280f74..b8abfdc0b637d2fbbf13e828f6a257dbe59ef223 100644
--- a/core/modules/navigation/src/Hook/NavigationHooks.php
+++ b/core/modules/navigation/src/Hook/NavigationHooks.php
@@ -44,7 +44,7 @@ public function help($route_name, RouteMatchInterface $route_match) {
    * Implements hook_page_top().
    */
   #[Hook('page_top')]
-  public function pageTop(array &$page_top) {
+  public function pageTop(array &$page_top): void {
     if (!\Drupal::currentUser()->hasPermission('access navigation')) {
       return;
     }
diff --git a/core/modules/node/src/Hook/NodeHooks1.php b/core/modules/node/src/Hook/NodeHooks1.php
index 073090e030662a1747cab2943473fdc9941185c7..663d16fd7cd54b1af93432bab65e9151ed82215c 100644
--- a/core/modules/node/src/Hook/NodeHooks1.php
+++ b/core/modules/node/src/Hook/NodeHooks1.php
@@ -266,7 +266,7 @@ public function userPredelete($account) {
    * Implements hook_page_top().
    */
   #[Hook('page_top')]
-  public function pageTop(array &$page_top) {
+  public function pageTop(array &$page_top): void {
     // Add 'Back to content editing' link on preview page.
     $route_match = \Drupal::routeMatch();
     if ($route_match->getRouteName() == 'entity.node.preview') {
diff --git a/core/modules/settings_tray/tests/modules/settings_tray_test_css/src/Hook/SettingsTrayTestCssHooks.php b/core/modules/settings_tray/tests/modules/settings_tray_test_css/src/Hook/SettingsTrayTestCssHooks.php
index 277d7e3b6ec00526ebc82d5f45956fc6317ebc81..46e85149e0fdbc8df660ba7ccc6f472b49edf6b1 100644
--- a/core/modules/settings_tray/tests/modules/settings_tray_test_css/src/Hook/SettingsTrayTestCssHooks.php
+++ b/core/modules/settings_tray/tests/modules/settings_tray_test_css/src/Hook/SettingsTrayTestCssHooks.php
@@ -15,7 +15,7 @@ class SettingsTrayTestCssHooks {
    * Implements hook_page_attachments().
    */
   #[Hook('page_attachments')]
-  public function pageAttachments(array &$attachments) {
+  public function pageAttachments(array &$attachments): void {
     // Unconditionally attach an asset to the page.
     $attachments['#attached']['library'][] = 'settings_tray_test_css/drupal.css_fix';
   }
diff --git a/core/modules/system/src/Hook/SystemHooks.php b/core/modules/system/src/Hook/SystemHooks.php
index bc37a1f50fea39174da7ac3a6cffbb5f6c29644d..90307fae353a82fd8a618c439f0b9a86da429f75 100644
--- a/core/modules/system/src/Hook/SystemHooks.php
+++ b/core/modules/system/src/Hook/SystemHooks.php
@@ -439,7 +439,7 @@ public function themeRegistryAlter(array &$theme_registry): void {
    * Implements hook_page_top().
    */
   #[Hook('page_top')]
-  public function pageTop() {
+  public function pageTop(): void {
     /** @var \Drupal\Core\Routing\AdminContext $admin_context */
     $admin_context = \Drupal::service('router.admin_context');
     if ($admin_context->isAdminRoute() && \Drupal::currentUser()->hasPermission('administer site configuration')) {
diff --git a/core/modules/system/tests/modules/common_test/src/Hook/CommonTestHooks.php b/core/modules/system/tests/modules/common_test/src/Hook/CommonTestHooks.php
index 7df7924d82ede79768705bfd5d90817a906c3534..7ba457eaf87b0d46ef090738de01f8dcc02639ee 100644
--- a/core/modules/system/tests/modules/common_test/src/Hook/CommonTestHooks.php
+++ b/core/modules/system/tests/modules/common_test/src/Hook/CommonTestHooks.php
@@ -124,7 +124,7 @@ public function cron(): void {
    * @see \Drupal\system\Tests\Common\PageRenderTest::assertPageRenderHookExceptions()
    */
   #[Hook('page_attachments')]
-  public function pageAttachments(array &$page) {
+  public function pageAttachments(array &$page): void {
     $page['#attached']['library'][] = 'core/foo';
     $page['#attached']['library'][] = 'core/bar';
     $page['#cache']['tags'] = ['example'];
diff --git a/core/modules/system/tests/modules/css_disable_transitions_test/src/Hook/CssDisableTransitionsTestHooks.php b/core/modules/system/tests/modules/css_disable_transitions_test/src/Hook/CssDisableTransitionsTestHooks.php
index a48fe1d4e89998d9e8afc85b4d44303f28662076..fe3920b57a059192d3d6d80a19b8d3d6d08c3b6c 100644
--- a/core/modules/system/tests/modules/css_disable_transitions_test/src/Hook/CssDisableTransitionsTestHooks.php
+++ b/core/modules/system/tests/modules/css_disable_transitions_test/src/Hook/CssDisableTransitionsTestHooks.php
@@ -15,7 +15,7 @@ class CssDisableTransitionsTestHooks {
    * Implements hook_page_attachments().
    */
   #[Hook('page_attachments')]
-  public function pageAttachments(array &$attachments) {
+  public function pageAttachments(array &$attachments): void {
     // Unconditionally attach an asset to the page.
     $attachments['#attached']['library'][] = 'css_disable_transitions_test/testing.css_disable_transitions_test';
   }
diff --git a/core/modules/system/tests/modules/js_testing_ajax_request_test/src/Hook/JsTestingAjaxRequestTestHooks.php b/core/modules/system/tests/modules/js_testing_ajax_request_test/src/Hook/JsTestingAjaxRequestTestHooks.php
index f7bf260b478368aec7c21c26fb5b6026eeb16cab..6b8f73e09ddc55c23bd7842cf00bcaabc0572077 100644
--- a/core/modules/system/tests/modules/js_testing_ajax_request_test/src/Hook/JsTestingAjaxRequestTestHooks.php
+++ b/core/modules/system/tests/modules/js_testing_ajax_request_test/src/Hook/JsTestingAjaxRequestTestHooks.php
@@ -15,7 +15,7 @@ class JsTestingAjaxRequestTestHooks {
    * Implements hook_page_attachments().
    */
   #[Hook('page_attachments')]
-  public function pageAttachments(array &$attachments) {
+  public function pageAttachments(array &$attachments): void {
     // Unconditionally attach an asset to the page.
     $attachments['#attached']['library'][] = 'js_testing_ajax_request_test/track_ajax_requests';
   }
diff --git a/core/modules/system/tests/modules/js_testing_log_test/src/Hook/JsTestingLogTestHooks.php b/core/modules/system/tests/modules/js_testing_log_test/src/Hook/JsTestingLogTestHooks.php
index 2e5b51b26ce026186d3edb822df3b1eebc37f47f..cd0291c0a21fa6b30717a8a16f8a8c79aab07a2f 100644
--- a/core/modules/system/tests/modules/js_testing_log_test/src/Hook/JsTestingLogTestHooks.php
+++ b/core/modules/system/tests/modules/js_testing_log_test/src/Hook/JsTestingLogTestHooks.php
@@ -15,7 +15,7 @@ class JsTestingLogTestHooks {
    * Implements hook_page_attachments().
    */
   #[Hook('page_attachments')]
-  public function pageAttachments(array &$attachments) {
+  public function pageAttachments(array &$attachments): void {
     // Unconditionally attach an asset to the page.
     $attachments['#attached']['library'][] = 'js_testing_log_test/deprecation_log';
   }
diff --git a/core/modules/system/tests/modules/off_canvas_test/src/Hook/OffCanvasTestHooks.php b/core/modules/system/tests/modules/off_canvas_test/src/Hook/OffCanvasTestHooks.php
index 56de094eb9e8c059586e9d4b936274a4757053a4..4fa7c429ebd78d2115d5ebd8af1deeda2554b1b8 100644
--- a/core/modules/system/tests/modules/off_canvas_test/src/Hook/OffCanvasTestHooks.php
+++ b/core/modules/system/tests/modules/off_canvas_test/src/Hook/OffCanvasTestHooks.php
@@ -15,7 +15,7 @@ class OffCanvasTestHooks {
    * Implements hook_page_attachments().
    */
   #[Hook('page_attachments')]
-  public function pageAttachments(array &$attachments) {
+  public function pageAttachments(array &$attachments): void {
     // This library wraps around the Drupal.offCanvas.resetSize() method and adds
     // a special data-resize-done attribute to help functional JavaScript tests
     // use the off-canvas area when it is fully loaded and ready to be interacted
diff --git a/core/modules/system/tests/modules/session_exists_cache_context_test/src/Hook/SessionExistsCacheContextTestHooks.php b/core/modules/system/tests/modules/session_exists_cache_context_test/src/Hook/SessionExistsCacheContextTestHooks.php
index efd440564ae46bfa308025195de694e627c33ae4..37ffcf270b5ec3b40c85c2b71caf57aa5886e90b 100644
--- a/core/modules/system/tests/modules/session_exists_cache_context_test/src/Hook/SessionExistsCacheContextTestHooks.php
+++ b/core/modules/system/tests/modules/session_exists_cache_context_test/src/Hook/SessionExistsCacheContextTestHooks.php
@@ -15,7 +15,7 @@ class SessionExistsCacheContextTestHooks {
    * Implements hook_page_top().
    */
   #[Hook('page_top')]
-  public function pageTop(array &$page_top) {
+  public function pageTop(array &$page_top): void {
     // Ensure this hook is invoked on every page load.
     $page_top['#cache']['max-age'] = 0;
     $request = \Drupal::request();
diff --git a/core/modules/system/tests/modules/system_test/src/Hook/SystemTestHooks.php b/core/modules/system/tests/modules/system_test/src/Hook/SystemTestHooks.php
index 1f9cb30c4a376b11560ca32736a5769ebb2e39e1..805f612f2ec7bda128f1193604531a1505c0507b 100644
--- a/core/modules/system/tests/modules/system_test/src/Hook/SystemTestHooks.php
+++ b/core/modules/system/tests/modules/system_test/src/Hook/SystemTestHooks.php
@@ -99,7 +99,7 @@ public function systemInfoAlter(&$info, Extension $file, $type): void {
    * Implements hook_page_attachments().
    */
   #[Hook('page_attachments')]
-  public function pageAttachments(array &$page) {
+  public function pageAttachments(array &$page): void {
     // Used by FrontPageTestCase to get the results of
     // \Drupal::service('path.matcher')->isFrontPage().
     $frontpage = \Drupal::state()->get('system_test.front_page_output', 0);
diff --git a/core/modules/system/tests/modules/theme_test/src/Hook/ThemeTestHooks.php b/core/modules/system/tests/modules/theme_test/src/Hook/ThemeTestHooks.php
index 5ab56d543d58869610c65ea09bed23c6e0f54711..25578bb0124f48eba4d5c7d0beefd7932edc0d7a 100644
--- a/core/modules/system/tests/modules/theme_test/src/Hook/ThemeTestHooks.php
+++ b/core/modules/system/tests/modules/theme_test/src/Hook/ThemeTestHooks.php
@@ -68,7 +68,7 @@ public function themeRegistryAlter(&$registry): void {
    * Implements hook_page_bottom().
    */
   #[Hook('page_bottom')]
-  public function pageBottom(array &$page_bottom) {
+  public function pageBottom(array &$page_bottom): void {
     $page_bottom['theme_test_page_bottom'] = ['#markup' => 'theme test page bottom markup'];
   }
 
diff --git a/core/modules/toolbar/src/Hook/ToolbarHooks.php b/core/modules/toolbar/src/Hook/ToolbarHooks.php
index 883b733cd334dc48c41df34cddad9e2b1c90153f..09553d0bb97168012a9e08b070daf8ec2b5e643f 100644
--- a/core/modules/toolbar/src/Hook/ToolbarHooks.php
+++ b/core/modules/toolbar/src/Hook/ToolbarHooks.php
@@ -55,7 +55,7 @@ public function theme($existing, $type, $theme, $path) : array {
    * Add admin toolbar to the top of the page automatically.
    */
   #[Hook('page_top')]
-  public function pageTop(array &$page_top) {
+  public function pageTop(array &$page_top): void {
     $page_top['toolbar'] = [
       '#type' => 'toolbar',
       '#access' => \Drupal::currentUser()->hasPermission('access toolbar'),
diff --git a/core/modules/update/src/Hook/UpdateHooks.php b/core/modules/update/src/Hook/UpdateHooks.php
index 71fc5c6ea7427973f64d571c79f9bccbee0c3f16..ff4e75054b1e2141a7ca05d98a7cd5a1ed604a7b 100644
--- a/core/modules/update/src/Hook/UpdateHooks.php
+++ b/core/modules/update/src/Hook/UpdateHooks.php
@@ -63,7 +63,7 @@ public function help($route_name, RouteMatchInterface $route_match) {
    * Implements hook_page_top().
    */
   #[Hook('page_top')]
-  public function pageTop() {
+  public function pageTop(): void {
     /** @var \Drupal\Core\Routing\AdminContext $admin_context */
     $admin_context = \Drupal::service('router.admin_context');
     $route_match = \Drupal::routeMatch();