Passed
Push — master ( fc9abb...9945a9 )
by Luke
02:47
created

CheckoutCommand::setRef()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
/**
4
 * Moodle component manager.
5
 *
6
 * @author Luke Carrier <[email protected]>
7
 * @copyright 2016 Luke Carrier
8
 * @license GPL-3.0+
9
 */
10
11
namespace ComponentManager\VersionControl\Git\Command;
12
13
/**
14
 * Checkout a reference or file.
15
 */
16
class CheckoutCommand implements Command {
17
    /**
18
     * Reference.
19
     *
20
     * @var string
21
     */
22
    protected $ref;
23
24
    /**
25
     * Initialiser.
26
     *
27
     * @param string $ref
28
     */
29 1
    public function __construct($ref) {
30 1
        $this->ref = $ref;
31 1
    }
32
33
    /**
34
     * @override Command
35
     */
36 1
    public function getCommandLine() {
37 1
        return ['checkout', $this->ref];
38
    }
39
40
    /**
41
     * Get the reference.
42
     *
43
     * @return string
44
     *
45
     * @codeCoverageIgnore
46
     */
47
    public function getRef() {
48
        return $this->ref;
49
    }
50
51
    /**
52
     * Set the reference.
53
     *
54
     * @param string $ref
55
     *
56
     * @codeCoverageIgnore
57
     */
58
    public function setRef($ref) {
59
        $this->ref = $ref;
60
    }
61
}
62