| 1 | <?php |
||
| 7 | class Str |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Determine if a given string contains a given substring. |
||
| 11 | * |
||
| 12 | * @param string $haystack |
||
| 13 | * @param string|array $needles |
||
| 14 | * |
||
| 15 | * @return bool |
||
| 16 | */ |
||
| 17 | 3 | public static function contains(string $haystack, $needles): bool |
|
| 27 | |||
| 28 | /** |
||
| 29 | * Determine if a given string ends with a given substring. |
||
| 30 | * |
||
| 31 | * @param string $haystack |
||
| 32 | * @param string|array $needles |
||
| 33 | * |
||
| 34 | * @return bool |
||
| 35 | */ |
||
| 36 | 1 | public static function endsWith(string $haystack, $needles): bool |
|
| 46 | |||
| 47 | /** |
||
| 48 | * Generate a more truly "random" alpha-numeric string. |
||
| 49 | * |
||
| 50 | * @param int $length |
||
| 51 | * |
||
| 52 | * @return string |
||
| 53 | */ |
||
| 54 | 2 | public static function random(int $length = 16): string |
|
| 65 | |||
| 66 | /** |
||
| 67 | * Convert the given string to lower-case. |
||
| 68 | * |
||
| 69 | * @param string $value |
||
| 70 | * |
||
| 71 | * @return string |
||
| 72 | */ |
||
| 73 | 3 | public static function lower($value): string |
|
| 77 | } |
||
| 78 |