From 06e0c1de036c0ad981c6c9b0d659d9e4ed83e725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Mat=C4=9Bj=C4=8Dek?= Date: Tue, 6 Jan 2026 08:29:27 +0100 Subject: [PATCH 1/2] typo --- src/Utils/Strings.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Utils/Strings.php b/src/Utils/Strings.php index 41a2e274..b273b380 100644 --- a/src/Utils/Strings.php +++ b/src/Utils/Strings.php @@ -425,7 +425,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 +438,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 +451,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 +464,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 { From 37fb0a08eb9c450e6d9292ba1811b3d94d2fe544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Mat=C4=9Bj=C4=8Dek?= Date: Tue, 6 Jan 2026 08:49:09 +0100 Subject: [PATCH 2/2] Methods of Strings keep right return type --- src/Utils/Strings.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Utils/Strings.php b/src/Utils/Strings.php index b273b380..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 {