diff --git a/src/Utils/Strings.php b/src/Utils/Strings.php index 41a2e274..8bd7e0f0 100644 --- a/src/Utils/Strings.php +++ b/src/Utils/Strings.php @@ -273,6 +273,9 @@ public static function indent(string $s, int $level = 1, string $chars = "\t"): /** * Converts all characters of UTF-8 string to lower case. + * @template T of string + * @param T $s + * @return T */ public static function lower(string $s): string { @@ -282,6 +285,9 @@ public static function lower(string $s): string /** * Converts the first character of a UTF-8 string to lower case and leaves the other characters unchanged. + * @template T of string + * @param T $s + * @return T */ public static function firstLower(string $s): string { @@ -291,6 +297,9 @@ public static function firstLower(string $s): string /** * Converts all characters of a UTF-8 string to upper case. + * @template T of string + * @param T $s + * @return T */ public static function upper(string $s): string { @@ -300,6 +309,9 @@ public static function upper(string $s): string /** * Converts the first character of a UTF-8 string to upper case and leaves the other characters unchanged. + * @template T of string + * @param T $s + * @return T */ public static function firstUpper(string $s): string { @@ -309,6 +321,9 @@ public static function firstUpper(string $s): string /** * Converts the first character of every word of a UTF-8 string to upper case and the others to lower case. + * @template T of string + * @param T $s + * @return T */ public static function capitalize(string $s): string { @@ -425,7 +440,7 @@ public static function reverse(string $s): string /** - * Returns part of $haystack before $nth occurence of $needle or returns null if the needle was not found. + * Returns part of $haystack before $nth occurrence of $needle or returns null if the needle was not found. * Negative value means searching from the end. */ public static function before(string $haystack, string $needle, int $nth = 1): ?string @@ -438,7 +453,7 @@ public static function before(string $haystack, string $needle, int $nth = 1): ? /** - * Returns part of $haystack after $nth occurence of $needle or returns null if the needle was not found. + * Returns part of $haystack after $nth occurrence of $needle or returns null if the needle was not found. * Negative value means searching from the end. */ public static function after(string $haystack, string $needle, int $nth = 1): ?string @@ -451,7 +466,7 @@ public static function after(string $haystack, string $needle, int $nth = 1): ?s /** - * Returns position in characters of $nth occurence of $needle in $haystack or null if the $needle was not found. + * Returns position in characters of $nth occurrence of $needle in $haystack or null if the $needle was not found. * Negative value of `$nth` means searching from the end. */ public static function indexOf(string $haystack, string $needle, int $nth = 1): ?int @@ -464,7 +479,7 @@ public static function indexOf(string $haystack, string $needle, int $nth = 1): /** - * Returns position in characters of $nth occurence of $needle in $haystack or null if the needle was not found. + * Returns position in characters of $nth occurrence of $needle in $haystack or null if the needle was not found. */ private static function pos(string $haystack, string $needle, int $nth = 1): ?int {