Skip to content
Snippets Groups Projects
Commit 275b73af authored by Nathan Rogers's avatar Nathan Rogers Committed by Stefan Auditor
Browse files

Issue #3399988 by nrogers, ilya.no, viren18febs, sanduhrs, svendecabooter:...

Issue #3399988 by nrogers, ilya.no, viren18febs, sanduhrs, svendecabooter: WebhookDispatcher has incorrect plugin implementation 
parent a123e8ef
No related branches found
No related tags found
1 merge request!6Update WebhookDispatcher.
Pipeline #500896 passed
......@@ -2,7 +2,6 @@
namespace Drupal\webhooks\Plugin\QueueWorker;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Queue\QueueWorkerBase;
use Drupal\Core\Queue\SuspendQueueException;
......@@ -10,6 +9,7 @@ use Drupal\webhooks\Entity\WebhookConfig;
use Drupal\webhooks\Event\ReceiveEvent;
use Drupal\webhooks\Event\WebhookEvents;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
/**
* A Webhook dispatcher that dispatches webhooks on CRON run.
......@@ -25,17 +25,29 @@ final class WebhookDispatcher extends QueueWorkerBase implements ContainerFactor
/**
* The event dispatcher.
*
* @var \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher
* @var \Symfony\Contracts\EventDispatcher\EventDispatcherInterface
*/
protected $eventDispatcher;
/**
* WebhookDispatcherBase constructor.
* WebhookDispatcher constructor.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Symfony\Contracts\EventDispatcher\EventDispatcherInterface $event_dispatcher
* The event dispatcher.
*/
public function __construct(EventDispatcherInterface $event_dispatcher) {
public function __construct(
array $configuration,
$plugin_id,
$plugin_definition,
EventDispatcherInterface $event_dispatcher,
) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->eventDispatcher = $event_dispatcher;
}
......@@ -43,7 +55,10 @@ final class WebhookDispatcher extends QueueWorkerBase implements ContainerFactor
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new self(
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('event_dispatcher')
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment