| 1 | <?php |
||
| 13 | class Helpers |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * Check if provided type of certs is allowed |
||
| 17 | * |
||
| 18 | * @param string $key |
||
| 19 | * |
||
| 20 | * @throws \RuntimeException |
||
| 21 | */ |
||
| 22 | public static function isCertAllowed(string $key): void |
||
| 23 | { |
||
| 24 | if (!in_array($key, Config::ALLOWED_TYPES_OF_CERTS, true)) { |
||
| 25 | throw new RuntimeException("Key '$key' not in list of allowed [" . implode(',', Config::ALLOWED_TYPES_OF_CERTS) . ']'); |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Convert string like "makeMeHappy" to "make-me-happy" |
||
| 31 | * |
||
| 32 | * @param string $input |
||
| 33 | * |
||
| 34 | * @return string |
||
| 35 | */ |
||
| 36 | public static function decamelize(string $input): string |
||
| 45 | } |
||
| 46 |