BaseDumper   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 44
ccs 5
cts 5
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A dump() 0 6 1
A restore() 0 6 1
1
<?php
2
/**
3
 * Yii2 Dumpling.
4
 *
5
 * This file contains base dumper class.
6
 *
7
 * @author  Alexei Korotin <[email protected]>
8
 */
9
10
namespace herroffizier\yii2dumpling\dumpers;
11
12
use yii\base\Object;
13
use yii\base\NotSupportedException;
14
15
/**
16
 * Base dumper class.
17
 *
18
 * It just implements DumperInterface but does absolutely nothing useful,
19
 * so it is just a good point to start from.
20
 */
21
abstract class BaseDumper extends Object implements DumperInterface
22
{
23
    /**
24
     * Parsed DSN.
25
     *
26
     * @var array
27
     */
28
    protected $dsn;
29
30
    /**
31
     * Database username.
32
     *
33
     * @var string|null
34
     */
35
    protected $username;
36
37
    /**
38
     * Database password.
39
     *
40
     * @var string|null
41
     */
42
    protected $password;
43
44 18
    public function __construct(array $dsn, $username, $password)
45
    {
46 18
        $this->dsn = $dsn;
47 18
        $this->username = $username;
48 18
        $this->password = $password;
49 18
    }
50
51
    public function dump($file)
52
    {
53
        // @codeCoverageIgnoreStart
54
        throw new NotSupportedException(get_called_class().' does not support dumping');
55
        // @codeCoverageIgnoreEnd
56
    }
57
58
    public function restore($file)
59
    {
60
        // @codeCoverageIgnoreStart
61
        throw new NotSupportedException(get_called_class().' does not support restoring');
62
        // @codeCoverageIgnoreEnd
63
    }
64
}
65