ILIAS
trunk Revision v11.0_alpha-1846-g895b5f47236
◀ 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
DeriveTransformFromApplyTo.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Refinery
;
22
23
use
ILIAS\Data\Result
;
24
use
Exception
;
25
26
trait
DeriveTransformFromApplyTo
27
{
31
abstract
public
function
applyTo
(
Result
$result):
Result
;
32
36
public
function
transform
($from)
37
{
39
$result = $this->
applyTo
(
new
Result
\
Ok
($from));
40
if
(
true
=== $result->
isError
()) {
41
$error
= $result->
error
();
42
43
if
(
$error
instanceof
Exception
) {
44
throw
$error
;
45
}
46
47
throw
new
Exception(
$error
);
48
}
49
return
$result->
value
();
50
}
51
}
ILIAS\Refinery\transform
transform($from)
Definition:
DeriveTransformWithProblem.php:36
ILIAS\Refinery\applyTo
applyTo(Result $result)
Definition:
DeriveApplyToFromTransform.php:38
ILIAS\Data\Result\value
value()
Get the encapsulated value.
ILIAS\Data\Result
Definition:
Error.php:21
ILIAS\Refinery
Definition:
ByTrying.php:21
ILIAS\Data\Result\isError
isError()
Get to know if the result is an error.
ILIAS\Data\Result\Ok
A result encapsulates a value or an error and simplifies the handling of those.
Definition:
Ok.php:30
ILIAS\Data\Result\error
error()
Get the encapsulated error.
DeriveTransformFromApplyTo
ILIAS\$error
ilErrorHandling $error
Definition:
class.ilias.php:69
WrapperInterface
Exception
components
ILIAS
Refinery
src
DeriveTransformFromApplyTo.php
Generated on Mon Apr 21 2025 23:03:19 for ILIAS by
1.8.13 (using
Doxyfile
)