Test Failed
Push — master ( 82b045...1f684d )
by Mike
04:10
created

QueueBuilder::buildQueues()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 0
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 6
rs 10
c 0
b 0
f 0
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
    public function __construct(
28
        QueueProviderInterface $queueProvider,
29
        QueueCollection $queueCollection
30
    ) {
31
        $this->queueProvider = $queueProvider;
32
        $this->queueCollection = $queueCollection;
33
    }
34
35
    public function buildQueues(): void
36
    {
37
        foreach ($this->queueCollection as $queue) {
38
            $queue->declareQueue($this->queueProvider);
39
        }
40
    }
41
42
}