X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrupal%2Fdrupal-extension%2Fsrc%2FDrupal%2FDrupalExtension%2FCompiler%2FEventSubscriberPass.php;fp=vendor%2Fdrupal%2Fdrupal-extension%2Fsrc%2FDrupal%2FDrupalExtension%2FCompiler%2FEventSubscriberPass.php;h=45daa1da96bfcc36387220ef14b75149fbfd4d6e;hp=0000000000000000000000000000000000000000;hb=1270d9129ce8f27c9b28b10518e32132c58e0aca;hpb=c27c0f0cdaa3f354b1fe54a56ae7e854be6e3f68 diff --git a/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Compiler/EventSubscriberPass.php b/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Compiler/EventSubscriberPass.php new file mode 100644 index 000000000..45daa1da9 --- /dev/null +++ b/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Compiler/EventSubscriberPass.php @@ -0,0 +1,33 @@ +hasDefinition('drupal.event_dispatcher')) { + return; + } + $dispatcherDefinition = $container->getDefinition('drupal.event_dispatcher'); + + foreach ($container->findTaggedServiceIds('drupal.event_subscriber') as $id => $attributes) { + foreach ($attributes as $attribute) { + $priority = isset($attribute['priority']) ? intval($attribute['priority']) : 0; + $dispatcherDefinition->addMethodCall( + 'addSubscriber', array(new Reference($id), $priority) + ); + } + } + } +}