From 7516dc712af2a595757e4709ecf9840394ae2e7e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 22 Sep 2021 11:59:11 +0200 Subject: [PATCH] Deprecate `StringUtil::(starts|ends)With()` `\str_starts_with()` and `\str_ends_with()` are both polyfilled by `symfony/polyfill-php80`. --- .../install/files/lib/util/StringUtil.class.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/wcfsetup/install/files/lib/util/StringUtil.class.php b/wcfsetup/install/files/lib/util/StringUtil.class.php index 8682217790..674bd14c59 100644 --- a/wcfsetup/install/files/lib/util/StringUtil.class.php +++ b/wcfsetup/install/files/lib/util/StringUtil.class.php @@ -342,13 +342,7 @@ final class StringUtil } /** - * Checks whether $haystack starts with $needle, or not. - * - * @param string $haystack The string to be checked for starting with $needle - * @param string $needle The string to be found at the start of $haystack - * @param bool $ci Case insensitive or not. Default = false. - * - * @return bool True, if $haystack starts with $needle, false otherwise. + * @deprecated 5.5 Use \str_starts_with() instead. If a case-insensitive comparison is desired, manually call \mb_strtolower on both parameters. */ public static function startsWith($haystack, $needle, $ci = false) { @@ -361,12 +355,7 @@ final class StringUtil } /** - * Returns true if $haystack ends with $needle or if the length of $needle is 0. - * - * @param string $haystack - * @param string $needle - * @param bool $ci case insensitive - * @return bool + * @deprecated 5.5 Use \str_ends_with() instead. If a case-insensitive comparison is desired, manually call \mb_strtolower on both parameters. */ public static function endsWith($haystack, $needle, $ci = false) { -- 2.20.1