ILIAS  release_8 Revision v8.23
StringTransformation.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
21 namespace ILIAS\Refinery\URI;
22 
23 use ILIAS\Data\URI;
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 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Group.php:21
transform($from)
Perform the transformation.
string $fragment
Definition: URI.php:109
The scope of this class is split ilias-conform URI&#39;s into components.
Definition: URI.php:34
A transformation is a function from one datatype to another.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
string $query
Definition: URI.php:108