From b83467eabc86c3152bb5cebea7b9088807324ee0 Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Wed, 14 Jun 2023 13:59:48 +0100
Subject: [PATCH] Issue #3325557 by longwave, mondrake, kim.pepper: Enable more
 service autowiring by adding interface aliases to core modules

---
 .../announcements_feed.services.yml           |  1 +
 core/modules/ban/ban.services.yml             |  1 +
 core/modules/big_pipe/big_pipe.services.yml   |  1 +
 core/modules/block/block.services.yml         |  1 +
 core/modules/book/book.services.yml           |  4 ++
 .../breakpoint/breakpoint.services.yml        |  1 +
 core/modules/ckeditor5/ckeditor5.services.yml |  3 ++
 core/modules/comment/comment.services.yml     |  3 ++
 .../config_translation.services.yml           |  1 +
 core/modules/contact/contact.services.yml     |  1 +
 .../content_moderation.services.yml           |  2 +
 .../content_translation.services.yml          |  3 ++
 core/modules/file/file.services.yml           |  2 +
 core/modules/forum/forum.services.yml         |  2 +
 .../help_topics/help_topics.services.yml      |  1 +
 core/modules/jsonapi/jsonapi.services.yml     |  8 ++++
 core/modules/language/language.services.yml   |  3 ++
 .../layout_builder.services.yml               |  5 +++
 .../layout_discovery.services.yml             |  2 +
 core/modules/locale/locale.services.yml       |  5 +++
 core/modules/media/media.services.yml         |  4 ++
 .../media_library/media_library.services.yml  |  2 +
 core/modules/migrate/migrate.services.yml     |  4 ++
 .../migrate_drupal.services.yml               |  3 ++
 core/modules/node/node.services.yml           |  1 +
 .../path_alias/path_alias.services.yml        |  3 ++
 core/modules/search/search.services.yml       |  3 ++
 .../serialization/serialization.services.yml  |  1 +
 .../statistics/statistics.services.yml        |  1 +
 core/modules/system/system.services.yml       |  2 +
 core/modules/update/update.services.yml       |  3 ++
 core/modules/user/user.services.yml           |  4 ++
 core/modules/views/views.services.yml         |  5 +++
 .../workspaces/workspaces.services.yml        |  4 ++
 .../Core/DependencyInjection/AutowireTest.php | 43 +++++++++++--------
 35 files changed, 116 insertions(+), 17 deletions(-)

diff --git a/core/modules/announcements_feed/announcements_feed.services.yml b/core/modules/announcements_feed/announcements_feed.services.yml
index 39ec48442c07..408837cdee07 100644
--- a/core/modules/announcements_feed/announcements_feed.services.yml
+++ b/core/modules/announcements_feed/announcements_feed.services.yml
@@ -6,6 +6,7 @@ services:
   announcements_feed.fetcher:
     class: Drupal\announcements_feed\AnnounceFetcher
     arguments: ['@http_client', '@config.factory', '@keyvalue.expirable', '@logger.channel.announcements_feed', '%announcements_feed.feed_json_url%']
+  Drupal\announcements_feed\AnnounceFetcher: '@announcements_feed.fetcher'
   logger.channel.announcements_feed:
     parent: logger.channel_base
     arguments: ['announcements_feed']
diff --git a/core/modules/ban/ban.services.yml b/core/modules/ban/ban.services.yml
index 7baeaa9b7480..e23f62c772e5 100644
--- a/core/modules/ban/ban.services.yml
+++ b/core/modules/ban/ban.services.yml
@@ -4,6 +4,7 @@ services:
     arguments: ['@database']
     tags:
       - { name: backend_overridable }
+  Drupal\ban\BanIpManagerInterface: '@ban.ip_manager'
   ban.middleware:
     class: Drupal\ban\BanMiddleware
     arguments: ['@ban.ip_manager']
diff --git a/core/modules/big_pipe/big_pipe.services.yml b/core/modules/big_pipe/big_pipe.services.yml
index 09747e887fb8..764a0461e941 100644
--- a/core/modules/big_pipe/big_pipe.services.yml
+++ b/core/modules/big_pipe/big_pipe.services.yml
@@ -12,6 +12,7 @@ services:
   big_pipe:
     class: Drupal\big_pipe\Render\BigPipe
     arguments: ['@renderer', '@session', '@request_stack', '@http_kernel', '@event_dispatcher', '@config.factory']
+  Drupal\big_pipe\Render\BigPipe: '@big_pipe'
   html_response.attachments_processor.big_pipe:
     public: false
     class: \Drupal\big_pipe\Render\BigPipeResponseAttachmentsProcessor
diff --git a/core/modules/block/block.services.yml b/core/modules/block/block.services.yml
index 815f38578c82..b548ffaf4fb3 100644
--- a/core/modules/block/block.services.yml
+++ b/core/modules/block/block.services.yml
@@ -10,3 +10,4 @@ services:
   block.repository:
     class: Drupal\block\BlockRepository
     arguments: ['@entity_type.manager', '@theme.manager', '@context.handler']
+  Drupal\block\BlockRepositoryInterface: '@block.repository'
diff --git a/core/modules/book/book.services.yml b/core/modules/book/book.services.yml
index 63bd10b6c63c..780a6bffa4be 100644
--- a/core/modules/book/book.services.yml
+++ b/core/modules/book/book.services.yml
@@ -7,17 +7,21 @@ services:
   book.manager:
     class: Drupal\book\BookManager
     arguments: ['@entity_type.manager', '@string_translation', '@config.factory', '@book.outline_storage', '@renderer', '@language_manager', '@entity.repository', '@book.backend_chained_cache', '@book.memory_cache']
+  Drupal\book\BookManagerInterface: '@book.manager'
   book.outline:
     class: Drupal\book\BookOutline
     arguments: ['@book.manager']
+  Drupal\book\BookOutline: '@book.outline'
   book.export:
     class: Drupal\book\BookExport
     arguments: ['@entity_type.manager', '@book.manager', '@entity.repository']
+  Drupal\book\BookExport: '@book.export'
   book.outline_storage:
     class: Drupal\book\BookOutlineStorage
     arguments: ['@database']
     tags:
       - { name: backend_overridable }
+  Drupal\book\BookOutlineStorageInterface: '@book.outline_storage'
   access_check.book.removable:
     class: Drupal\book\Access\BookNodeIsRemovableAccessCheck
     arguments: ['@book.manager']
diff --git a/core/modules/breakpoint/breakpoint.services.yml b/core/modules/breakpoint/breakpoint.services.yml
index a1e86ec5b278..5bfcbe4111bc 100644
--- a/core/modules/breakpoint/breakpoint.services.yml
+++ b/core/modules/breakpoint/breakpoint.services.yml
@@ -4,3 +4,4 @@ services:
     arguments: ['@module_handler', '@theme_handler', '@cache.discovery', '@string_translation']
     tags:
       - { name: plugin_manager_cache_clear }
+  Drupal\breakpoint\BreakpointManagerInterface: '@breakpoint.manager'
diff --git a/core/modules/ckeditor5/ckeditor5.services.yml b/core/modules/ckeditor5/ckeditor5.services.yml
index b235935a8fe9..8f73ec072149 100644
--- a/core/modules/ckeditor5/ckeditor5.services.yml
+++ b/core/modules/ckeditor5/ckeditor5.services.yml
@@ -2,6 +2,7 @@ services:
   plugin.manager.ckeditor5.plugin:
     class: Drupal\ckeditor5\Plugin\CKEditor5PluginManager
     parent: default_plugin_manager
+  Drupal\ckeditor5\Plugin\CKEditor5PluginManagerInterface: '@plugin.manager.ckeditor5.plugin'
   # @todo Remove in Drupal 11: https://www.drupal.org/project/ckeditor5/issues/3239012
   plugin.manager.ckeditor4to5upgrade.plugin:
     public: false
@@ -15,11 +16,13 @@ services:
       - '@logger.channel.ckeditor5'
       - '@module_handler'
       - '@current_user'
+  Drupal\ckeditor5\SmartDefaultSettings: '@ckeditor5.smart_default_settings'
   ckeditor5.stylesheets.message:
     class: Drupal\ckeditor5\CKEditor5StylesheetsMessage
     arguments:
       - '@theme_handler'
       - '@config.factory'
+  Drupal\ckeditor5\CKEditor5StylesheetsMessage: '@ckeditor5.stylesheets.message'
   ckeditor5.ckeditor5_cache_tag:
     class: Drupal\ckeditor5\EventSubscriber\CKEditor5CacheTag
     arguments: ['@cache_tags.invalidator']
diff --git a/core/modules/comment/comment.services.yml b/core/modules/comment/comment.services.yml
index 3595854ceb07..f356ea1b7ab7 100644
--- a/core/modules/comment/comment.services.yml
+++ b/core/modules/comment/comment.services.yml
@@ -8,12 +8,14 @@ services:
   comment.manager:
     class: Drupal\comment\CommentManager
     arguments: ['@entity_type.manager', '@config.factory', '@string_translation', '@module_handler', '@current_user', '@entity_field.manager', '@entity_display.repository']
+  Drupal\comment\CommentManagerInterface: '@comment.manager'
 
   comment.statistics:
     class: Drupal\comment\CommentStatistics
     arguments: ['@database', '@current_user', '@entity_type.manager', '@state', '@database.replica']
     tags:
       - { name: backend_overridable }
+  Drupal\comment\CommentStatisticsInterface: '@comment.statistics'
 
   comment.lazy_builders:
     class: Drupal\comment\CommentLazyBuilders
@@ -22,3 +24,4 @@ services:
   comment.link_builder:
     class: Drupal\comment\CommentLinkBuilder
     arguments: ['@current_user', '@comment.manager', '@module_handler', '@string_translation', '@entity_type.manager']
+  Drupal\comment\CommentLinkBuilderInterface: '@comment.link_builder'
diff --git a/core/modules/config_translation/config_translation.services.yml b/core/modules/config_translation/config_translation.services.yml
index 4baaffa0fbac..adf636ed8507 100644
--- a/core/modules/config_translation/config_translation.services.yml
+++ b/core/modules/config_translation/config_translation.services.yml
@@ -25,3 +25,4 @@ services:
       - '@module_handler'
       - '@config.typed'
       - '@theme_handler'
+  Drupal\config_translation\ConfigMapperManagerInterface: '@plugin.manager.config_translation.mapper'
diff --git a/core/modules/contact/contact.services.yml b/core/modules/contact/contact.services.yml
index fef18ce78ca0..eee32c821791 100644
--- a/core/modules/contact/contact.services.yml
+++ b/core/modules/contact/contact.services.yml
@@ -7,6 +7,7 @@ services:
   contact.mail_handler:
     class: Drupal\contact\MailHandler
     arguments: ['@plugin.manager.mail', '@language_manager', '@logger.channel.contact', '@string_translation', '@entity_type.manager']
+  Drupal\contact\MailHandlerInterface: '@contact.mail_handler'
   logger.channel.contact:
     class: Drupal\Core\Logger\LoggerChannel
     factory: ['@logger.factory', 'get']
diff --git a/core/modules/content_moderation/content_moderation.services.yml b/core/modules/content_moderation/content_moderation.services.yml
index 8e72240006a2..401cf09090d1 100644
--- a/core/modules/content_moderation/content_moderation.services.yml
+++ b/core/modules/content_moderation/content_moderation.services.yml
@@ -2,9 +2,11 @@ services:
   content_moderation.state_transition_validation:
     class: Drupal\content_moderation\StateTransitionValidation
     arguments: ['@content_moderation.moderation_information']
+  Drupal\content_moderation\StateTransitionValidationInterface: '@content_moderation.state_transition_validation'
   content_moderation.moderation_information:
     class: Drupal\content_moderation\ModerationInformation
     arguments: ['@entity_type.manager', '@entity_type.bundle.info']
+  Drupal\content_moderation\ModerationInformationInterface: '@content_moderation.moderation_information'
   access_check.latest_revision:
     class: Drupal\content_moderation\Access\LatestRevisionCheck
     arguments: ['@content_moderation.moderation_information']
diff --git a/core/modules/content_translation/content_translation.services.yml b/core/modules/content_translation/content_translation.services.yml
index ac5bc1059145..b29f02e72c7b 100644
--- a/core/modules/content_translation/content_translation.services.yml
+++ b/core/modules/content_translation/content_translation.services.yml
@@ -2,6 +2,7 @@ services:
   content_translation.synchronizer:
     class: Drupal\content_translation\FieldTranslationSynchronizer
     arguments: ['@entity_type.manager', '@plugin.manager.field.field_type']
+  Drupal\content_translation\FieldTranslationSynchronizerInterface: '@content_translation.synchronizer'
 
   content_translation.subscriber:
     class: Drupal\content_translation\Routing\ContentTranslationRouteSubscriber
@@ -30,3 +31,5 @@ services:
   content_translation.manager:
     class: Drupal\content_translation\ContentTranslationManager
     arguments: ['@entity_type.manager', '@entity_type.bundle.info']
+  Drupal\content_translation\ContentTranslationManagerInterface: '@content_translation.manager'
+  Drupal\content_translation\BundleTranslationSettingsInterface: '@content_translation.manager'
diff --git a/core/modules/file/file.services.yml b/core/modules/file/file.services.yml
index 1aaaab614f27..d11c5f070af4 100644
--- a/core/modules/file/file.services.yml
+++ b/core/modules/file/file.services.yml
@@ -7,6 +7,8 @@ services:
   file.upload_handler:
     class: Drupal\file\Upload\FileUploadHandler
     arguments: [ '@file_system', '@entity_type.manager', '@stream_wrapper_manager', '@event_dispatcher', '@file.mime_type.guesser', '@current_user', '@request_stack', '@file.repository' ]
+  Drupal\file\Upload\FileUploadHandler: '@file.upload_handler'
   file.repository:
     class: Drupal\file\FileRepository
     arguments: [ '@file_system', '@stream_wrapper_manager', '@entity_type.manager', '@module_handler', '@file.usage', '@current_user' ]
+  Drupal\file\FileRepositoryInterface: '@file.repository'
diff --git a/core/modules/forum/forum.services.yml b/core/modules/forum/forum.services.yml
index 6268c2cf8aaf..15caa41b925b 100644
--- a/core/modules/forum/forum.services.yml
+++ b/core/modules/forum/forum.services.yml
@@ -4,6 +4,7 @@ services:
     arguments: ['@config.factory', '@entity_type.manager', '@database', '@string_translation', '@comment.manager', '@entity_field.manager']
     tags:
       - { name: backend_overridable }
+  Drupal\forum\ForumManagerInterface: '@forum_manager'
   forum.breadcrumb.node:
     class: Drupal\forum\Breadcrumb\ForumNodeBreadcrumbBuilder
     arguments: ['@entity_type.manager', '@config.factory', '@forum_manager', '@string_translation']
@@ -19,6 +20,7 @@ services:
     arguments: ['@database']
     tags:
       - { name: backend_overridable }
+  Drupal\forum\ForumIndexStorageInterface: '@forum.index_storage'
 
   forum.uninstall_validator:
     class: Drupal\forum\ForumUninstallValidator
diff --git a/core/modules/help_topics/help_topics.services.yml b/core/modules/help_topics/help_topics.services.yml
index 6a2754d77ffb..aae5415c3e3f 100644
--- a/core/modules/help_topics/help_topics.services.yml
+++ b/core/modules/help_topics/help_topics.services.yml
@@ -8,6 +8,7 @@ services:
   plugin.manager.help_topic:
     class: Drupal\help_topics\HelpTopicPluginManager
     arguments: ['@module_handler', '@theme_handler', '@cache.discovery', '%app.root%']
+  Drupal\help_topics\HelpTopicPluginManagerInterface: '@plugin.manager.help_topic'
   help.twig.loader:
     class: Drupal\help_topics\HelpTopicTwigLoader
     arguments: ['%app.root%', '@module_handler', '@theme_handler']
diff --git a/core/modules/jsonapi/jsonapi.services.yml b/core/modules/jsonapi/jsonapi.services.yml
index e54be7f253fc..377ee978f478 100644
--- a/core/modules/jsonapi/jsonapi.services.yml
+++ b/core/modules/jsonapi/jsonapi.services.yml
@@ -84,6 +84,7 @@ services:
   jsonapi.resource_type.repository:
     class: Drupal\jsonapi\ResourceType\ResourceTypeRepository
     arguments: ['@entity_type.manager', '@entity_type.bundle.info', '@entity_field.manager', '@cache.jsonapi_resource_types', '@event_dispatcher']
+  Drupal\jsonapi\ResourceType\ResourceTypeRepositoryInterface: '@jsonapi.resource_type.repository'
   jsonapi.route_enhancer:
     class: Drupal\jsonapi\Routing\RouteEnhancer
     tags:
@@ -91,11 +92,13 @@ services:
   jsonapi.field_resolver:
     class: Drupal\jsonapi\Context\FieldResolver
     arguments: ['@entity_type.manager', '@entity_field.manager', '@entity_type.bundle.info', '@jsonapi.resource_type.repository', '@module_handler', '@current_user']
+  Drupal\jsonapi\Context\FieldResolver: '@jsonapi.field_resolver'
   jsonapi.include_resolver:
     class: Drupal\jsonapi\IncludeResolver
     arguments:
       - '@entity_type.manager'
       - '@jsonapi.entity_access_checker'
+  Drupal\jsonapi\IncludeResolver: '@jsonapi.include_resolver'
   paramconverter.jsonapi.entity_uuid:
     parent: paramconverter.entity
     class: Drupal\jsonapi\ParamConverter\EntityUuidConverter
@@ -158,6 +161,7 @@ services:
     calls:
       # This is a temporary measure. JSON:API should not need to be aware of the Content Moderation module.
       - [setLatestRevisionCheck, ['@?access_check.latest_revision']] # This is only injected when the service is available.
+  Drupal\jsonapi\Access\EntityAccessChecker: '@jsonapi.entity_access_checker'
   access_check.jsonapi.relationship_route_access:
     class: Drupal\jsonapi\Access\RelationshipRouteAccessCheck
     arguments: ['@jsonapi.entity_access_checker']
@@ -186,6 +190,7 @@ services:
       - '@jsonapi.serializer'
       - '@datetime.time'
       - '@current_user'
+  Drupal\jsonapi\Controller\EntityResource: '@jsonapi.entity_resource'
   jsonapi.file_upload:
     class: Drupal\jsonapi\Controller\FileUpload
     arguments:
@@ -193,6 +198,7 @@ services:
       - '@entity_field.manager'
       - '@jsonapi.file.uploader.field'
       - '@http_kernel'
+  Drupal\jsonapi\Controller\FileUpload: '@jsonapi.file_upload'
 
   # Event subscribers.
   jsonapi.custom_query_parameter_names_validator.subscriber:
@@ -223,6 +229,7 @@ services:
     public: false
     tags:
       - { name: service_collector, tag: jsonapi_version_negotiator, call: addVersionNegotiator }
+  Drupal\jsonapi\Revisions\VersionNegotiator: '@jsonapi.version_negotiator'
   jsonapi.version_negotiator.default:
     arguments: ['@entity_type.manager']
     public: false
@@ -250,3 +257,4 @@ services:
     class: Drupal\jsonapi\Controller\TemporaryJsonapiFileFieldUploader
     public: false
     arguments: ['@logger.channel.file', '@file_system', '@file.mime_type.guesser', '@token', '@lock', '@config.factory']
+  Drupal\jsonapi\Controller\TemporaryJsonapiFileFieldUploader: '@jsonapi.file.uploader.field'
diff --git a/core/modules/language/language.services.yml b/core/modules/language/language.services.yml
index 4fda6484c185..ffc267f3f573 100644
--- a/core/modules/language/language.services.yml
+++ b/core/modules/language/language.services.yml
@@ -7,6 +7,7 @@ services:
     arguments: ['@language_manager', '@plugin.manager.language_negotiation_method', '@config.factory', '@settings', '@request_stack']
     calls:
       - [initLanguageManager]
+  Drupal\language\LanguageNegotiatorInterface: '@language_negotiator'
   language.config_subscriber:
     class: Drupal\language\EventSubscriber\ConfigSubscriber
     arguments: ['@language_manager', '@language.default', '@config.factory', '@language_negotiator']
@@ -18,6 +19,8 @@ services:
     tags:
       - { name: config.factory.override, priority: -254 }
       - { name: event_subscriber }
+  Drupal\language\Config\LanguageConfigFactoryOverrideInterface: '@language.config_factory_override'
+  Drupal\Core\Config\ConfigFactoryOverrideInterface: '@language.config_factory_override'
   language_converter:
     class: Drupal\language\LanguageConverter
     arguments: ['@language_manager']
diff --git a/core/modules/layout_builder/layout_builder.services.yml b/core/modules/layout_builder/layout_builder.services.yml
index 4e9fc3acda00..c70f15534275 100644
--- a/core/modules/layout_builder/layout_builder.services.yml
+++ b/core/modules/layout_builder/layout_builder.services.yml
@@ -2,6 +2,7 @@ services:
   layout_builder.tempstore_repository:
     class: Drupal\layout_builder\LayoutTempstoreRepository
     arguments: ['@tempstore.shared']
+  Drupal\layout_builder\LayoutTempstoreRepositoryInterface: '@layout_builder.tempstore_repository'
   access_check.entity.layout_builder_access:
     class: Drupal\layout_builder\Access\LayoutBuilderAccessCheck
     tags:
@@ -10,6 +11,7 @@ services:
     class: Drupal\layout_builder\SectionStorage\SectionStorageManager
     parent: default_plugin_manager
     arguments: ['@context.handler']
+  Drupal\layout_builder\SectionStorage\SectionStorageManagerInterface: '@plugin.manager.layout_builder.section_storage'
   layout_builder.routes:
     class: Drupal\layout_builder\Routing\LayoutBuilderRoutes
     arguments: ['@plugin.manager.layout_builder.section_storage']
@@ -38,6 +40,7 @@ services:
   layout_builder.sample_entity_generator:
     class: Drupal\layout_builder\Entity\LayoutBuilderSampleEntityGenerator
     arguments: ['@tempstore.shared', '@entity_type.manager']
+  Drupal\layout_builder\Entity\SampleEntityGeneratorInterface: '@layout_builder.sample_entity_generator'
   layout_builder.render_block_component_subscriber:
     class: Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray
     arguments: ['@current_user']
@@ -49,6 +52,7 @@ services:
   inline_block.usage:
     class: Drupal\layout_builder\InlineBlockUsage
     arguments: ['@database']
+  Drupal\layout_builder\InlineBlockUsageInterface: '@inline_block.usage'
   layout_builder.controller.entity_form:
     # Override the entity form controller to handle the entity layout_builder
     # operation.
@@ -56,6 +60,7 @@ services:
     class: Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController
     public: false
     arguments: ['@layout_builder.controller.entity_form.inner']
+  Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController: '@layout_builder.controller.entity_form'
   layout_builder.element.prepare_layout:
     class: Drupal\layout_builder\EventSubscriber\PrepareLayout
     arguments: ['@layout_builder.tempstore_repository', '@messenger']
diff --git a/core/modules/layout_discovery/layout_discovery.services.yml b/core/modules/layout_discovery/layout_discovery.services.yml
index 48d32292ccdd..fa984e0c254e 100644
--- a/core/modules/layout_discovery/layout_discovery.services.yml
+++ b/core/modules/layout_discovery/layout_discovery.services.yml
@@ -2,6 +2,8 @@ services:
   plugin.manager.core.layout:
     class: Drupal\Core\Layout\LayoutPluginManager
     arguments: ['@container.namespaces', '@cache.discovery', '@module_handler', '@theme_handler']
+  Drupal\Core\Layout\LayoutPluginManagerInterface: '@plugin.manager.core.layout'
   layout.icon_builder:
     class: Drupal\Core\Layout\Icon\SvgIconBuilder
     shared: false
+  Drupal\Core\Layout\Icon\IconBuilderInterface: '@layout.icon_builder'
diff --git a/core/modules/locale/locale.services.yml b/core/modules/locale/locale.services.yml
index b9f8fb807e7b..5a98a8482e75 100644
--- a/core/modules/locale/locale.services.yml
+++ b/core/modules/locale/locale.services.yml
@@ -3,20 +3,25 @@ services:
     class: Drupal\locale\LocaleDefaultConfigStorage
     arguments: ['@config.storage', '@language_manager', '%install_profile%']
     public: false
+  Drupal\locale\LocaleDefaultConfigStorage: '@locale.default.config.storage'
   locale.config_manager:
     class: Drupal\locale\LocaleConfigManager
     arguments: ['@config.storage', '@locale.storage', '@config.factory', '@config.typed', '@language_manager', '@locale.default.config.storage', '@config.manager']
+  Drupal\locale\LocaleConfigManager: '@locale.config_manager'
   locale.storage:
     class: Drupal\locale\StringDatabaseStorage
     arguments: ['@database']
     tags:
       - { name: backend_overridable }
+  Drupal\locale\StringStorageInterface: '@locale.storage'
   locale.project:
     class: Drupal\locale\LocaleProjectStorage
     arguments: ['@keyvalue']
+  Drupal\locale\LocaleProjectStorageInterface: '@locale.project'
   locale.plural.formula:
     class: Drupal\locale\PluralFormula
     arguments: ['@language_manager', '@state']
+  Drupal\locale\PluralFormulaInterface: '@locale.plural.formula'
   string_translator.locale.lookup:
     class: Drupal\locale\LocaleTranslation
     arguments: ['@locale.storage', '@cache.default', '@lock', '@config.factory', '@language_manager', '@request_stack']
diff --git a/core/modules/media/media.services.yml b/core/modules/media/media.services.yml
index 252a51dd0816..26c688b55d76 100644
--- a/core/modules/media/media.services.yml
+++ b/core/modules/media/media.services.yml
@@ -5,15 +5,19 @@ services:
   media.oembed.url_resolver:
     class: Drupal\media\OEmbed\UrlResolver
     arguments: ['@media.oembed.provider_repository', '@media.oembed.resource_fetcher', '@http_client', '@module_handler', '@cache.default']
+  Drupal\media\OEmbed\UrlResolverInterface: '@media.oembed.url_resolver'
   media.oembed.provider_repository:
     class: Drupal\media\OEmbed\ProviderRepository
     arguments: ['@http_client', '@config.factory', '@datetime.time', '@keyvalue', '@logger.factory']
+  Drupal\media\OEmbed\ProviderRepositoryInterface: '@media.oembed.provider_repository'
   media.oembed.resource_fetcher:
     class: Drupal\media\OEmbed\ResourceFetcher
     arguments: ['@http_client', '@media.oembed.provider_repository', '@cache.default']
+  Drupal\media\OEmbed\ResourceFetcherInterface: '@media.oembed.resource_fetcher'
   media.oembed.iframe_url_helper:
     class: Drupal\media\IFrameUrlHelper
     arguments: ['@router.request_context', '@private_key']
+  Drupal\media\IFrameUrlHelper: '@media.oembed.iframe_url_helper'
   media.config_subscriber:
     class: Drupal\media\EventSubscriber\MediaConfigSubscriber
     arguments: ['@router.builder', '@cache_tags.invalidator', '@entity_type.manager']
diff --git a/core/modules/media_library/media_library.services.yml b/core/modules/media_library/media_library.services.yml
index eaad55fcf50b..193fc19a15cb 100644
--- a/core/modules/media_library/media_library.services.yml
+++ b/core/modules/media_library/media_library.services.yml
@@ -2,6 +2,7 @@ services:
   media_library.ui_builder:
     class: Drupal\media_library\MediaLibraryUiBuilder
     arguments: ['@entity_type.manager', '@request_stack', '@views.executable', '@form_builder', '@media_library.opener_resolver']
+  Drupal\media_library\MediaLibraryUiBuilder: '@media_library.ui_builder'
   media_library.route_subscriber:
     class: Drupal\media_library\Routing\RouteSubscriber
     tags:
@@ -10,6 +11,7 @@ services:
     class: Drupal\media_library\OpenerResolver
     calls:
       - [setContainer, ['@service_container']]
+  Drupal\media_library\OpenerResolverInterface: '@media_library.opener_resolver'
   media_library.opener.field_widget:
     class: Drupal\media_library\MediaLibraryFieldWidgetOpener
     arguments: ['@entity_type.manager']
diff --git a/core/modules/migrate/migrate.services.yml b/core/modules/migrate/migrate.services.yml
index f18a22babf28..8b67ff02c9f3 100644
--- a/core/modules/migrate/migrate.services.yml
+++ b/core/modules/migrate/migrate.services.yml
@@ -30,9 +30,13 @@ services:
   plugin.manager.migration:
     class: Drupal\migrate\Plugin\MigrationPluginManager
     arguments: ['@module_handler', '@cache.discovery_migration', '@language_manager']
+  Drupal\migrate\Plugin\MigrationPluginManagerInterface: '@plugin.manager.migration'
+  Drupal\migrate\MigrateBuildDependencyInterface: '@plugin.manager.migration'
   migrate.lookup:
     class: Drupal\migrate\MigrateLookup
     arguments: ['@plugin.manager.migration']
+  Drupal\migrate\MigrateLookupInterface: '@migrate.lookup'
   migrate.stub:
     class: Drupal\migrate\MigrateStub
     arguments: ['@plugin.manager.migration']
+  Drupal\migrate\MigrateStubInterface: '@migrate.stub'
diff --git a/core/modules/migrate_drupal/migrate_drupal.services.yml b/core/modules/migrate_drupal/migrate_drupal.services.yml
index 741ae970d7de..80444d04750b 100644
--- a/core/modules/migrate_drupal/migrate_drupal.services.yml
+++ b/core/modules/migrate_drupal/migrate_drupal.services.yml
@@ -7,6 +7,7 @@ services:
       - '@cache.discovery'
       - '@module_handler'
       - '\Drupal\migrate_drupal\Annotation\MigrateField'
+  Drupal\migrate_drupal\Plugin\MigrateFieldPluginManagerInterface: '@plugin.manager.migrate.field'
   logger.channel.migrate_drupal:
     parent: logger.channel_base
     arguments: ['migrate_drupal']
@@ -16,6 +17,8 @@ services:
       - '@plugin.manager.migrate.field'
       - '@plugin.manager.migration'
       - '@logger.channel.migrate_drupal'
+  Drupal\migrate_drupal\FieldDiscoveryInterface: '@migrate_drupal.field_discovery'
   migrate_drupal.migration_state:
     class: Drupal\migrate_drupal\MigrationState
     arguments: ['@plugin.manager.migrate.field', '@module_handler', '@messenger', '@string_translation']
+  Drupal\migrate_drupal\MigrationState: '@migrate_drupal.migration_state'
diff --git a/core/modules/node/node.services.yml b/core/modules/node/node.services.yml
index 3de1fa88cbbf..e9ac3a260683 100644
--- a/core/modules/node/node.services.yml
+++ b/core/modules/node/node.services.yml
@@ -8,6 +8,7 @@ services:
     arguments: ['@database', '@module_handler', '@language_manager']
     tags:
       - { name: backend_overridable }
+  Drupal\node\NodeGrantDatabaseStorageInterface: '@node.grant_storage'
   access_check.node.preview:
     class: Drupal\node\Access\NodePreviewAccessCheck
     arguments: ['@entity_type.manager']
diff --git a/core/modules/path_alias/path_alias.services.yml b/core/modules/path_alias/path_alias.services.yml
index c36eee191edc..2d8b59aa96fa 100644
--- a/core/modules/path_alias/path_alias.services.yml
+++ b/core/modules/path_alias/path_alias.services.yml
@@ -13,13 +13,16 @@ services:
   path_alias.manager:
     class: Drupal\path_alias\AliasManager
     arguments: ['@path_alias.repository', '@path_alias.whitelist', '@language_manager', '@cache.data']
+  Drupal\path_alias\AliasManagerInterface: '@path_alias.manager'
   path_alias.repository:
     class: Drupal\path_alias\AliasRepository
     arguments: ['@database']
     tags:
       - { name: backend_overridable }
+  Drupal\path_alias\AliasRepositoryInterface: '@path_alias.repository'
   path_alias.whitelist:
     class: Drupal\path_alias\AliasWhitelist
     tags:
       - { name: needs_destruction }
     arguments: [path_alias_whitelist, '@cache.bootstrap', '@lock', '@state', '@path_alias.repository']
+  Drupal\path_alias\AliasWhitelistInterface: '@path_alias.whitelist'
diff --git a/core/modules/search/search.services.yml b/core/modules/search/search.services.yml
index 8f6e2a0fcc16..bda507af4f04 100644
--- a/core/modules/search/search.services.yml
+++ b/core/modules/search/search.services.yml
@@ -6,13 +6,16 @@ services:
   search.search_page_repository:
     class: Drupal\search\SearchPageRepository
     arguments: ['@config.factory', '@entity_type.manager']
+  Drupal\search\SearchPageRepositoryInterface: '@search.search_page_repository'
 
   search.index:
     class: Drupal\search\SearchIndex
     arguments: ['@config.factory', '@database','@database.replica', '@cache_tags.invalidator', '@search.text_processor']
     tags:
       - { name: backend_overridable }
+  Drupal\search\SearchIndexInterface: '@search.index'
 
   search.text_processor:
     class: Drupal\search\SearchTextProcessor
     arguments: ['@transliteration', '@config.factory', '@module_handler']
+  Drupal\search\SearchTextProcessorInterface: '@search.text_processor'
diff --git a/core/modules/serialization/serialization.services.yml b/core/modules/serialization/serialization.services.yml
index a5c6f67a728c..81120a046442 100644
--- a/core/modules/serialization/serialization.services.yml
+++ b/core/modules/serialization/serialization.services.yml
@@ -93,6 +93,7 @@ services:
       - { name: encoder, format: xml }
   serializer.entity_resolver:
     class: Drupal\serialization\EntityResolver\ChainEntityResolver
+  Drupal\serialization\EntityResolver\ChainEntityResolverInterface: '@serializer.entity_resolver'
   serializer.entity_resolver.uuid:
     class: Drupal\serialization\EntityResolver\UuidResolver
     tags:
diff --git a/core/modules/statistics/statistics.services.yml b/core/modules/statistics/statistics.services.yml
index cf15573024f0..beea6a6ccd08 100644
--- a/core/modules/statistics/statistics.services.yml
+++ b/core/modules/statistics/statistics.services.yml
@@ -4,3 +4,4 @@ services:
     arguments: ['@database', '@state', '@request_stack']
     tags:
       - { name: backend_overridable }
+  Drupal\statistics\StatisticsStorageInterface: '@statistics.storage.node'
diff --git a/core/modules/system/system.services.yml b/core/modules/system/system.services.yml
index dba427f4b3ed..36e821d8c878 100644
--- a/core/modules/system/system.services.yml
+++ b/core/modules/system/system.services.yml
@@ -10,6 +10,7 @@ services:
   system.manager:
     class: Drupal\system\SystemManager
     arguments: ['@module_handler', '@request_stack', '@menu.link_tree', '@menu.active_trail']
+  Drupal\system\SystemManager: '@system.manager'
   system.breadcrumb.default:
     class: Drupal\system\PathBasedBreadcrumbBuilder
     arguments: ['@router.request_context', '@access_manager', '@router', '@path_processor_manager', '@config.factory',  '@title_resolver', '@current_user', '@path.current', '@path.matcher']
@@ -59,6 +60,7 @@ services:
   system.sa_fetcher:
     class: Drupal\system\SecurityAdvisories\SecurityAdvisoriesFetcher
     arguments: ['@config.factory', '@keyvalue.expirable', '@http_client', '@extension.list.module', '@extension.list.theme', '@extension.list.profile', '@logger.channel.system', '@settings']
+  Drupal\system\SecurityAdvisories\SecurityAdvisoriesFetcher: '@system.sa_fetcher'
   system.advisories_config_subscriber:
     class: Drupal\system\EventSubscriber\AdvisoriesConfigSubscriber
     arguments: ['@system.sa_fetcher']
diff --git a/core/modules/update/update.services.yml b/core/modules/update/update.services.yml
index 545612dcb35b..0c19e7a010f0 100644
--- a/core/modules/update/update.services.yml
+++ b/core/modules/update/update.services.yml
@@ -7,12 +7,15 @@ services:
   update.manager:
     class: Drupal\update\UpdateManager
     arguments: ['@config.factory', '@module_handler', '@update.processor', '@string_translation', '@keyvalue.expirable', '@theme_handler', '@extension.list.module']
+  Drupal\update\UpdateManagerInterface: '@update.manager'
   update.processor:
     class: Drupal\update\UpdateProcessor
     arguments: ['@config.factory', '@queue', '@update.fetcher', '@state', '@private_key', '@keyvalue', '@keyvalue.expirable']
+  Drupal\update\UpdateProcessorInterface: '@update.processor'
   update.fetcher:
     class: Drupal\update\UpdateFetcher
     arguments: ['@config.factory', '@http_client', '@settings', '@logger.channel.update']
+  Drupal\update\UpdateFetcherInterface: '@update.fetcher'
   update.root:
     class: Drupal\update\UpdateRoot
     arguments: ['@kernel', '@request_stack']
diff --git a/core/modules/user/user.services.yml b/core/modules/user/user.services.yml
index f8f7d15f4e1b..cafc073d47f2 100644
--- a/core/modules/user/user.services.yml
+++ b/core/modules/user/user.services.yml
@@ -26,6 +26,7 @@ services:
     arguments: ['@database']
     tags:
       - { name: backend_overridable }
+  Drupal\user\UserDataInterface: '@user.data'
   user_maintenance_mode_subscriber:
     class: Drupal\user\EventSubscriber\MaintenanceModeSubscriber
     arguments: ['@maintenance_mode', '@current_user']
@@ -49,9 +50,11 @@ services:
   user.auth:
     class: Drupal\user\UserAuth
     arguments: ['@entity_type.manager', '@password']
+  Drupal\user\UserAuthInterface: '@user.auth'
   user.permissions:
     class: Drupal\user\PermissionHandler
     arguments: ['@module_handler', '@string_translation', '@controller_resolver']
+  Drupal\user\PermissionHandlerInterface: '@user.permissions'
   user.current_user_context:
     class: Drupal\user\ContextProvider\CurrentUserContext
     arguments: ['@current_user', '@entity_type.manager']
@@ -63,6 +66,7 @@ services:
   user.flood_control:
     class: Drupal\user\UserFloodControl
     arguments: ['@flood', '@event_dispatcher', '@request_stack']
+  Drupal\user\UserFloodControlInterface: '@user.flood_control'
   user.flood_subscriber:
     class: Drupal\user\EventSubscriber\UserFloodSubscriber
     arguments: ['@logger.channel.user']
diff --git a/core/modules/views/views.services.yml b/core/modules/views/views.services.yml
index 4ce2d449caaa..8d61f13cc428 100644
--- a/core/modules/views/views.services.yml
+++ b/core/modules/views/views.services.yml
@@ -61,15 +61,19 @@ services:
     arguments: ['@cache.default', '@config.factory', '@module_handler', '@language_manager']
     tags:
       - { name: backend_overridable }
+  Drupal\views\ViewsData: '@views.views_data'
   views.views_data_helper:
     class: Drupal\views\ViewsDataHelper
     arguments: ['@views.views_data']
+  Drupal\views\ViewsDataHelper: '@views.views_data_helper'
   views.executable:
     class: Drupal\views\ViewExecutableFactory
     arguments: ['@current_user', '@request_stack', '@views.views_data', '@router.route_provider']
+  Drupal\views\ViewExecutableFactory: '@views.executable'
   views.analyzer:
     class: Drupal\views\Analyzer
     arguments: ['@module_handler']
+  Drupal\views\Analyzer: '@views.analyzer'
   views.route_subscriber:
     class: Drupal\views\EventSubscriber\RouteSubscriber
     arguments: ['@entity_type.manager', '@state']
@@ -77,6 +81,7 @@ services:
       - { name: 'event_subscriber' }
   views.exposed_form_cache:
     class: Drupal\views\ExposedFormCache
+  Drupal\views\ExposedFormCache: '@views.exposed_form_cache'
   views.entity_schema_subscriber:
     class: Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber
     arguments: ['@entity_type.manager', '@logger.channel.default']
diff --git a/core/modules/workspaces/workspaces.services.yml b/core/modules/workspaces/workspaces.services.yml
index 4aa7de957aa1..2f30f5c76733 100644
--- a/core/modules/workspaces/workspaces.services.yml
+++ b/core/modules/workspaces/workspaces.services.yml
@@ -4,18 +4,22 @@ services:
     arguments: ['@request_stack', '@entity_type.manager', '@entity.memory_cache', '@current_user', '@state', '@logger.channel.workspaces', '@class_resolver', '@workspaces.association']
     tags:
       - { name: service_id_collector, tag: workspace_negotiator }
+  Drupal\workspaces\WorkspaceManagerInterface: '@workspaces.manager'
   workspaces.operation_factory:
     class: Drupal\workspaces\WorkspaceOperationFactory
     arguments: ['@entity_type.manager', '@database', '@workspaces.manager', '@workspaces.association', '@cache_tags.invalidator', '@event_dispatcher', '@logger.channel.workspaces']
+  Drupal\workspaces\WorkspaceOperationFactory: '@workspaces.operation_factory'
   workspaces.association:
     class: Drupal\workspaces\WorkspaceAssociation
     arguments: ['@database', '@entity_type.manager', '@workspaces.repository', '@logger.channel.workspaces']
     tags:
       - { name: backend_overridable }
       - { name: event_subscriber }
+  Drupal\workspaces\WorkspaceAssociationInterface: '@workspaces.association'
   workspaces.repository:
     class: Drupal\workspaces\WorkspaceRepository
     arguments: ['@entity_type.manager', '@cache.default']
+  Drupal\workspaces\WorkspaceRepositoryInterface: '@workspaces.repository'
 
   workspaces.negotiator.session:
     class: Drupal\workspaces\Negotiator\SessionWorkspaceNegotiator
diff --git a/core/tests/Drupal/KernelTests/Core/DependencyInjection/AutowireTest.php b/core/tests/Drupal/KernelTests/Core/DependencyInjection/AutowireTest.php
index ac8246c8ef86..5bfd6d48f75c 100644
--- a/core/tests/Drupal/KernelTests/Core/DependencyInjection/AutowireTest.php
+++ b/core/tests/Drupal/KernelTests/Core/DependencyInjection/AutowireTest.php
@@ -8,6 +8,7 @@
 use Drupal\Core\Database\Connection;
 use Drupal\Core\DrupalKernelInterface;
 use Drupal\Core\Serialization\Yaml;
+use Drupal\KernelTests\FileSystemModuleDiscoveryDataProviderTrait;
 use Drupal\KernelTests\KernelTestBase;
 
 /**
@@ -17,6 +18,8 @@
  */
 class AutowireTest extends KernelTestBase {
 
+  use FileSystemModuleDiscoveryDataProviderTrait;
+
   /**
    * {@inheritdoc}
    */
@@ -44,26 +47,32 @@ public function testAutowire(): void {
   public function testCoreServiceAliases(): void {
     $services = [];
     $aliases = [];
-    foreach (Yaml::decode(file_get_contents('core/core.services.yml'))['services'] as $id => $service) {
-      if (is_string($service)) {
-        $aliases[$id] = substr($service, 1);
-      }
-      elseif (isset($service['class']) && class_exists($service['class'])) {
-        // Ignore certain tagged services.
-        if (isset($service['tags'])) {
-          foreach ($service['tags'] as $tag) {
-            if (in_array($tag['name'], [
-              'access_check',
-              'cache.context',
-              'context_provider',
-              'module_install.uninstall_validator',
-            ])) {
-              continue 2;
+
+    $filenames = array_map(fn($module) => "core/modules/{$module[0]}/{$module[0]}.services.yml", $this->coreModuleListDataProvider());
+    $filenames[] = 'core/core.services.yml';
+    foreach (array_filter($filenames, 'file_exists') as $filename) {
+      foreach (Yaml::decode(file_get_contents($filename))['services'] as $id => $service) {
+        if (is_string($service)) {
+          $aliases[$id] = substr($service, 1);
+        }
+        elseif (isset($service['class']) && class_exists($service['class'])) {
+          // Ignore certain tagged services.
+          if (isset($service['tags'])) {
+            foreach ($service['tags'] as $tag) {
+              if (in_array($tag['name'], [
+                'access_check',
+                'cache.context',
+                'context_provider',
+                'event_subscriber',
+                'module_install.uninstall_validator',
+              ])) {
+                continue 2;
+              }
             }
           }
-        }
 
-        $services[$id] = $service['class'];
+          $services[$id] = $service['class'];
+        }
       }
     }
 
-- 
GitLab