MockClient::sync()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
crap 1
1
<?php
2
3
namespace SyncFS\Client;
4
5
/**
6
 * Class SyncClientMock
7
 *
8
 * @package SyncFS\Client
9
 * @author  Matej Velikonja <[email protected]>
10
 */
11
class MockClient implements ClientInterface
12
{
13
    /**
14
     * @var string
15
     */
16
    private $origin;
17
18
    /**
19
     * @var string
20
     */
21
    private $target;
22
23
    /**
24
     * Sync $origin directory with $target one.
25
     * If SSH was configured, you must use absolute path
26
     * in the target directory
27
     *
28
     * @param string   $src
29
     * @param string   $dst
30
     * @param Callable $callback
31
     *
32
     * @throws ClientException
33
     *
34
     * @return int|null
35
     */
36 1
    public function sync($src, $dst, $callback = null)
37
    {
38 1
        $this->target = $src;
39 1
    }
40
41
    /**
42
     * @param string $origin
43
     *
44
     * @return $this
45
     */
46 1
    public function setOrigin($origin)
47
    {
48 1
        $this->origin = $origin;
49
50 1
        return $this;
51
    }
52
53
    /**
54
     * @return string
55
     */
56 1
    public function getOrigin()
57
    {
58 1
        return $this->origin;
59
    }
60
61
    /**
62
     * @param string $target
63
     *
64
     * @return $this
65
     */
66 1
    public function setTarget($target)
67
    {
68 1
        $this->target = $target;
69
70 1
        return $this;
71
    }
72
73
    /**
74
     * @return string
75
     */
76 1
    public function getTarget()
77
    {
78 1
        return $this->target;
79
    }
80
}
81