Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php declare(strict_types = 1); |
||
27 | public function produce(AbstractProducer $abstractProducer, $body) |
||
28 | { |
||
29 | $channel = $this->bunnyManager->getChannel(); |
||
30 | |||
31 | if ($channel instanceof PromiseInterface) { |
||
32 | return $channel->then(function (Channel $channel) use ($abstractProducer, $body) { |
||
33 | return $abstractProducer->produce($channel, $body); |
||
34 | }); |
||
35 | } |
||
36 | |||
37 | return $abstractProducer->produce($channel, $body); |
||
38 | } |
||
41 |