Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix whitespace for coding standards.
  • Loading branch information
markstory committed Mar 11, 2012
1 parent f26d24b commit 69ab443
Showing 1 changed file with 42 additions and 15 deletions.
57 changes: 42 additions & 15 deletions lib/Cake/I18n/Multibyte.php
Expand Up @@ -18,6 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/

if (!function_exists('mb_stripos')) {

/**
* Find position of first occurrence of a case-insensitive string.
*
Expand All @@ -28,12 +30,14 @@
* @return integer|boolean The numeric position of the first occurrence of $needle in the $haystack string, or false
* if $needle is not found.
*/
if (!function_exists('mb_stripos')) {
function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) {
return Multibyte::stripos($haystack, $needle, $offset);
}

}

if (!function_exists('mb_stristr')) {

/**
* Finds first occurrence of a string within another, case insensitive.
*
Expand All @@ -46,12 +50,14 @@ function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) {
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
* @return string|boolean The portion of $haystack, or false if $needle is not found.
*/
if (!function_exists('mb_stristr')) {
function mb_stristr($haystack, $needle, $part = false, $encoding = null) {
return Multibyte::stristr($haystack, $needle, $part);
}

}

if (!function_exists('mb_strlen')) {

/**
* Get string length.
*
Expand All @@ -60,12 +66,14 @@ function mb_stristr($haystack, $needle, $part = false, $encoding = null) {
* @return integer The number of characters in string $string having character encoding encoding.
* A multi-byte character is counted as 1.
*/
if (!function_exists('mb_strlen')) {
function mb_strlen($string, $encoding = null) {
return Multibyte::strlen($string);
}

}

if (!function_exists('mb_strpos')) {

/**
* Find position of first occurrence of a string.
*
Expand All @@ -76,12 +84,14 @@ function mb_strlen($string, $encoding = null) {
* @return integer|boolean The numeric position of the first occurrence of $needle in the $haystack string.
* If $needle is not found, it returns false.
*/
if (!function_exists('mb_strpos')) {
function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) {
return Multibyte::strpos($haystack, $needle, $offset);
}

}

if (!function_exists('mb_strrchr')) {

/**
* Finds the last occurrence of a character in a string within another.
*
Expand All @@ -94,12 +104,14 @@ function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) {
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
* @return string|boolean The portion of $haystack. or false if $needle is not found.
*/
if (!function_exists('mb_strrchr')) {
function mb_strrchr($haystack, $needle, $part = false, $encoding = null) {
return Multibyte::strrchr($haystack, $needle, $part);
}

}

if (!function_exists('mb_strrichr')) {

/**
* Finds the last occurrence of a character in a string within another, case insensitive.
*
Expand All @@ -112,12 +124,14 @@ function mb_strrchr($haystack, $needle, $part = false, $encoding = null) {
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
* @return string|boolean The portion of $haystack. or false if $needle is not found.
*/
if (!function_exists('mb_strrichr')) {
function mb_strrichr($haystack, $needle, $part = false, $encoding = null) {
return Multibyte::strrichr($haystack, $needle, $part);
}

}

if (!function_exists('mb_strripos')) {

/**
* Finds position of last occurrence of a string within another, case insensitive
*
Expand All @@ -128,12 +142,14 @@ function mb_strrichr($haystack, $needle, $part = false, $encoding = null) {
* @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string,
* or false if $needle is not found.
*/
if (!function_exists('mb_strripos')) {
function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) {
return Multibyte::strripos($haystack, $needle, $offset);
}

}

if (!function_exists('mb_strrpos')) {

/**
* Find position of last occurrence of a string in a string.
*
Expand All @@ -145,12 +161,14 @@ function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) {
* @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string.
* If $needle is not found, it returns false.
*/
if (!function_exists('mb_strrpos')) {
function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) {
return Multibyte::strrpos($haystack, $needle, $offset);
}

}

if (!function_exists('mb_strstr')) {

/**
* Finds first occurrence of a string within another
*
Expand All @@ -163,38 +181,44 @@ function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) {
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
* @return string|boolean The portion of $haystack, or true if $needle is not found.
*/
if (!function_exists('mb_strstr')) {
function mb_strstr($haystack, $needle, $part = false, $encoding = null) {
return Multibyte::strstr($haystack, $needle, $part);
}

}

if (!function_exists('mb_strtolower')) {

/**
* Make a string lowercase
*
* @param string $string The string being lowercased.
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
* @return string with all alphabetic characters converted to lowercase.
*/
if (!function_exists('mb_strtolower')) {
function mb_strtolower($string, $encoding = null) {
return Multibyte::strtolower($string);
}

}

if (!function_exists('mb_strtoupper')) {

/**
* Make a string uppercase
*
* @param string $string The string being uppercased.
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
* @return string with all alphabetic characters converted to uppercase.
*/
if (!function_exists('mb_strtoupper')) {
function mb_strtoupper($string, $encoding = null) {
return Multibyte::strtoupper($string);
}

}

if (!function_exists('mb_substr_count')) {

/**
* Count the number of substring occurrences
*
Expand All @@ -203,12 +227,14 @@ function mb_strtoupper($string, $encoding = null) {
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
* @return integer The number of times the $needle substring occurs in the $haystack string.
*/
if (!function_exists('mb_substr_count')) {
function mb_substr_count($haystack, $needle, $encoding = null) {
return Multibyte::substrCount($haystack, $needle);
}

}

if (!function_exists('mb_substr')) {

/**
* Get part of string
*
Expand All @@ -218,12 +244,14 @@ function mb_substr_count($haystack, $needle, $encoding = null) {
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
* @return string The portion of $string specified by the $string and $length parameters.
*/
if (!function_exists('mb_substr')) {
function mb_substr($string, $start, $length = null, $encoding = null) {
return Multibyte::substr($string, $start, $length);
}

}

if (!function_exists('mb_encode_mimeheader')) {

/**
* Encode string for MIME header
*
Expand All @@ -239,16 +267,15 @@ function mb_substr($string, $start, $length = null, $encoding = null) {
* @param integer $indent [definition unknown and appears to have no affect]
* @return string A converted version of the string represented in ASCII.
*/
if (!function_exists('mb_encode_mimeheader')) {
function mb_encode_mimeheader($str, $charset = 'UTF-8', $transferEncoding = 'B', $linefeed = "\r\n", $indent = 1) {
return Multibyte::mimeEncode($str, $charset, $linefeed);
}

}

/**
* Multibyte handling methods.
*
*
* @package Cake.I18n
*/
class Multibyte {
Expand Down

0 comments on commit 69ab443

Please sign in to comment.