1 | <?php declare(strict_types=1); |
||
22 | class URIHelper |
||
23 | { |
||
24 | |||
25 | /** |
||
26 | * Check whether a given URI has a specific extension. |
||
27 | * |
||
28 | * @since 0.1.3 |
||
29 | * |
||
30 | * @param string $uri URI to check the extension of. |
||
31 | * @param string $extension Extension to check for. |
||
32 | * |
||
33 | * @return bool |
||
34 | */ |
||
35 | 44 | public static function hasExtension(string $uri, string $extension): bool |
|
46 | |||
47 | /** |
||
48 | * Check whether a given URI contains an extension and return it. |
||
49 | * |
||
50 | * @param string $uri URI to check. |
||
51 | * @return string Extension that was found, empty string if none found. |
||
52 | */ |
||
53 | public static function containsExtension(string $uri): string |
||
65 | |||
66 | /** |
||
67 | * Get the filename for an URI. |
||
68 | * |
||
69 | * @since 0.1.3 |
||
70 | * |
||
71 | * @param string $uri URI to get the filename from. |
||
72 | * |
||
73 | * @return string Filename without path. |
||
74 | */ |
||
75 | public static function getFilename(string $uri): String |
||
79 | } |
||
80 |