Code Duplication    Length = 30-30 lines in 2 locations

src/Infrastructure/AmqpLib/v26/RabbitMQ/DomainEvent/Publisher.php 1 location

@@ 12-41 (lines=30) @@
9
use Psr\Log\LoggerInterface;
10
11
12
class Publisher extends DomainPublisher
13
{
14
    /**
15
     * Publisher constructor.
16
     * @param string $host
17
     * @param int $port
18
     * @param string $user
19
     * @param string $password
20
     * @param string $vHost
21
     * @param string $exchangeName
22
     * @param LoggerInterface $logger
23
     */
24
    public function __construct(
25
        $host,
26
        $port,
27
        $user,
28
        $password,
29
        $vHost,
30
        $exchangeName,
31
        LoggerInterface $logger
32
    )
33
    {
34
        $queueWriter = new QueueWriter(
35
            new AMQPLazyConnection($host, $port, $user, $password, $vHost),
36
            new ExchangeConfig($exchangeName, 'topic', false, true, false),
37
            $logger
38
        );
39
        parent::__construct($queueWriter);
40
    }
41
}

src/Infrastructure/AmqpLib/v26/RabbitMQ/Task/Producer.php 1 location

@@ 12-41 (lines=30) @@
9
use Psr\Log\LoggerInterface;
10
11
12
class Producer extends DomainProducer
13
{
14
    /**
15
     * Producer constructor.
16
     * @param string $host
17
     * @param int $port
18
     * @param string $user
19
     * @param string $password
20
     * @param string $vHost
21
     * @param string $exchangeName
22
     * @param LoggerInterface $logger
23
     */
24
    public function __construct(
25
        $host,
26
        $port,
27
        $user,
28
        $password,
29
        $vHost,
30
        $exchangeName,
31
        LoggerInterface $logger
32
    )
33
    {
34
        $queueWriter = new QueueWriter(
35
            new AMQPLazyConnection($host, $port, $user, $password, $vHost),
36
            new ExchangeConfig($exchangeName, 'fanout', false, true, false),
37
            $logger
38
        );
39
        parent::__construct($queueWriter);
40
    }
41
}