Completed
Push — master ( 5fca0d...2a987b )
by Quim
02:16
created

Producer::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 13

Duplication

Lines 17
Ratio 100 %

Importance

Changes 0
Metric Value
dl 17
loc 17
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 13
nc 1
nop 7
1
<?php
2
3
namespace Cmp\Queues\Infrastructure\AmqpLib\v26\RabbitMQ\Task;
4
5
use Cmp\Queues\Domain\Task\Producer as DomainProducer;
6
use Cmp\Queues\Infrastructure\AmqpLib\v26\RabbitMQ\Queue\Config\ExchangeConfig;
7
use Cmp\Queues\Infrastructure\AmqpLib\v26\RabbitMQ\Queue\QueueWriter;
8
use PhpAmqpLib\Connection\AMQPLazyConnection;
9
use Psr\Log\LoggerInterface;
10
11
12 View Code Duplication
class Producer extends DomainProducer
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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
}