WebhookProducer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A publish() 0 4 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
}