Passed
Push — main ( 604bfc...f70419 )
by Sebastian
04:51
created

Generic::id()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
ccs 2
cts 2
cp 1
crap 1
1
<?php
2
3
/**
4
 * This file is part of CaptainHook.
5
 *
6
 * (c) Sebastian Feldmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CaptainHook\App\Git\Rev;
13
14
use CaptainHook\App\Git\Rev;
15
16
/**
17
 * Generic range implementation
18
 *
19
 * The simplest imaginable range implementation without any extra information.
20
 *
21
 * @package CaptainHook
22
 * @author  Sebastian Feldmann <[email protected]>
23
 * @link    https://github.com/captainhookphp/captainhook
24
 * @since   Class available since Release 5.15.0
25
 */
26
class Generic implements Rev
27
{
28
    /**
29
     * Referencing a git state
30
     *
31
     * @var string
32
     */
33
    private string $id;
34
35
    /**
36
     * Constructor
37
     *
38
     * @param string $id
39
     */
40 2
    public function __construct(string $id)
41
    {
42 2
        $this->id = $id;
43
    }
44
45
    /**
46
     * Return the git reference
47
     *
48
     * @return string
49
     */
50 2
    public function id(): string
51
    {
52 2
        return $this->id;
53
    }
54
}
55