Passed
Push — v4.1 ( 588d2a...f00803 )
by Masiukevich
01:49
created

Migration   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 26
ccs 0
cts 8
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A add() 0 4 1
1
<?php
2
3
/**
4
 * SQL databases adapters implementation.
5
 *
6
 * @author  Maksim Masiukevich <[email protected]>
7
 * @license MIT
8
 * @license https://opensource.org/licenses/MIT
9
 */
10
11
declare(strict_types = 1);
12
13
namespace ServiceBus\Storage\Sql\Migration;
14
15
/**
16
 *
17
 */
18
abstract class Migration
19
{
20
    /** @var array */
21
    private $queries = [];
22
23
    /**
24
     * @psaln-var array<string, array>
25
     *
26
     * @var array
27
     */
28
    private $params = [];
29
30
    final public function __construct()
31
    {
32
33
    }
34
35
    final protected function add(string $query, array $params = []): void
36
    {
37
        $this->queries[]             = $query;
38
        $this->params[\sha1($query)] = $params;
39
    }
40
41
    abstract protected function up(): void;
42
43
    abstract protected function down(): void;
44
}