Completed
Push — develop ( 4961cb...5f7df1 )
by Matteo
03:22
created

DiffChunkLineUnchanged   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 75%
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 73
ccs 12
cts 16
cp 0.75
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setOriginNumber() 0 4 1
A getOriginNumber() 0 4 1
A setDestNumber() 0 4 1
A getDestNumber() 0 4 1
A __construct() 0 7 1
1
<?php
2
/**
3
 * GitElephant - An abstraction layer for git written in PHP
4
 * Copyright (C) 2013  Matteo Giachino
5
 *
6
 * This program is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program.  If not, see [http://www.gnu.org/licenses/].
18
 */
19
20
namespace GitElephant\Objects\Diff;
21
22
/**
23
 * DiffChunkLine unchanged
24
 *
25
 * @author Matteo Giachino <[email protected]>
26
 */
27
class DiffChunkLineUnchanged extends DiffChunkLine
28
{
29
    /**
30
     * Origin line number
31
     *
32
     * @var int
33
     */
34
    protected $originNumber;
35
36
    /**
37
     * Destination line number
38
     *
39
     * @var int
40
     */
41
    protected $destNumber;
42
43
    /**
44
     * Class constructor
45
     *
46
     * @param int    $originNumber      original line number
47
     * @param int    $destinationNumber destination line number
48
     * @param string $content           line content
49
     *
50
     * @internal param int $number line number
51
     */
52 2
    public function __construct($originNumber, $destinationNumber, $content)
53
    {
54 2
        $this->setOriginNumber($originNumber);
55 2
        $this->setDestNumber($destinationNumber);
56 2
        $this->setContent($content);
57 2
        $this->setType(self::UNCHANGED);
58 2
    }
59
60
    /**
61
     * Set origin line number
62
     *
63
     * @param int $number line number
64
     */
65 2
    public function setOriginNumber($number)
66
    {
67 2
        $this->originNumber = $number;
68 2
    }
69
70
    /**
71
     * Get origin line number
72
     *
73
     * @return int
74
     */
75
    public function getOriginNumber()
76
    {
77
        return $this->originNumber;
78
    }
79
80
    /**
81
     * Set destination line number
82
     *
83
     * @param int $number line number
84
     */
85 2
    public function setDestNumber($number)
86
    {
87 2
        $this->destNumber = $number;
88 2
    }
89
90
    /**
91
     * Get destination line number
92
     *
93
     * @return int
94
     */
95
    public function getDestNumber()
96
    {
97
        return $this->destNumber;
98
    }
99
}
100