TestAsynchronousMessageProducerBridge   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 declare(strict_types = 1);
2
3
namespace TomCizek\SymfonyProoph\Tests\AsynchronousMessages\FakeImplementations;
4
5
use Prooph\Common\Messaging\Message;
6
use TomCizek\SymfonyProoph\AsynchronousMessages\AsynchronousMessageProducerBridge;
7
8
class TestAsynchronousMessageProducerBridge implements AsynchronousMessageProducerBridge
9
{
10
	public const KEY_ROUTING_KEY = 'routingKey';
11
	public const KEY_MESSAGE = 'message';
12
13
	private $published = [];
14
15
	public function publishWithRoutingKey(Message $message, string $routingKey): void
16
	{
17
		$this->published[] = [
18
			self::KEY_ROUTING_KEY => $routingKey,
19
			self::KEY_MESSAGE => $message,
20
		];
21
	}
22
23
	public function getPublished()
24
	{
25
		return $this->published;
26
	}
27
}
28