Skip to content

Commit 93ce8df

Browse files
committed
CS
1 parent 5a6e19b commit 93ce8df

9 files changed

Lines changed: 19 additions & 28 deletions

Mbstring.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,20 @@ public static function strSplit($string, $length = 1, $encoding = null)
178178

179179
if ($length === 1) {
180180
return preg_split("//u", $string, -1, PREG_SPLIT_NO_EMPTY);
181-
} elseif ($length > 1) {
181+
}
182+
183+
if ($length > 1) {
182184
$return_value = [];
183185
$string_length = static::strlen($string, $encoding);
186+
184187
for ($i = 0; $i < $string_length; $i += $length) {
185188
$return_value[] = static::substr($string, $i, $length, $encoding);
186189
}
187190

188191
return $return_value;
189-
} else {
190-
return false;
191192
}
193+
194+
return false;
192195
}
193196

194197
/**
@@ -615,6 +618,7 @@ public static function isUtf8($str)
615618

616619
for ($i = 0; $i < $len; $i++) {
617620
$in = ord($str{$i});
621+
618622
if ($mState === 0) {
619623
// When mState is zero we expect either a US-ASCII character or a
620624
// multi-octet sequence.

StringHelper.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function isEmpty($string)
5353

5454
$string = (string) $string;
5555

56-
return !(boolean) strlen($string);
56+
return !(bool) strlen($string);
5757
}
5858

5959
/**
@@ -117,7 +117,9 @@ public static function backquote($string)
117117
*/
118118
public static function increment($string, $style = self::INCREMENT_STYLE_DEFAULT, $n = 0)
119119
{
120-
$styleSpec = isset(self::$incrementStyles[$style]) ? self::$incrementStyles[$style] : self::$incrementStyles['default'];
120+
$styleSpec = isset(self::$incrementStyles[$style])
121+
? self::$incrementStyles[$style]
122+
: self::$incrementStyles['default'];
121123

122124
// Regular expression search and replace patterns.
123125
if (is_array($styleSpec[0])) {

StringInflector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ public static function getInstance($new = false)
325325
*/
326326
public function isCountable($word)
327327
{
328-
return (boolean) in_array($word, $this->rules['countable']);
328+
return in_array($word, $this->rules['countable'], true);
329329
}
330330

331331
/**

Test/MbstringTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Part of Windwalker project Test files.
3+
* Part of Windwalker project Test files. @codingStandardsIgnoreStart
44
*
55
* @copyright Copyright (C) 2014 - 2015 LYRASOFT Taiwan, Inc. All rights reserved.
66
* @license GNU Lesser General Public License version 3 or later.

Test/SimpleTemplateTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Part of Windwalker project Test files.
3+
* Part of Windwalker project Test files. @codingStandardsIgnoreStart
44
*
55
* @copyright Copyright (C) 2011 - 2014 SMS Taiwan, Inc. All rights reserved.
66
* @license GNU General Public License version 2 or later; see LICENSE

Test/StringHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Part of Windwalker project Test files.
3+
* Part of Windwalker project Test files. @codingStandardsIgnoreStart
44
*
55
* @copyright Copyright (C) 2014 - 2015 LYRASOFT Taiwan, Inc. All rights reserved.
66
* @license GNU Lesser General Public License version 3 or later.

Test/Utf8StringTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Part of Windwalker project Test files.
3+
* Part of Windwalker project Test files. @codingStandardsIgnoreStart
44
*
55
* @copyright Copyright (C) 2014 - 2015 LYRASOFT Taiwan, Inc. All rights reserved.
66
* @license GNU Lesser General Public License version 3 or later.

Utf8String.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,8 @@
88

99
namespace Windwalker\String;
1010

11-
// PHP mbstring and iconv local configuration. Port from Joomla String.
12-
if (version_compare(PHP_VERSION, '5.6', '>=')) {
13-
@ini_set('default_charset', 'UTF-8');
14-
} else {
15-
// Check if mbstring extension is loaded and attempt to load it if not present except for windows
16-
if (extension_loaded('mbstring')) {
17-
@ini_set('mbstring.internal_encoding', 'UTF-8');
18-
@ini_set('mbstring.http_input', 'UTF-8');
19-
@ini_set('mbstring.http_output', 'UTF-8');
20-
}
21-
// Same for iconv
22-
if (function_exists('iconv')) {
23-
iconv_set_encoding('internal_encoding', 'UTF-8');
24-
iconv_set_encoding('input_encoding', 'UTF-8');
25-
iconv_set_encoding('output_encoding', 'UTF-8');
26-
}
27-
}
11+
@ini_set('default_charset', 'UTF-8');
12+
2813
/**
2914
* Include the utf8 package
3015
*/

phputf8/utils/ascii.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Part of Windwalker project.
3+
* Part of Windwalker project. @codingStandardsIgnoreStart
44
*
55
* @copyright Copyright (C) 2014 - 2015 LYRASOFT. All rights reserved.
66
* @license GNU Lesser General Public License version 3 or later.

0 commit comments

Comments
 (0)