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