diff --git a/core/includes/unicode.inc b/core/includes/unicode.inc index 0595d30..2b596e4 100644 --- a/core/includes/unicode.inc +++ b/core/includes/unicode.inc @@ -250,11 +250,11 @@ function decode_entities($text) { * @return integer * The length of the string. * - * @see \Drupal\Component\Utility\Unicode::strlen(). + * @see \Drupal\Component\Utility\Unicode::strLen(). * @ingroup php_wrappers */ function drupal_strlen($text) { - return Unicode::strlen($text); + return Unicode::strLen($text); } /** @@ -266,11 +266,11 @@ function drupal_strlen($text) { * @return string * The string in uppercase. * - * @see \Drupal\Component\Utility\Unicode::strtoupper(). + * @see \Drupal\Component\Utility\Unicode::strToUpper(). * @ingroup php_wrappers */ function drupal_strtoupper($text) { - return Unicode::strtoupper($text); + return Unicode::strToUpper($text); } /** @@ -282,11 +282,11 @@ function drupal_strtoupper($text) { * @return string * The string in lowercase. * - * @see \Drupal\Component\Utility\Unicode::strtolower(). + * @see \Drupal\Component\Utility\Unicode::strToLower(). * @ingroup php_wrappers */ function drupal_strtolower($text) { - return Unicode::strtolower($text); + return Unicode::strToLower($text); } /** @@ -298,11 +298,11 @@ function drupal_strtolower($text) { * @return * The string with the first letter as uppercase. * - * @see \Drupal\Component\Utility\Unicode::ucfirst(). + * @see \Drupal\Component\Utility\Unicode::ucFirst(). * @ingroup php_wrappers */ function drupal_ucfirst($text) { - return Unicode::ucfirst($text); + return Unicode::ucFirst($text); } /** @@ -318,9 +318,9 @@ function drupal_ucfirst($text) { * @return * The shortened string. * - * @see \Drupal\Component\Utility\Unicode::strtoupper(). + * @see \Drupal\Component\Utility\Unicode::subStr(). * @ingroup php_wrappers */ function drupal_substr($text, $start, $length = NULL) { - return Unicode::substr($text, $start, $length); + return Unicode::subStr($text, $start, $length); } diff --git a/core/lib/Drupal/Component/Utility/Unicode.php b/core/lib/Drupal/Component/Utility/Unicode.php index cf979d9..bceb8d8 100644 --- a/core/lib/Drupal/Component/Utility/Unicode.php +++ b/core/lib/Drupal/Component/Utility/Unicode.php @@ -235,7 +235,7 @@ public static function truncateBytes($string, $len) { * @return int * The length of the string. */ - public static function strlen($text) { + public static function strLen($text) { if (static::getStatus() == static::STATUS_MULTIBYTE) { return mb_strlen($text); } @@ -254,7 +254,7 @@ public static function strlen($text) { * @return string * The string in uppercase. */ - public static function strtoupper($text) { + public static function strToUpper($text) { if (static::getStatus() == static::STATUS_MULTIBYTE) { return mb_strtoupper($text); } @@ -276,7 +276,7 @@ public static function strtoupper($text) { * @return string * The string in lowercase. */ - public static function strtolower($text) { + public static function strToLower($text) { if (static::getStatus() == static::STATUS_MULTIBYTE) { return mb_strtolower($text); } @@ -298,8 +298,8 @@ public static function strtolower($text) { * @return string * The string with the first letter as uppercase. */ - public static function ucfirst($text) { - return static::strtoupper(static::substr($text, 0, 1)) . static::substr($text, 1); + public static function ucFirst($text) { + return static::strToUpper(static::subStr($text, 0, 1)) . static::subStr($text, 1); } /** @@ -319,7 +319,7 @@ public static function ucfirst($text) { * @return string * The shortened string. */ - public static function substr($text, $start, $length = NULL) { + public static function subStr($text, $start, $length = NULL) { if (static::getStatus() == static::STATUS_MULTIBYTE) { return $length === NULL ? mb_substr($text, $start) : mb_substr($text, $start, $length); } @@ -402,7 +402,7 @@ public static function substr($text, $start, $length = NULL) { return ''; } - return substr($text, $istart, max(0, $iend - $istart + 1)); + return subStr($text, $istart, max(0, $iend - $istart + 1)); } } @@ -445,14 +445,14 @@ public static function truncate($string, $max_length, $wordsafe = FALSE, $add_el $max_length = max($max_length, 0); $min_wordsafe_length = max($min_wordsafe_length, 0); - if (static::strlen($string) <= $max_length) { + if (static::strLen($string) <= $max_length) { // No truncation needed, so don't add ellipsis, just return. return $string; } if ($add_ellipsis) { // Truncate ellipsis in case $max_length is small. - $ellipsis = static::substr('…', 0, $max_length); + $ellipsis = static::subStr('…', 0, $max_length); $max_length -= static::strlen($ellipsis); $max_length = max($max_length, 0); } @@ -472,11 +472,11 @@ public static function truncate($string, $max_length, $wordsafe = FALSE, $add_el $string = $matches[1]; } else { - $string = static::substr($string, 0, $max_length); + $string = static::subStr($string, 0, $max_length); } } else { - $string = static::substr($string, 0, $max_length); + $string = static::subStr($string, 0, $max_length); } if ($add_ellipsis) {