SetupLndQueue20190311144000   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 23
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 5 2
A isReversible() 0 3 1
A down() 0 3 1
A up() 0 4 1
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the ngutech/lnd-adapter project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace NGUtech\Lnd\Migration\RabbitMq;
10
11
use Daikon\RabbitMq3\Migration\RabbitMq3Migration;
12
13
final class SetupLndQueue20190311144000 extends RabbitMq3Migration
14
{
15
    public function getDescription(string $direction = self::MIGRATE_UP): string
16
    {
17
        return $direction === self::MIGRATE_UP
18
            ? 'Create RabbitMQ queue for LND messages.'
19
            : 'Delete RabbitMQ queue for LND messages.';
20
    }
21
22
    public function isReversible(): bool
23
    {
24
        return true;
25
    }
26
27
    protected function up(): void
28
    {
29
        $this->declareQueue('lnd.adapter.messages', false, true, false, false);
30
        $this->bindQueue('lnd.adapter.messages', 'lnd.adapter.exchange', 'lnd.message.#');
31
    }
32
33
    protected function down(): void
34
    {
35
        $this->deleteQueue('lnd.adapter.messages');
36
    }
37
}
38