ILIAS
trunk Revision v11.0_alpha-1761-g6dbbfa7b760
◀ 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
DeriveApplyToFromTransform.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
ILIAS\Data\Result\Ok
;
25
use
ILIAS\Data\Result\Error
;
26
use
Exception
;
27
28
trait
DeriveApplyToFromTransform
29
{
33
abstract
public
function
transform
($from);
34
38
public
function
applyTo
(
Result
$result):
Result
39
{
40
return
$result->
then
(
function
($value):
Result
{
41
try
{
42
return
new
Ok
($this->
transform
($value));
43
}
catch
(
Exception
$exception) {
44
return
new
Error
($exception);
45
}
46
});
47
}
48
}
ILIAS\Data\Result\then
then(callable $f)
Get a new result from the callable or do nothing if this is an error.
ILIAS\Refinery\transform
transform($from)
Definition:
DeriveTransformWithProblem.php:36
ILIAS\Refinery\applyTo
applyTo(Result $result)
Definition:
DeriveApplyToFromTransform.php:38
ILIAS\Data\Result
Definition:
Error.php:21
ILIAS\Refinery
Definition:
ByTrying.php:21
ILIAS\MetaData\OERExposer\OAIPMH\Responses\Error
Error
Definition:
Error.php:23
ILIAS\Data\Result\Ok
A result encapsulates a value or an error and simplifies the handling of those.
Definition:
Ok.php:30
Ok
WrapperInterface
DeriveApplyToFromTransform
Exception
components
ILIAS
Refinery
src
DeriveApplyToFromTransform.php
Generated on Fri Apr 11 2025 23:03:45 for ILIAS by
1.8.13 (using
Doxyfile
)