diff --git a/modules/social_features/social_core/src/EdaDummyHandler.php b/modules/social_features/social_core/src/EdaDummyHandler.php new file mode 100644 index 00000000000..8207726c722 --- /dev/null +++ b/modules/social_features/social_core/src/EdaDummyHandler.php @@ -0,0 +1,18 @@ +getDefinition('entity.autocomplete_matcher'); $definition->setClass('Drupal\social_core\Entity\EntityAutocompleteMatcher'); @@ -29,6 +30,14 @@ public function alter(ContainerBuilder $container) { $definition->setClass('Drupal\social_core\Entity\Select2EntityAutocompleteMatcher'); } } + + // Replaces all EDA Handlers with dummies if there is no Publisher. + if (!$container->hasDefinition(SocialEdaDispatcher::class)) { + foreach ($container->findTaggedServiceIds('social.eda.handler') as $id => $attributes) { + $definition = $container->getDefinition($id); + $definition->setClass(EdaDummyHandler::class); + } + } } } diff --git a/modules/social_features/social_event/social_event.services.yml b/modules/social_features/social_event/social_event.services.yml index 3c2a9a1525f..a4ef57c5bd4 100644 --- a/modules/social_features/social_event/social_event.services.yml +++ b/modules/social_features/social_event/social_event.services.yml @@ -22,3 +22,5 @@ services: social_event.eda_handler: autowire: true class: Drupal\social_event\EdaHandler + tags: + - { name: social.eda.handler } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f30e8132cd8..3420db89892 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -4763,11 +4763,6 @@ parameters: count: 1 path: modules/social_features/social_core/src/Routing/RouteSubscriber.php - - - message: "#^Method Drupal\\\\social_core\\\\SocialCoreServiceProvider\\:\\:alter\\(\\) has no return type specified\\.$#" - count: 1 - path: modules/social_features/social_core/src/SocialCoreServiceProvider.php - - message: "#^Method Drupal\\\\social_download_count\\\\SocialDownloadCountConfigOverride\\:\\:createConfigObject\\(\\) should return Drupal\\\\Core\\\\Config\\\\StorableConfigBase but returns null\\.$#" count: 1 @@ -13400,3 +13395,8 @@ parameters: message: "#^Property Drupal\\\\social_event\\\\Event\\\\EventCreateEventData::\\$href has unknown class Drupal\\\\social_eda\\\\Types\\\\Href as its type\\.$#" count: 1 path: modules/social_features/social_event/src/Event/EventCreateEventData.php + + - + message: "#^Class Drupal\\\\social_eda_dispatcher\\\\Dispatcher not found\\.$#" + count: 1 + path: modules/social_features/social_core/src/SocialCoreServiceProvider.php