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

ExchangeBuilder::buildExchange()   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
namespace Xervice\RabbitMQ\Business\Model\Exchange;
4
5
6
use Xervice\RabbitMQ\Business\Model\Core\ExchangeProviderInterface;
7
8
class ExchangeBuilder implements ExchangeBuilderInterface
9
{
10
    /**
11
     * @var \Xervice\RabbitMQ\Business\Model\Core\ExchangeProviderInterface
12
     */
13
    private $exchangeProvider;
14
15
    /**
16
     * @var \Xervice\RabbitMQ\Business\Model\Exchange\ExchangeCollection
17
     */
18
    private $exchangeCollection;
19
20
    /**
21
     * ExchangeBuilder constructor.
22
     *
23
     * @param \Xervice\RabbitMQ\Business\Model\Core\ExchangeProviderInterface $exchangeProvider
24
     * @param \Xervice\RabbitMQ\Business\Model\Exchange\ExchangeCollection $exchangeCollection
25
     */
26
    public function __construct(
27
        ExchangeProviderInterface $exchangeProvider,
28
        ExchangeCollection $exchangeCollection
29
    ) {
30
        $this->exchangeProvider = $exchangeProvider;
31
        $this->exchangeCollection = $exchangeCollection;
32
    }
33
34
    public function buildExchange(): void
35
    {
36
        foreach ($this->exchangeCollection as $exchange) {
37
            $exchange->declareExchange($this->exchangeProvider);
38
        }
39
    }
40
}