AbstractTestAsynchronousMessageProducerBridge   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A publishWithRoutingKey() 0 7 1
A getPublished() 0 4 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace TomCizek\AsynchronousRouter\Tests\DependencyInjection\Fixture\Model;
6
7
use Prooph\Common\Messaging\Message;
8
use TomCizek\AsynchronousRouter\AsynchronousMessageProducerBridge;
9
10
class AbstractTestAsynchronousMessageProducerBridge implements AsynchronousMessageProducerBridge
11
{
12
    public const KEY_ROUTING_KEY = 'routingKey';
13
    public const KEY_MESSAGE = 'message';
14
15
    private $published = [];
16
17
    public function publishWithRoutingKey(Message $message, string $routingKey): void
18
    {
19
        $this->published[] = [
20
            self::KEY_ROUTING_KEY => $routingKey,
21
            self::KEY_MESSAGE => $message,
22
        ];
23
    }
24
25
    public function getPublished()
26
    {
27
        return $this->published;
28
    }
29
}
30