WebhookProducer::publish()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
5
namespace Webhook\Bundle\Service;
6
7
use Enqueue\Client\ProducerInterface;
8
use Webhook\Domain\Model\Webhook;
9
10
/**
11
 * Class WebhookProducer
12
 *
13
 * @package Webhook\Bundle\Service
14
 */
15
final class WebhookProducer
16
{
17
    /** @var ProducerInterface */
18
    private $producer;
19
20
    /**
21
     * RatesCollector constructor.
22
     *
23
     * @param ProducerInterface $producer
24
     */
25
    public function __construct(ProducerInterface $producer)
26
    {
27
        $this->producer = $producer;
28
    }
29
30
    /**
31
     * @param Webhook $message
32
     */
33
    public function publish(Webhook $message)
34
    {
35
        $this->producer->sendCommand(WebhookProcessor::NAME, $message->getId());
36
    }
37
38
}