Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402]

   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  }