Total Complexity | 7 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
9 | class Command extends DatabaseReplicator\Database\Command |
||
10 | { |
||
11 | /** @var PgPhp */ |
||
12 | private $pgPhp; |
||
13 | |||
14 | /** @var Psql */ |
||
15 | private $psql; |
||
16 | |||
17 | |||
18 | public function __construct(PgPhp $pgPhp, Psql $psql) |
||
19 | { |
||
20 | $this->pgPhp = $pgPhp; |
||
21 | $this->psql = $psql; |
||
22 | } |
||
23 | |||
24 | |||
25 | public function drop(string $database): void |
||
26 | { |
||
27 | $this->pgPhp->drop($database); |
||
28 | } |
||
29 | |||
30 | |||
31 | public function copy(Config $source, string $cloneDb): void |
||
32 | { |
||
33 | $this->pgPhp->copy($source, $cloneDb); |
||
34 | } |
||
35 | |||
36 | |||
37 | public function existsDatabase(string $database): bool |
||
38 | { |
||
39 | return $this->pgPhp->existsDatabase($database); |
||
40 | } |
||
41 | |||
42 | |||
43 | public function listDatabases(): iterable |
||
44 | { |
||
45 | return $this->pgPhp->listDatabases(); |
||
46 | } |
||
47 | |||
48 | |||
49 | public function create(Config $config): void |
||
52 | } |
||
53 | |||
54 | |||
55 | protected function commandImport(Source\Files $filenames, Config $config): void |
||
56 | { |
||
57 | $this->psql->importFiles($filenames, $config); |
||
61 |