ILIAS
trunk Revision v11.0_alpha-1744-gb0451eebef4
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
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
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
c
e
g
h
j
l
m
p
s
t
u
v
+
Enumerations
a
c
e
f
i
j
l
m
n
o
p
r
s
t
u
v
z
+
Enumerator
a
c
d
e
f
g
i
l
m
n
o
p
q
s
t
u
v
y
+
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
Ö
Enumerations
Enumerator
+
Files
File List
+
Globals
+
All
$
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
+
Functions
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
+
Variables
$
a
c
e
g
h
i
m
n
o
p
r
s
t
u
v
z
Enumerations
Enumerator
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Modules
Pages
BooleanTransformation.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Refinery\To\Transformation
;
22
23
use
ILIAS\Refinery\DeriveApplyToFromTransform
;
24
use
ILIAS\Refinery\Constraint
;
25
use
ILIAS\Refinery\DeriveInvokeFromTransform
;
26
use
ILIAS\Refinery\ProblemBuilder
;
27
use
UnexpectedValueException
;
28
29
class
BooleanTransformation
implements
Constraint
30
{
31
use
DeriveApplyToFromTransform
;
32
use
DeriveInvokeFromTransform
;
33
use
ProblemBuilder
;
34
38
public
function
transform
($from): bool
39
{
40
$this->
check
($from);
41
return
(
bool
) $from;
42
}
43
47
public
function
getError
(): string
48
{
49
return
'The value MUST be of type boolean.'
;
50
}
51
55
public
function
check
($value)
56
{
57
if
(!$this->
accepts
($value)) {
58
throw
new
UnexpectedValueException
($this->
getErrorMessage
($value));
59
}
60
61
return
null
;
62
}
63
67
public
function
accepts
($value): bool
68
{
69
return
is_bool($value);
70
}
71
75
public
function
problemWith
($value): ?string
76
{
77
if
(!$this->
accepts
($value)) {
78
return
$this->
getErrorMessage
($value);
79
}
80
81
return
null
;
82
}
83
}
ILIAS\Refinery\To\Transformation\BooleanTransformation\problemWith
problemWith($value)
Definition:
BooleanTransformation.php:75
ILIAS\Refinery\DeriveInvokeFromTransform
trait DeriveInvokeFromTransform
Definition:
DeriveInvokeFromTransform.php:24
ILIAS\Refinery\DeriveApplyToFromTransform
trait DeriveApplyToFromTransform
Definition:
DeriveApplyToFromTransform.php:29
ILIAS\Refinery\Constraint
A constraint encodes some resrtictions on values.
Definition:
Constraint.php:31
ILIAS\Refinery\To\Transformation\BooleanTransformation\getError
getError()
Definition:
BooleanTransformation.php:47
ILIAS\Refinery\To\Transformation\BooleanTransformation
Definition:
BooleanTransformation.php:29
ILIAS\Refinery\To\Transformation
Definition:
BooleanTransformation.php:21
UnexpectedValueException
null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Definition:
shib_logout.php:142
ILIAS\Refinery\To\Transformation\BooleanTransformation\check
check($value)
Definition:
BooleanTransformation.php:55
ILIAS\Refinery\To\Transformation\BooleanTransformation\transform
transform($from)
Definition:
BooleanTransformation.php:38
ILIAS\Refinery\To\Transformation\BooleanTransformation\accepts
accepts($value)
Definition:
BooleanTransformation.php:67
ILIAS\Refinery\getErrorMessage
getErrorMessage($value)
Definition:
ProblemBuilder.php:39
ILIAS\Refinery\ProblemBuilder
trait ProblemBuilder
Definition:
ProblemBuilder.php:26
Constraint
components
ILIAS
Refinery
src
To
Transformation
BooleanTransformation.php
Generated on Tue Apr 8 2025 23:04:03 for ILIAS by
1.8.13 (using
Doxyfile
)