Test Failed
Pull Request — master (#39)
by Aleksandr
02:42
created

ConsumerFactory::addConsumer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
3
namespace OldSound\RabbitMqBundle\Declarations;
4
5
use OldSound\RabbitMqBundle\RabbitMq\Consumer;
0 ignored issues
show
Bug introduced by
The type OldSound\RabbitMqBundle\RabbitMq\Consumer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use PhpAmqpLib\Connection\AbstractConnection;
7
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
8
9
class ConsumerFactory
10
{
11
    use ContainerAwareTrait;
12
13
    /** @var ConsumerDef[] */
14
    private $consumerDefs = [];
15
16
    public function addConsumer()
17
    {
18
19
    }
20
21
    public function create($name): Consumer
22
    {
23
        $consumerDef = $this->consumerDefs[$name];
24
        /** @var AbstractConnection $connection */
25
        $connection = $this->container->get(sprintf('old_sound_rabbit_mq.connection.%s', $consumerDef->name));
26
        $consumer = new Consumer($consumerDef->name);
27
        $consumer->setChannel($connection->channel());
28
29
        foreach([] as $d) {
30
            $consumer->consumeQueue();
31
        }
32
33
        return $consumer;
34
    }
35
}