Completed
Push — master ( 437363...c9c204 )
by Jakub
02:12
created

Numbers::range()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 3
dl 0
loc 2
ccs 1
cts 1
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Nexendrie\Utils;
5
6
/**
7
 * Numbers
8
 *
9
 * @author Jakub Konečný
10
 */
11 1
class Numbers {
12 1
  use \Nette\StaticClass;
13
  
14
  /**
15
   * Ensure that a number is within boundaries
16
   */
17
  public static function range(int $number, int $min, int $max): int {
18 1
    return min(max($number, $min), $max);
19
  }
20
}
21
?>