BaseDumper::dump()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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