Completed
Push — master ( 683fb4...808150 )
by Milan
23s queued 10s
created

Command::importFiles()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
nc 2
nop 2
dl 0
loc 7
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace PmgDev\DatabaseReplicator\Database;
4
5
use PmgDev\DatabaseReplicator;
6
use PmgDev\DatabaseReplicator\Exceptions;
7
use PmgDev\DatabaseReplicator\Source;
8
9
abstract class Command implements DatabaseReplicator\Command
10
{
11
12
	public function importFiles(Source\Files $files, DatabaseReplicator\Config $config): void
13
	{
14
		try {
15
			$this->commandImport($files, $config);
16
		} catch (Exceptions\ImportFilesFailedException $e) {
17
			$this->drop($config->database);
18
			throw $e;
19
		}
20
	}
21
22
23
	abstract protected function commandImport(Source\Files $files, DatabaseReplicator\Config $config): void;
24
25
}
26