Passed
Push — master ( d4a329...711fef )
by Jeroen De
03:36
created

Range   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 27
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A includes() 0 3 2
1
<?php
2
3
/**
4
 * SCSSPHP
5
 *
6
 * @copyright 2015-2020 Leaf Corcoran
7
 *
8
 * @license http://opensource.org/licenses/MIT MIT
9
 *
10
 * @link http://scssphp.github.io/scssphp
11
 */
12
13
namespace ScssPhp\ScssPhp\Base;
14
15
/**
16
 * Range
17
 *
18
 * @author Anthon Pang <[email protected]>
19
 */
20
class Range
21
{
22
    public $first;
23
    public $last;
24
25
    /**
26
     * Initialize range
27
     *
28
     * @param integer|float $first
29
     * @param integer|float $last
30
     */
31
    public function __construct($first, $last)
32
    {
33
        $this->first = $first;
34
        $this->last = $last;
35
    }
36
37
    /**
38
     * Test for inclusion in range
39
     *
40
     * @param integer|float $value
41
     *
42
     * @return boolean
43
     */
44
    public function includes($value)
45
    {
46
        return $value >= $this->first && $value <= $this->last;
47
    }
48
}
49