Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function factory(string $name, array $config) |
||
24 | { |
||
25 | if (isset($this->messagePublisher[$name])) { |
||
26 | return $this->messagePublisher[$name]; |
||
27 | } |
||
28 | |||
29 | if ('amqp_lib' === $config['client']) { |
||
30 | /** @var $connexion AMQPStreamConnection */ |
||
31 | $connexion = $this->container->get($config['connexion'] ?? 'darkilliant_mqprocess_connection'); |
||
32 | |||
33 | return $this->messagePublisher[$name] = new AmqpMessagePublisher( |
||
34 | $connexion->channel(), |
||
35 | $config['queue'], |
||
36 | $config['exchange'], |
||
37 | $config['persistant'] |
||
38 | ); |
||
39 | } |
||
40 | |||
41 | return null; |
||
42 | } |
||
44 |