Passed
Push — master ( d58b05...f1b29b )
by Mike
02:14
created

EventRabbitMqBusinessFactory::getEventFacade()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace Xervice\EventRabbitMq\Business;
5
6
7
use DataProvider\RabbitMqExchangeDataProvider;
0 ignored issues
show
Bug introduced by
The type DataProvider\RabbitMqExchangeDataProvider 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...
8
use DataProvider\RabbitMqQueueBindDataProvider;
0 ignored issues
show
Bug introduced by
The type DataProvider\RabbitMqQueueBindDataProvider 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...
9
use DataProvider\RabbitMqQueueDataProvider;
0 ignored issues
show
Bug introduced by
The type DataProvider\RabbitMqQueueDataProvider 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...
10
use Xervice\Core\Business\Model\Factory\AbstractBusinessFactory;
11
use Xervice\Event\Business\EventFacade;
12
use Xervice\RabbitMQ\Business\RabbitMQFacade;
13
14
/**
15
 * @method \Xervice\EventRabbitMq\EventRabbitMqConfig getConfig()
16
 */
17
class EventRabbitMqBusinessFactory extends AbstractBusinessFactory
18
{
19
20
    /**
21
     * @return \DataProvider\RabbitMqQueueBindDataProvider
22
     */
23 1
    public function createBindQueue(): RabbitMqQueueBindDataProvider
24
    {
25 1
        return (new RabbitMqQueueBindDataProvider())
26 1
            ->setQueue(
27 1
                $this->createEventQueue()
28
            )
29 1
            ->setExchange(
30 1
                $this->createEventExchange()
31
            );
32
    }
33
34 1
    public function createEventExchange(): RabbitMqExchangeDataProvider
35
    {
36 1
        return (new RabbitMqExchangeDataProvider())
37 1
            ->setName(
38 1
                $this->getConfig()->getExchangeName()
39
            )
40 1
            ->setAutoDelete(false)
41 1
            ->setType('fanout');
42
    }
43
44
    /**
45
     * @return \DataProvider\RabbitMqQueueDataProvider
46
     */
47 1
    public function createEventQueue(): RabbitMqQueueDataProvider
48
    {
49 1
        return (new RabbitMqQueueDataProvider())
50 1
            ->setName($this->getConfig()->getQueueName())
51 1
            ->setAutoDelete(false);
52
    }
53
54
    /**
55
     * @return \Xervice\RabbitMQ\Business\RabbitMQFacade
56
     */
57
    public function getRabbitMqFacade(): RabbitMQFacade
58
    {
59
        return $this->getDependency(EventRabbitMqDependencyProvider::RABBITMQ_FACADE);
0 ignored issues
show
Bug introduced by
The type Xervice\EventRabbitMq\Bu...bitMqDependencyProvider 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...
60
    }
61
62
    /**
63
     * @return \Xervice\Event\Business\EventFacade
64
     */
65
    public function getEventFacade(): EventFacade
66
    {
67
        return $this->getDependency(EventRabbitMqDependencyProvider::EVENT_FACADE);
68
    }
69
}