X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FApi4%2FServices.php;h=fe88674de4de73d9acb5c283db6eb20121428041;hb=f7ecb545980361fe246e0fa00b80110efcb39628;hp=47b428403148fd0300727d46b8c16dfbbb07057a;hpb=8f222bab73b7274b30481c9c6daddee3538d8a09;p=civicrm-core.git diff --git a/CRM/Api4/Services.php b/CRM/Api4/Services.php index 47b4284031..fe88674de4 100644 --- a/CRM/Api4/Services.php +++ b/CRM/Api4/Services.php @@ -16,7 +16,7 @@ * @copyright CiviCRM LLC https://civicrm.org/licensing */ - +use Civi\Core\Event\EventScanner; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; use Symfony\Component\Config\FileLocator; @@ -43,11 +43,8 @@ class CRM_Api4_Services { $subscribers = $container->findTaggedServiceIds('event_subscriber'); foreach (array_keys($subscribers) as $subscriber) { - $getSubscribedEvents = [$container->findDefinition($subscriber)->getClass(), 'getSubscribedEvents']; - $dispatcher->addMethodCall( - 'addSubscriberServiceMap', - [$subscriber, $getSubscribedEvents()] - ); + $listenerMap = EventScanner::findListeners($container->findDefinition($subscriber)->getClass()); + $dispatcher->addMethodCall('addSubscriberServiceMap', [$subscriber, $listenerMap]); } // add spec providers