ILIAS
trunk Revision v11.0_alpha-1713-gd8962da2f67
◀ 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
NewMethodTransformation.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\Transformation
;
25
use
ILIAS\Refinery\DeriveInvokeFromTransform
;
26
use
InvalidArgumentException
;
27
28
class
NewMethodTransformation
implements
Transformation
29
{
30
use
DeriveApplyToFromTransform
;
31
use
DeriveInvokeFromTransform
;
32
33
private
object
$object
;
34
private
string
$method
;
35
36
public
function
__construct
(
object
$object,
string
$methodToCall)
37
{
38
if
(
false
=== method_exists($object, $methodToCall)) {
39
throw
new
InvalidArgumentException
(
40
'The second parameter MUST be an method of the object'
41
);
42
}
43
44
$this->
object
=
$object
;
45
$this->method = $methodToCall;
46
}
47
51
public
function
transform
($from)
52
{
53
if
(
false
=== is_array($from)) {
54
$from = [$from];
55
}
56
57
return
call_user_func_array([$this->
object
, $this->method], $from);
58
}
59
}
ILIAS\Refinery\To\Transformation\NewMethodTransformation\transform
transform($from)
Definition:
NewMethodTransformation.php:51
ILIAS\Refinery\DeriveInvokeFromTransform
trait DeriveInvokeFromTransform
Definition:
DeriveInvokeFromTransform.php:24
ILIAS\Refinery\DeriveApplyToFromTransform
trait DeriveApplyToFromTransform
Definition:
DeriveApplyToFromTransform.php:29
ILIAS\Refinery\To\Transformation\NewMethodTransformation\$method
string $method
Definition:
NewMethodTransformation.php:34
Transformation
ILIAS\Refinery\To\Transformation
Definition:
BooleanTransformation.php:21
ILIAS\Refinery\To\Transformation\NewMethodTransformation\$object
object $object
Definition:
NewMethodTransformation.php:33
ILIAS\Refinery\To\Transformation\NewMethodTransformation
Definition:
NewMethodTransformation.php:28
ILIAS\Refinery\To\Transformation\NewMethodTransformation\__construct
__construct(object $object, string $methodToCall)
Definition:
NewMethodTransformation.php:36
ILIAS\Refinery\Transformation
A transformation is a function from one datatype to another.
Definition:
Transformation.php:34
InvalidArgumentException
components
ILIAS
Refinery
src
To
Transformation
NewMethodTransformation.php
Generated on Fri Apr 4 2025 23:03:46 for ILIAS by
1.8.13 (using
Doxyfile
)