Completed
Pull Request — master (#1)
by Billie
01:57
created

Get   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 32
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A name() 0 6 1
A getGitCommand() 0 4 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
 */
21
class Get extends Base
22
{
23
    /**
24
     * The name of the configuration key to get
25
     *
26
     * @var string
27
     */
28
    private $name;
29
30
    /**
31
     * The name of the configuration key to get.
32
     *
33
     * @param string $name
34
     * @return \SebastianFeldmann\Git\Command\Config\Get
35
     */
36 3
    public function name(string $name) : Get
37
    {
38 3
        $this->name = $name;
39
40 3
        return $this;
41
    }
42
43
    /**
44
     * Return the command to execute.
45
     *
46
     * @return string
47
     */
48 1
    protected function getGitCommand() : string
49
    {
50 1
        return 'config --get ' .  escapeshellarg($this->name);
51
    }
52
}
53