ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ 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
s
t
w
+
Functions
_
a
b
c
f
g
h
i
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
StringTransformation.php
Go to the documentation of this file.
1
<?php declare(strict_types=1);
2
/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8
namespace
ILIAS\Refinery\URI
;
9
10
use
ILIAS\Data\URI
;
11
use
ILIAS\Refinery\ConstraintViolationException
;
12
use
ILIAS\Refinery\DeriveApplyToFromTransform
;
13
use
ILIAS\Refinery\Transformation
;
14
15
class
StringTransformation
implements
Transformation
16
{
17
use
DeriveApplyToFromTransform
;
18
22
public
function
transform
($from)
23
{
24
if
(
false
=== $from instanceof
URI
) {
25
throw
new
ConstraintViolationException
(
26
sprintf(
'The value MUST be of type "%s"'
, URI::class),
27
'not_uri_object'
28
);
29
}
30
32
$result
= $from->getBaseURI();
33
34
$query
= $from->getQuery();
35
if
(null !==
$query
) {
36
$query
=
'?'
.
$query
;
37
}
38
$result
.=
$query
;
39
40
$fragment
= $from->getFragment();
41
if
(null !==
$fragment
) {
42
$fragment
=
'#'
.
$fragment
;
43
}
44
$result
.=
$fragment
;
45
46
return
$result
;
47
}
48
52
public
function
__invoke
($from)
53
{
54
return
$this->
transform
($from);
55
}
56
}
ILIAS\Refinery\URI
Definition:
Group.php:8
$result
$result
Definition:
CleanUpTest.php:463
ILIAS\Refinery\URI\StringTransformation
Definition:
StringTransformation.php:15
Transformation
ILIAS\Refinery\DeriveApplyToFromTransform
trait DeriveApplyToFromTransform
Definition:
DeriveApplyToFromTransform.php:13
ILIAS\Refinery\Transformation\transform
transform($from)
Perform the transformation.
ILIAS\Data\URI\$query
$query
Definition:
URI.php:38
ILIAS\Refinery\ConstraintViolationException
Definition:
ConstraintViolationException.php:14
ILIAS\Data\URI
The scope of this class is split ilias-conform URI's into components.
Definition:
URI.php:17
ILIAS\Refinery\URI\StringTransformation\__invoke
__invoke($from)
Transformations should be callable.This MUST do the same as transform.
Definition:
StringTransformation.php:52
URI
ILIAS\Refinery\Transformation
A transformation is a function from one datatype to another.
Definition:
Transformation.php:17
ConstraintViolationException
ILIAS\Data\URI\$fragment
$fragment
Definition:
URI.php:42
src
Refinery
URI
StringTransformation.php
Generated on Sat Apr 5 2025 20:01:38 for ILIAS by
1.8.13 (using
Doxyfile
)