Skip to content

Commit 69ab443

Browse files
committed
Fix whitespace for coding standards.
1 parent f26d24b commit 69ab443

File tree

1 file changed

+42
-15
lines changed

1 file changed

+42
-15
lines changed

lib/Cake/I18n/Multibyte.php

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
1919
*/
2020

21+
if (!function_exists('mb_stripos')) {
22+
2123
/**
2224
* Find position of first occurrence of a case-insensitive string.
2325
*
@@ -28,12 +30,14 @@
2830
* @return integer|boolean The numeric position of the first occurrence of $needle in the $haystack string, or false
2931
* if $needle is not found.
3032
*/
31-
if (!function_exists('mb_stripos')) {
3233
function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) {
3334
return Multibyte::stripos($haystack, $needle, $offset);
3435
}
36+
3537
}
3638

39+
if (!function_exists('mb_stristr')) {
40+
3741
/**
3842
* Finds first occurrence of a string within another, case insensitive.
3943
*
@@ -46,12 +50,14 @@ function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) {
4650
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
4751
* @return string|boolean The portion of $haystack, or false if $needle is not found.
4852
*/
49-
if (!function_exists('mb_stristr')) {
5053
function mb_stristr($haystack, $needle, $part = false, $encoding = null) {
5154
return Multibyte::stristr($haystack, $needle, $part);
5255
}
56+
5357
}
5458

59+
if (!function_exists('mb_strlen')) {
60+
5561
/**
5662
* Get string length.
5763
*
@@ -60,12 +66,14 @@ function mb_stristr($haystack, $needle, $part = false, $encoding = null) {
6066
* @return integer The number of characters in string $string having character encoding encoding.
6167
* A multi-byte character is counted as 1.
6268
*/
63-
if (!function_exists('mb_strlen')) {
6469
function mb_strlen($string, $encoding = null) {
6570
return Multibyte::strlen($string);
6671
}
72+
6773
}
6874

75+
if (!function_exists('mb_strpos')) {
76+
6977
/**
7078
* Find position of first occurrence of a string.
7179
*
@@ -76,12 +84,14 @@ function mb_strlen($string, $encoding = null) {
7684
* @return integer|boolean The numeric position of the first occurrence of $needle in the $haystack string.
7785
* If $needle is not found, it returns false.
7886
*/
79-
if (!function_exists('mb_strpos')) {
8087
function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) {
8188
return Multibyte::strpos($haystack, $needle, $offset);
8289
}
90+
8391
}
8492

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

113+
if (!function_exists('mb_strrichr')) {
114+
103115
/**
104116
* Finds the last occurrence of a character in a string within another, case insensitive.
105117
*
@@ -112,12 +124,14 @@ function mb_strrchr($haystack, $needle, $part = false, $encoding = null) {
112124
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
113125
* @return string|boolean The portion of $haystack. or false if $needle is not found.
114126
*/
115-
if (!function_exists('mb_strrichr')) {
116127
function mb_strrichr($haystack, $needle, $part = false, $encoding = null) {
117128
return Multibyte::strrichr($haystack, $needle, $part);
118129
}
130+
119131
}
120132

133+
if (!function_exists('mb_strripos')) {
134+
121135
/**
122136
* Finds position of last occurrence of a string within another, case insensitive
123137
*
@@ -128,12 +142,14 @@ function mb_strrichr($haystack, $needle, $part = false, $encoding = null) {
128142
* @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string,
129143
* or false if $needle is not found.
130144
*/
131-
if (!function_exists('mb_strripos')) {
132145
function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) {
133146
return Multibyte::strripos($haystack, $needle, $offset);
134147
}
148+
135149
}
136150

151+
if (!function_exists('mb_strrpos')) {
152+
137153
/**
138154
* Find position of last occurrence of a string in a string.
139155
*
@@ -145,12 +161,14 @@ function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) {
145161
* @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string.
146162
* If $needle is not found, it returns false.
147163
*/
148-
if (!function_exists('mb_strrpos')) {
149164
function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) {
150165
return Multibyte::strrpos($haystack, $needle, $offset);
151166
}
167+
152168
}
153169

170+
if (!function_exists('mb_strstr')) {
171+
154172
/**
155173
* Finds first occurrence of a string within another
156174
*
@@ -163,38 +181,44 @@ function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) {
163181
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
164182
* @return string|boolean The portion of $haystack, or true if $needle is not found.
165183
*/
166-
if (!function_exists('mb_strstr')) {
167184
function mb_strstr($haystack, $needle, $part = false, $encoding = null) {
168185
return Multibyte::strstr($haystack, $needle, $part);
169186
}
187+
170188
}
171189

190+
if (!function_exists('mb_strtolower')) {
191+
172192
/**
173193
* Make a string lowercase
174194
*
175195
* @param string $string The string being lowercased.
176196
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
177197
* @return string with all alphabetic characters converted to lowercase.
178198
*/
179-
if (!function_exists('mb_strtolower')) {
180199
function mb_strtolower($string, $encoding = null) {
181200
return Multibyte::strtolower($string);
182201
}
202+
183203
}
184204

205+
if (!function_exists('mb_strtoupper')) {
206+
185207
/**
186208
* Make a string uppercase
187209
*
188210
* @param string $string The string being uppercased.
189211
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
190212
* @return string with all alphabetic characters converted to uppercase.
191213
*/
192-
if (!function_exists('mb_strtoupper')) {
193214
function mb_strtoupper($string, $encoding = null) {
194215
return Multibyte::strtoupper($string);
195216
}
217+
196218
}
197219

220+
if (!function_exists('mb_substr_count')) {
221+
198222
/**
199223
* Count the number of substring occurrences
200224
*
@@ -203,12 +227,14 @@ function mb_strtoupper($string, $encoding = null) {
203227
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
204228
* @return integer The number of times the $needle substring occurs in the $haystack string.
205229
*/
206-
if (!function_exists('mb_substr_count')) {
207230
function mb_substr_count($haystack, $needle, $encoding = null) {
208231
return Multibyte::substrCount($haystack, $needle);
209232
}
233+
210234
}
211235

236+
if (!function_exists('mb_substr')) {
237+
212238
/**
213239
* Get part of string
214240
*
@@ -218,12 +244,14 @@ function mb_substr_count($haystack, $needle, $encoding = null) {
218244
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
219245
* @return string The portion of $string specified by the $string and $length parameters.
220246
*/
221-
if (!function_exists('mb_substr')) {
222247
function mb_substr($string, $start, $length = null, $encoding = null) {
223248
return Multibyte::substr($string, $start, $length);
224249
}
250+
225251
}
226252

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

248276
/**
249277
* Multibyte handling methods.
250278
*
251-
*
252279
* @package Cake.I18n
253280
*/
254281
class Multibyte {

0 commit comments

Comments
 (0)