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