ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ 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
r
s
t
w
+
Functions
_
a
b
c
f
g
h
i
r
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
BooleanTransformation.php
Go to the documentation of this file.
1
<?php
2
declare(strict_types=1);
3
4
/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
5
10
namespace
ILIAS\Refinery\To\Transformation
;
11
12
use
ILIAS\Data\Result
;
13
use
ILIAS\Refinery\DeriveApplyToFromTransform
;
14
use
ILIAS\Refinery\Transformation
;
15
use
ILIAS\Refinery\ConstraintViolationException
;
16
use
ILIAS\Refinery\DeriveInvokeFromTransform
;
17
18
class
BooleanTransformation
implements
Transformation
19
{
20
use
DeriveApplyToFromTransform
;
21
use
DeriveInvokeFromTransform
;
22
26
public
function
transform
($from)
27
{
28
if
(
false
=== is_bool($from)) {
29
throw
new
ConstraintViolationException
(
30
'The value MUST be of type boolean'
,
31
'not_boolean'
32
);
33
}
34
return
(
bool
) $from;
35
}
36
}
ILIAS\Data\Result
Definition:
Error.php:4
Transformation
ILIAS\Refinery\DeriveApplyToFromTransform
trait DeriveApplyToFromTransform
Definition:
DeriveApplyToFromTransform.php:13
ILIAS\Refinery\To\Transformation\BooleanTransformation
Definition:
BooleanTransformation.php:18
ILIAS\Refinery\To\Transformation
Definition:
BooleanTransformation.php:10
ILIAS\Refinery\DeriveInvokeFromTransform
trait DeriveInvokeFromTransform
Definition:
DeriveInvokeFromTransform.php:13
ILIAS\Refinery\ConstraintViolationException
Definition:
ConstraintViolationException.php:14
ILIAS\Refinery\To\Transformation\BooleanTransformation\transform
transform($from)
Perform the transformation.Please use this for transformations. It's more performant than calling inv...
Definition:
BooleanTransformation.php:26
ILIAS\Refinery\Transformation
A transformation is a function from one datatype to another.
Definition:
Transformation.php:17
ConstraintViolationException
src
Refinery
To
Transformation
BooleanTransformation.php
Generated on Fri Apr 11 2025 21:01:47 for ILIAS by
1.8.13 (using
Doxyfile
)