initialize webhook with worker

This commit is contained in:
aynsix
2019-09-20 16:55:03 +04:00
parent 65d7affcb5
commit 9aaf66dd7c
3 changed files with 14 additions and 4 deletions

View File

@@ -12,7 +12,7 @@
namespace Alchemy\Phrasea\Model\Manipulator;
use Alchemy\Phrasea\Model\Entities\WebhookEvent;
use Alchemy\Phrasea\Webhook\WebhookPublisher;
use Alchemy\Phrasea\Webhook\WebhookPublisherInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityRepository;
@@ -29,11 +29,11 @@ class WebhookEventManipulator implements ManipulatorInterface
private $repository;
/**
* @var WebhookPublisher
* @var WebhookPublisherInterface
*/
private $publisher;
public function __construct(ObjectManager $om, EntityRepository $repo, WebhookPublisher $publisher)
public function __construct(ObjectManager $om, EntityRepository $repo, WebhookPublisherInterface $publisher)
{
$this->om = $om;
$this->repository = $repo;

View File

@@ -19,7 +19,7 @@ use Alchemy\Queue\MessageQueueRegistry;
* Class WebhookPublisher publishes webhook event notifications in message queues
* @package Alchemy\Phrasea\Webhook
*/
class WebhookPublisher
class WebhookPublisher implements WebhookPublisherInterface
{
/**
* @var MessageQueueRegistry

View File

@@ -0,0 +1,10 @@
<?php
namespace Alchemy\Phrasea\Webhook;
use Alchemy\Phrasea\Model\Entities\WebhookEvent;
interface WebhookPublisherInterface
{
public function publishWebhookEvent(WebhookEvent $event);
}