-
-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathRangeInterface.php
48 lines (41 loc) · 1.14 KB
/
RangeInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
declare(strict_types=1);
namespace Psl\Range;
/**
* a range is a set of values that are contained in the range.
*
* @psalm-immutable
*/
interface RangeInterface
{
/**
* Checks if the given value is contained in the range.
*
* @psalm-mutation-free
*/
public function contains(int $value): bool;
/**
* Combine this range with the given lower bound.
*
* @psalm-mutation-free
*/
public function withLowerBound(int $lower_bound): LowerBoundRangeInterface;
/**
* Combine this range with the given upper bound.
*
* @psalm-mutation-free
*/
public function withUpperBound(int $upper_bound, bool $upper_inclusive): UpperBoundRangeInterface;
/**
* Combine this range with the given upper bound, and make it inclusive.
*
* @psalm-mutation-free
*/
public function withUpperBoundInclusive(int $upper_bound): UpperBoundRangeInterface;
/**
* Combine this range with the given upper bound, and make it exclusive.
*
* @psalm-mutation-free
*/
public function withUpperBoundExclusive(int $upper_bound): UpperBoundRangeInterface;
}