Generic   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 42
ccs 7
cts 7
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A from() 0 3 1
A to() 0 3 1
A __construct() 0 4 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\Range;
13
14
use CaptainHook\App\Git\Range;
15
use CaptainHook\App\Git\Rev;
16
17
/**
18
 * Generic range implementation
19
 *
20
 * Most simple range implementation
21
 *
22
 * @package CaptainHook
23
 * @author  Sebastian Feldmann <[email protected]>
24
 * @link    https://github.com/captainhook-git/captainhook
25
 * @since   Class available since Release 5.15.0
26
 */
27
class Generic implements Range
28
{
29
    /**
30
     * Starting reference
31
     *
32
     * @var \CaptainHook\App\Git\Rev
33
     */
34
    private Rev $from;
35
36
    /**
37
     * Ending reference
38
     *
39
     * @var \CaptainHook\App\Git\Rev
40
     */
41
    private Rev $to;
42
43
    /**
44
     * Constructor
45
     *
46
     */
47 2
    public function __construct(Rev $from, Rev $to)
48
    {
49 2
        $this->from = $from;
50 2
        $this->to   = $to;
51
    }
52
53
    /**
54
     * Return the git reference
55
     *
56
     * @return \CaptainHook\App\Git\Rev
57
     */
58 2
    public function from(): Rev
59
    {
60 2
        return $this->from;
61
    }
62
63
    /**
64
     * @return \CaptainHook\App\Git\Rev
65
     */
66 2
    public function to(): Rev
67
    {
68 2
        return $this->to;
69
    }
70
}
71