Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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 <anthon.pang@gmail.com>
19
 *
20
 * @internal
21
 */
22
class Range
23
{
24
    /**
25
     * @var float|int
26
     */
27
    public $first;
28
 
29
    /**
30
     * @var float|int
31
     */
32
    public $last;
33
 
34
    /**
35
     * Initialize range
36
     *
37
     * @param int|float $first
38
     * @param int|float $last
39
     */
40
    public function __construct($first, $last)
41
    {
42
        $this->first = $first;
43
        $this->last = $last;
44
    }
45
 
46
    /**
47
     * Test for inclusion in range
48
     *
49
     * @param int|float $value
50
     *
51
     * @return bool
52
     */
53
    public function includes($value)
54
    {
55
        return $value >= $this->first && $value <= $this->last;
56
    }
57
}