ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
s
t
w
+
Functions
_
a
b
c
f
g
h
i
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
OpenedIntegerInterval.php
Go to the documentation of this file.
1
<?php
2
declare(strict_types=1);
3
/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
9
namespace
ILIAS\Data\Interval
;
10
11
use
ILIAS\Refinery\ConstraintViolationException
;
12
13
class
OpenedIntegerInterval
14
{
18
private
$minimum
;
19
23
private
$maximum
;
24
30
public
function
__construct
(
int
$minimum
,
int
$maximum
)
31
{
32
if
($maximum < $minimum) {
33
throw
new
ConstraintViolationException
(
34
sprintf(
'The maximum("%s") can NOT be lower than the minimum("%s")'
, $maximum, $minimum),
35
'exception_maximum_minimum_mismatch'
,
36
$maximum,
37
$minimum
38
);
39
}
40
41
$this->
minimum
=
$minimum
;
42
$this->
maximum
=
$maximum
;
43
}
44
49
public
function
spans
(
int
$numberToCheck) : bool
50
{
51
if
($numberToCheck < $this->
minimum
) {
52
return
false
;
53
} elseif ($numberToCheck > $this->
maximum
) {
54
return
false
;
55
}
56
57
return
true
;
58
}
59
63
public
function
minimum
() : int
64
{
65
return
$this->minimum
;
66
}
67
71
public
function
maximum
() : int
72
{
73
return
$this->maximum
;
74
}
75
}
ILIAS\Data\Interval\OpenedIntegerInterval
Definition:
OpenedIntegerInterval.php:13
ILIAS\Data\Interval\OpenedIntegerInterval\$minimum
$minimum
Definition:
OpenedIntegerInterval.php:18
ILIAS\Data\Interval
Definition:
ClosedFloatInterval.php:9
ILIAS\Data\Interval\OpenedIntegerInterval\$maximum
$maximum
Definition:
OpenedIntegerInterval.php:23
ILIAS\Data\Interval\OpenedIntegerInterval\maximum
maximum()
Definition:
OpenedIntegerInterval.php:71
ILIAS\Data\Interval\OpenedIntegerInterval\minimum
minimum()
Definition:
OpenedIntegerInterval.php:63
ILIAS\Data\Interval\OpenedIntegerInterval\__construct
__construct(int $minimum, int $maximum)
Definition:
OpenedIntegerInterval.php:30
ILIAS\Refinery\ConstraintViolationException
Definition:
ConstraintViolationException.php:14
ILIAS\Data\Interval\OpenedIntegerInterval\spans
spans(int $numberToCheck)
Definition:
OpenedIntegerInterval.php:49
ConstraintViolationException
src
Data
Interval
OpenedIntegerInterval.php
Generated on Fri Apr 4 2025 20:01:38 for ILIAS by
1.8.13 (using
Doxyfile
)