CheckoutIndexCommand::getCommandLine()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
crap 1
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
 * Initialise a new repository.
15
 */
16
class CheckoutIndexCommand implements Command {
17
    /**
18
     * Prefix.
19
     *
20
     * @var string
21
     */
22
    protected $prefix;
23
24
    /**
25
     * Initialiser.
26
     *
27
     * @param string $prefix
28
     */
29 1
    public function __construct($prefix) {
30 1
        $this->prefix = $prefix;
31 1
    }
32
33
    /**
34
     * @inheritdoc Command
35
     */
36 1
    public function getCommandLine() {
37
        return [
38 1
            'checkout-index',
39 1
            '--all',
40 1
            sprintf('--prefix=%s', $this->prefix),
41
        ];
42
    }
43
44
    /**
45
     * Get the prefix.
46
     *
47
     * @return string
48
     *
49
     * @codeCoverageIgnore
50
     */
51
    public function getPrefix() {
52
        return $this->prefix;
53
    }
54
55
    /**
56
     * Set the prefix.
57
     *
58
     * @param string $prefix
59
     *
60
     * @codeCoverageIgnore
61
     */
62
    public function setPrefix($prefix) {
63
        $this->prefix = $prefix;
64
    }
65
}
66