ILIAS  release_8 Revision v8.24
StringTransformation.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
21namespace ILIAS\Refinery\URI;
22
28
30{
33
37 public function transform($from): string
38 {
39 if (false === $from instanceof URI) {
41 sprintf('The value MUST be of type "%s"', URI::class),
42 'not_uri_object'
43 );
44 }
45
47 $result = $from->getBaseURI();
48
49 $query = $from->getQuery();
50 if (null !== $query) {
51 $query = '?' . $query;
52 }
53 $result .= $query;
54
55 $fragment = $from->getFragment();
56 if (null !== $fragment) {
57 $fragment = '#' . $fragment;
58 }
59 $result .= $fragment;
60
61 return $result;
62 }
63}
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35
string $query
Definition: URI.php:108
string $fragment
Definition: URI.php:109
A transformation is a function from one datatype to another.
transform($from)
Perform the transformation.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Group.php:21