SimulatorExecutable   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 23
ccs 3
cts 3
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A simulate() 0 5 1
1
<?php
2
namespace phpbu\App\Backup\Source;
3
4
use phpbu\App\Backup\Cli;
5
use phpbu\App\Backup\Target;
6
use phpbu\App\Result;
7
8
/**
9
 * Executable Simulator class.
10
 *
11
 * @package    phpbu
12
 * @subpackage Backup
13
 * @author     Sebastian Feldmann <[email protected]>
14
 * @copyright  Sebastian Feldmann <[email protected]>
15
 * @license    https://opensource.org/licenses/MIT The MIT License (MIT)
16
 * @link       http://phpbu.de/
17
 * @since      Class available since Release 3.0.0
18
 */
19
abstract class SimulatorExecutable extends Cli
20
{
21
    /**
22
     * Simulate the backup execution.
23
     *
24
     * @param  \phpbu\App\Backup\Target $target
25
     * @param  \phpbu\App\Result        $result
26
     * @return \phpbu\App\Backup\Source\Status
27
     */
28 2
    public function simulate(Target $target, Result $result) : Status
29
    {
30 2
        $result->debug('backup data:' . PHP_EOL . $this->getExecutable($target)->getCommandPrintable());
31
32 2
        return $this->createStatus($target);
33
    }
34
35
    /**
36
     * Create backup status.
37
     *
38
     * @param  \phpbu\App\Backup\Target $target
39
     * @return \phpbu\App\Backup\Source\Status
40
     */
41
    abstract protected function createStatus(Target $target) : Status;
42
}
43