Passed
Push — master ( 2b6d09...f85326 )
by DeGracia
02:59
created

Between   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 18
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A validateRange() 0 4 2
1
<?php
2
3
namespace DeGraciaMathieu\Riddler\Occurrences;
4
    
5
use DeGraciaMathieu\Riddler\Contracts\Occurrence;
6
7
class Between extends BaseOccurrence implements Occurrence
8
{
9
    protected $smaller;
10
    protected $bigger;
11
    protected $size;
12
13 7
    public function __construct($smaller, $bigger)
14
    {
15 7
        $this->smaller = $smaller;
16 7
        $this->bigger = $bigger;
17 7
        $this->size = rand($smaller, $bigger);
18 7
    }
19
20 4
    public function validateRange($value)
21
    {
22 4
        return $value >= $this->smaller && $value <= $this->bigger;
23
    }
24
}
25