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

RabbitMQFacade::sendMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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