| Total Complexity | 4 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | final class Producers |
||
| 13 | { |
||
| 14 | private $producers; |
||
| 15 | |||
| 16 | 3 | public function __construct(Client $client, string ...$exchanges) |
|
| 17 | { |
||
| 18 | 3 | $this->producers = Sequence::of(...$exchanges)->reduce( |
|
| 19 | 3 | new Map('string', Producer::class), |
|
| 20 | 3 | static function(Map $producers, string $exchange) use ($client): Map { |
|
| 21 | 2 | return $producers->put( |
|
| 22 | 2 | $exchange, |
|
| 23 | 2 | new Producer\Producer($client, $exchange) |
|
| 24 | ); |
||
| 25 | 3 | } |
|
| 26 | ); |
||
| 27 | 3 | } |
|
| 28 | |||
| 29 | 2 | public static function fromDeclarations(Client $client, Declaration ...$exchanges): self |
|
| 35 | 2 | }) |
|
| 36 | ); |
||
| 37 | } |
||
| 38 | |||
| 39 | 1 | public function get(string $exchange): Producer |
|
| 42 | } |
||
| 43 | |||
| 44 | 2 | public function contains(string $exchange): bool |
|
| 47 | } |
||
| 48 | } |
||
| 49 |