1 | <?php |
||
12 | class GeneralUtil |
||
13 | { |
||
14 | /** |
||
15 | * @param array $types |
||
16 | * @param string $default |
||
17 | * |
||
18 | * @return string |
||
19 | */ |
||
20 | public static function parseKey(array $types, string $default = 'default'): string |
||
24 | |||
25 | /** |
||
26 | * Escape newline characters according to RFC2425 section 5.8.4. |
||
27 | * |
||
28 | * @link http://tools.ietf.org/html/rfc2425#section-5.8.4 |
||
29 | * |
||
30 | * @param string $text |
||
31 | * |
||
32 | * @return string |
||
33 | */ |
||
34 | public static function escape(string $text): string |
||
40 | |||
41 | /** |
||
42 | * Unescape newline characters according to RFC2425 section 5.8.4. |
||
43 | * This function will replace escaped line breaks with PHP_EOL. |
||
44 | * |
||
45 | * @link http://tools.ietf.org/html/rfc2425#section-5.8.4 |
||
46 | * @param string $text |
||
47 | * @return string |
||
48 | */ |
||
49 | public static function unescape($text): string |
||
53 | |||
54 | /** |
||
55 | * Fold a line according to RFC2425 section 5.8.1. |
||
56 | * |
||
57 | * @link http://tools.ietf.org/html/rfc2425#section-5.8.1 |
||
58 | * |
||
59 | * @param string $text |
||
60 | * |
||
61 | * @return bool|string |
||
62 | */ |
||
63 | public static function fold($text) |
||
72 | |||
73 | /** |
||
74 | * @param string $url |
||
75 | * |
||
76 | * @return null|string |
||
77 | * @throws InvalidUrlException |
||
78 | */ |
||
79 | public static function getMimeType(string $url): ?string |
||
107 | } |
||
108 |