QueueBuilder::buildQueues()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 0
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 2
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 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
}