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

Generic   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 27
rs 10
ccs 4
cts 4
cp 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A id() 0 3 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