Passed
Push — master ( 3376db...1497f5 )
by Mike
12:25
created

DumperFacade::getCommands()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
4
namespace Nexus\Dumper;
5
6
7
use Xervice\Core\Facade\AbstractFacade;
8
9
/**
10
 * @method \Nexus\Dumper\DumperFactory getFactory()
11
 * @method \Nexus\Dumper\DumperConfig getConfig()
12
 * @method \Nexus\Dumper\DumperClient getClient()
13
 */
14
class DumperFacade extends AbstractFacade
15
{
16
    /**
17
     * @return array
18
     */
19
    public function getCommands()
20
    {
21
        return $this->getFactory()->getCommandList();
22
    }
23
24
    /**
25
     * @param string $volume
26
     * @param string $path
27
     * @param string $version
28
     *
29
     * @return string
30
     * @throws \Xervice\Config\Exception\ConfigNotFound
31
     */
32
    public function dumpToLocal(string $volume, string $path, string $version)
33
    {
34
        return $this->getFactory()->createDumper($volume, $path, 'local', $version)->dump();
35
    }
36
37
    /**
38
     * @param string $volume
39
     * @param string $path
40
     * @param string $version
41
     *
42
     * @return string
43
     * @throws \Xervice\Config\Exception\ConfigNotFound
44
     */
45
    public function dumpToSsh(string $volume, string $path, string $version)
46
    {
47
        return $this->getFactory()->createDumper($volume, $path, 'ssh', $version)->dump();
48
    }
49
}