Test Failed
Push — master ( 1a6b60...537cfd )
by Mike
03:18
created

RabbitMqEventProvider::provideEvent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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