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

RabbitMqEventProvider::provideEvent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 8
ccs 0
cts 7
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace Xervice\EventRabbitMq\Business\Plugin\EventProvider;
5
6
7
use DataProvider\EventDataProvider;
0 ignored issues
show
Bug introduced by
The type DataProvider\EventDataProvider 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\RabbitMqMessageDataProvider;
0 ignored issues
show
Bug introduced by
The type DataProvider\RabbitMqMessageDataProvider 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 Xervice\Core\Plugin\AbstractBusinessPlugin;
10
use Xervice\Event\Business\Model\Provider\EventProviderInterface;
11
12
/**
13
 * @method \Xervice\EventRabbitMq\EventRabbitMqBusinessFactory getFactory()
14
 */
15
class RabbitMqEventProvider extends AbstractBusinessPlugin implements EventProviderInterface
16
{
17
    /**
18
     * @param \DataProvider\EventDataProvider $eventDataProvider
19
     */
20
    public function provideEvent(EventDataProvider $eventDataProvider): void
21
    {
22
        $message = new RabbitMqMessageDataProvider();
23
        $message
24
            ->setExchange($this->getFactory()->createEventExchange())
25
            ->setMessage($eventDataProvider);
26
27
        $this->getFactory()->getRabbitMqFacade()->sendMessage($message);
28
    }
29
}