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