Completed
Pull Request — master (#1)
by Billie
03:49 queued 01:55
created

Get::getGitCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file is part of SebastianFeldmann\Git.
4
 *
5
 * (c) Sebastian Feldmann <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace SebastianFeldmann\Git\Command\Config;
11
12
use SebastianFeldmann\Git\Command\Base;
13
14
/**
15
 * Class Get
16
 *
17
 * @package SebastianFeldmann\Git
18
 * @author  Sebastian Feldmann <[email protected]>
19
 * @link    https://github.com/sebastianfeldmann/git
20
 * @since   Class available since Release 0.9.0
21
 */
22
class Get extends Base
23
{
24
    /**
25
     * The name of the configuration key to get
26
     *
27
     * @var string
28
     */
29
    private $name;
30
31
    /**
32
     * The name of the configuration key to get.
33
     *
34
     * @param string $name
35
     *
36
     * @return \SebastianFeldmann\Git\Command\Config\Get
37
     */
38 3
    public function name(string $name) : Get
39
    {
40 3
        $this->name = $name;
41
42 3
        return $this;
43
    }
44
45
    /**
46
     * Return the command to execute.
47
     *
48
     * @return string
49
     * @throws \RuntimeException
50
     */
51 1
    protected function getGitCommand() : string
52
    {
53 1
        return 'config --get '.  escapeshellarg($this->name);
54
    }
55
}
56