Passed
Push — master ( d7540c...231250 )
by Josh
05:57
created

Match   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 27
ccs 11
cts 11
cp 1
rs 10
wmc 4
lcom 1
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A endInOld() 0 4 1
A endInNew() 0 4 1
A count() 0 3 1
1
<?php
2
3
namespace Caxy\HtmlDiff;
4
5
class Match implements \Countable
6
{
7
    public $startInOld;
8
    public $startInNew;
9
    public $size;
10
11 15
    public function __construct($startInOld, $startInNew, $size)
12
    {
13 15
        $this->startInOld = $startInOld;
14 15
        $this->startInNew = $startInNew;
15 15
        $this->size = $size;
16 15
    }
17
18 15
    public function endInOld()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
19
    {
20 15
        return $this->startInOld + $this->size;
21
    }
22
23 15
    public function endInNew()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
24
    {
25 15
        return $this->startInNew + $this->size;
26
    }
27
28 15
    public function count() {
29 15
        return (int)$this->size;
30
    }
31
}
32