1 | <?php |
||
20 | class StringUtilities |
||
21 | { |
||
22 | /** |
||
23 | * Validate a resource ID to be sure if matches the criteria |
||
24 | * |
||
25 | * @param string $resourceId The 4x4 resource ID of a data set |
||
26 | * |
||
27 | * @throws InvalidResourceException If the resource ID isn't in the format of xxxx-xxxx |
||
28 | */ |
||
29 | public static function validateResourceId ($resourceId) |
||
36 | |||
37 | /** |
||
38 | * Test whether a string is proper JSON or not |
||
39 | * |
||
40 | * @param string $string The string to be tested as JSON |
||
41 | * |
||
42 | * @return bool True if the given string is JSON |
||
43 | */ |
||
44 | public static function isJson ($string) |
||
48 | |||
49 | /** |
||
50 | * Determine whether a string is null or empty |
||
51 | * |
||
52 | * @param string $string The string to test |
||
53 | * |
||
54 | * @return bool True if string is null or empty |
||
55 | */ |
||
56 | public static function isNullOrEmpty ($string) |
||
60 | } |
||
61 |