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

PrePush::from()   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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
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\Range;
13
14
use CaptainHook\App\Git;
15
use CaptainHook\App\Git\Rev\PrePush as Rev;
16
17
/**
18
 * Class
19
 *
20
 * @package CaptainHook
21
 * @author  Sebastian Feldmann <[email protected]>
22
 * @link    https://github.com/captainhookphp/captainhook
23
 * @since   Class available since Release 5.15.0
24
 */
25
class PrePush implements Git\Range
26
{
27
    /**
28
     * @var \CaptainHook\App\Git\Rev\PrePush
29
     */
30
    private Rev $from;
31
32
    /**
33
     * @var \CaptainHook\App\Git\Rev\PrePush
34
     */
35
    private Rev $to;
36
37
    /**
38
     * Constructor
39
     *
40
     * @param \CaptainHook\App\Git\Rev\PrePush $from
41
     * @param \CaptainHook\App\Git\Rev\PrePush $to
42
     */
43 13
    public function __construct(Rev $from, Rev $to)
44
    {
45 13
        $this->from = $from;
46 13
        $this->to   = $to;
47
    }
48
49
    /**
50
     * Returns the start ref
51
     *
52
     * @return \CaptainHook\App\Git\Rev\PrePush
53
     */
54 13
    public function from(): Rev
55
    {
56 13
        return $this->from;
57
    }
58
59
    /**
60
     * Returns the end ref
61
     *
62
     * @return \CaptainHook\App\Git\Rev\PrePush
63
     */
64 12
    public function to(): Rev
65
    {
66 12
        return $this->to;
67
    }
68
}
69