Completed
Push — master ( 1f684d...57b871 )
by Mike
02:29
created

QueueBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 30
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A buildQueues() 0 4 2
1
<?php
2
3
4
namespace Xervice\RabbitMQ\Business\Model\Queue;
5
6
7
use Xervice\RabbitMQ\Business\Model\Core\QueueProviderInterface;
8
9
class QueueBuilder implements QueueBuilderInterface
10
{
11
    /**
12
     * @var \Xervice\RabbitMQ\Business\Model\Core\QueueProviderInterface
13
     */
14
    private $queueProvider;
15
16
    /**
17
     * @var \Xervice\RabbitMQ\Business\Model\Queue\QueueCollection
18
     */
19
    private $queueCollection;
20
21
    /**
22
     * QueueBuilder constructor.
23
     *
24
     * @param \Xervice\RabbitMQ\Business\Model\Core\QueueProviderInterface $queueProvider
25
     * @param \Xervice\RabbitMQ\Business\Model\Queue\QueueCollection $queueCollection
26
     */
27 2
    public function __construct(
28
        QueueProviderInterface $queueProvider,
29
        QueueCollection $queueCollection
30
    ) {
31 2
        $this->queueProvider = $queueProvider;
32 2
        $this->queueCollection = $queueCollection;
33 2
    }
34
35 2
    public function buildQueues(): void
36
    {
37 2
        foreach ($this->queueCollection as $queue) {
38 2
            $queue->declareQueue($this->queueProvider);
39
        }
40 2
    }
41
42
}