Passed
Push — master ( 4ead9a...82b045 )
by Mike
02:08
created

RabbitMQFacade   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 3
eloc 4
dl 0
loc 23
ccs 6
cts 8
cp 0.75
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A close() 0 3 1
A init() 0 3 1
A runWorker() 0 3 1
1
<?php
2
3
4
namespace Xervice\RabbitMQ;
5
6
7
use Xervice\Core\Facade\AbstractFacade;
8
9
/**
10
 * @method \Xervice\RabbitMQ\RabbitMQFactory getFactory()
11
 * @method \Xervice\RabbitMQ\RabbitMQConfig getConfig()
12
 */
13
class RabbitMQFacade extends AbstractFacade
14
{
15
    /**
16
     * Initiate the exchanges and queues in RabbitMQ
17
     *
18
     * @api
19
     */
20 2
    public function init(): void
21
    {
22 2
        $this->getFactory()->createBootstrapper()->boot();
23 2
    }
24
25
    /**
26
     * @throws \Xervice\RabbitMQ\Worker\Listener\ListenerException
27
     */
28 2
    public function runWorker(): void
29
    {
30 2
        $this->getFactory()->createWorker()->runWorker();
31 2
    }
32
33
    public function close(): void
34
    {
35
        $this->getFactory()->getConnectionProvider()->getConnection()->close();
36
    }
37
}
38