@@ -11,24 +11,16 @@ class QueueClientExtension extends Extension
1111{
1212 public function load (array $ configs , ContainerBuilder $ container )
1313 {
14- $ adapterChoice = array (
15- 'sqs ' => 'ReputationVIP\QueueClient\Adapter\SQSAdapter ' ,
16- 'file ' => 'ReputationVIP\QueueClient\Adapter\FileAdapter ' ,
17- 'memory ' => 'ReputationVIP\QueueClient\Adapter\MemoryAdapter ' ,
18- 'null ' => 'ReputationVIP\QueueClient\Adapter\NullAdapter '
19- );
14+
2015 $ configuration = new Configuration ();
2116 $ config = $ this ->processConfiguration ($ configuration , $ configs );
2217
2318 $ loader = new YamlFileLoader (
2419 $ container ,
2520 new FileLocator (__DIR__ .'/../Resources/config ' )
2621 );
27- $ loader ->load ('services.yml ' );
2822
29- if (!isset ($ adapterChoice [$ config ['adapter ' ]['type ' ]])) {
30- throw new \InvalidArgumentException ('Unknown handler type : ' . $ config ['adapter ' ]['type ' ]);
31- }
23+ $ loader ->load ('services.yml ' );
3224
3325 $ container ->setParameter (
3426 'queue_client.adapter.priority_handler.class ' ,
@@ -39,8 +31,8 @@ public function load(array $configs, ContainerBuilder $container)
3931 $ config ['queues_file ' ]
4032 );
4133 $ container ->setParameter (
42- 'queue_client.adapter.class ' ,
43- $ adapterChoice [ $ config ['adapter ' ][ ' type ' ] ]
34+ 'queue_client.queue_prefix ' ,
35+ $ config ['queue_prefix ' ]
4436 );
4537 $ container ->setParameter (
4638 'queue_client.config ' ,
0 commit comments