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

Between::validateRange()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 2
eloc 2
nc 2
nop 1
crap 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