Passed
Pull Request — master (#4)
by Milan
01:27
created

Command   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 15
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A importFiles() 0 7 2
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