Completed
Push — master ( 4f1d49...8186c0 )
by Sebastian
07:15
created

SimulatorExecutable   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A simulate() 0 6 1
createStatus() 0 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
    public function simulate(Target $target, Result $result)
29
    {
30
        $result->debug('backup data:' . PHP_EOL . $this->getExecutable($target)->getCommandLine());
31
32
        return $this->createStatus($target);
33
    }
34
35
    /**
36
     * Create backup status.
37
     *
38
     * @param  \phpbu\App\Backup\Target
39
     * @return \phpbu\App\Backup\Source\Status
40
     */
41
    abstract protected function createStatus(Target $target);
42
}
43