Completed
Push — master ( e90908...51f84f )
by Sebastian
04:08
created

Info   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCurrentTag() 0 7 1
1
<?php
2
/**
3
 * This file is part of CaptainHook.
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\Operator;
11
12
use SebastianFeldmann\Git\Command\Describe\GetCurrentTag;
13
14
/**
15
 * Class Info
16
 *
17
 * @package SebastianFeldmann\Git
18
 * @author  Sebastian Feldmann <[email protected]>
19
 * @link    https://github.com/sebastianfeldmann/git
20
 * @since   Class available since Release 1.0.8
21
 */
22
class Info extends Base
23
{
24
    /**
25
     * Returns the tag tag of the current commit
26
     *
27
     * @return string
28
     */
29 2
    public function getCurrentTag() : string
30
    {
31 2
        $cmd    = new GetCurrentTag($this->repo->getRoot());
32 2
        $result = $this->runner->run($cmd);
33
34 1
        return trim($result->getStdOut());
35
    }
36
}
37