ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
StringToHttpPath.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\HTTP\Path;
22
24
28trait StringToHttpPath
29{
30 private function toHttpPath(?string $http_path): ?URI
31 {
32 if ($http_path === null || trim($http_path) === '') {
33 return null;
34 }
35 try {
36 return new URI(rtrim(trim($http_path), '/'));
37 } catch (\InvalidArgumentException|\TypeError) {
38 return null;
39 }
40 }
41}
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35