Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed JString usage in JStringNormalise.

  • Loading branch information...
commit b0047fe0122b6aa17bfac997dfcb5e59cce7fce7 1 parent 3e0aaa6
@robschley authored
Showing with 10 additions and 10 deletions.
  1. +10 −10 libraries/joomla/string/normalise.php
View
20 libraries/joomla/string/normalise.php
@@ -29,7 +29,7 @@
*/
public static function fromCamelCase($input)
{
- return JString::trim(preg_replace('#([A-Z])#', ' $1', $input));
+ return trim(preg_replace('#([A-Z])#', ' $1', $input));
}
/**
@@ -45,8 +45,8 @@ public static function toCamelCase($input)
{
// Convert words to uppercase and then remove spaces.
$input = self::toSpaceSeparated($input);
- $input = JString::ucwords($input);
- $input = JString::str_ireplace(' ', '', $input);
+ $input = ucwords($input);
+ $input = str_ireplace(' ', '', $input);
return $input;
}
@@ -63,7 +63,7 @@ public static function toCamelCase($input)
public static function toDashSeparated($input)
{
// Convert spaces and underscores to dashes.
- $input = JString::str_ireplace(array(' ', '_'), '-', $input);
+ $input = str_ireplace(array(' ', '_'), '-', $input);
// Remove duplicate dashes.
$input = preg_replace('#-+#', '-', $input);
@@ -83,7 +83,7 @@ public static function toDashSeparated($input)
public static function toSpaceSeparated($input)
{
// Convert underscores and dashes to spaces.
- $input = JString::str_ireplace(array('_', '-'), ' ', $input);
+ $input = str_ireplace(array('_', '-'), ' ', $input);
// Remove duplicate spaces.
$input = preg_replace('#\s+#', ' ', $input);
@@ -103,7 +103,7 @@ public static function toSpaceSeparated($input)
public static function toUnderscoreSeparated($input)
{
// Convert spaces and dashes to underscores.
- $input = JString::str_ireplace(array(' ', '-'), '_', $input);
+ $input = str_ireplace(array(' ', '-'), '_', $input);
// Remove duplicate underscores.
$input = preg_replace('#_+#', '_', $input);
@@ -130,11 +130,11 @@ public static function toVariable($input)
$input = preg_replace('#^[0-9]+.*$#', '', $input);
// Lowercase the first character.
- $first = JString::substr($input, 0, 1);
- $first = JString::strtolower($first);
+ $first = substr($input, 0, 1);
+ $first = strtolower($first);
// Replace the first character with the lowercase character.
- $input = JString::substr_replace($input, $first, 0, 1);
+ $input = substr_replace($input, $first, 0, 1);
return $input;
}
@@ -152,7 +152,7 @@ public static function toKey($input)
{
// Remove spaces and dashes, then convert to lower case.
$input = self::toUnderscoreSeparated($input);
- $input = JString::strtolower($input);
+ $input = strtolower($input);
return $input;
}
Please sign in to comment.
Something went wrong with that request. Please try again.