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
OpenedFloatInterval.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
OpenedFloatInterval
14
{
18
private
$minimum
;
19
23
private
$maximum
;
24
30
public
function
__construct
(
float
$minimum
,
float
$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
(
float
$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
60
64
public
function
minimum
() : float
65
{
66
return
$this->minimum
;
67
}
68
72
public
function
maximum
() : float
73
{
74
return
$this->maximum
;
75
}
76
}
ILIAS\Data\Interval
Definition:
ClosedFloatInterval.php:9
ILIAS\Data\Interval\OpenedFloatInterval
Definition:
OpenedFloatInterval.php:13
ILIAS\Data\Interval\OpenedFloatInterval\$minimum
$minimum
Definition:
OpenedFloatInterval.php:18
ILIAS\Data\Interval\OpenedFloatInterval\maximum
maximum()
Definition:
OpenedFloatInterval.php:72
ILIAS\Data\Interval\OpenedFloatInterval\$maximum
$maximum
Definition:
OpenedFloatInterval.php:23
ILIAS\Data\Interval\OpenedFloatInterval\__construct
__construct(float $minimum, float $maximum)
Definition:
OpenedFloatInterval.php:30
ILIAS\Data\Interval\OpenedFloatInterval\minimum
minimum()
Definition:
OpenedFloatInterval.php:64
ILIAS\Refinery\ConstraintViolationException
Definition:
ConstraintViolationException.php:14
ILIAS\Data\Interval\OpenedFloatInterval\spans
spans(float $numberToCheck)
Definition:
OpenedFloatInterval.php:49
ConstraintViolationException
src
Data
Interval
OpenedFloatInterval.php
Generated on Mon Apr 7 2025 20:01:33 for ILIAS by
1.8.13 (using
Doxyfile
)