| Conditions | 5 |
| Paths | 6 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 18 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | 2 | public function define(VhostConfiguration $configuration, $queue, array $bindings) |
|
| 16 | { |
||
| 17 | 2 | foreach ($bindings as $binding) { |
|
| 18 | |||
| 19 | try { |
||
| 20 | 2 | $bindings = $configuration->getClient()->bindings()->get( |
|
| 21 | 2 | $configuration->getName(), |
|
| 22 | 2 | $binding['exchange'], |
|
| 23 | 2 | $queue, |
|
| 24 | 2 | isset($binding['routing_key']) ? $binding['routing_key'] : null |
|
| 25 | 2 | ); |
|
| 26 | 2 | ||
| 27 | 1 | if (0 === count($bindings)) { |
|
| 28 | $this->createBinding($configuration, $queue, $binding); |
||
| 29 | 1 | } |
|
| 30 | 1 | ||
| 31 | 1 | } catch (ClientErrorResponseException $e) { |
|
| 32 | 1 | $this->handleNotFoundException($e); |
|
| 33 | 1 | ||
| 34 | 1 | $this->createBinding($configuration, $queue, $binding); |
|
| 35 | } |
||
| 36 | 2 | } |
|
| 37 | 2 | } |
|
| 38 | |||
| 54 |