We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * |
| 46 | 46 | * @var array |
| 47 | 47 | */ |
| 48 | - const _ENCODINGS = [ 'ASCII', 'UTF-8' ]; |
|
| 48 | + const _ENCODINGS = ['ASCII', 'UTF-8']; |
|
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * A hash map for string functions according to encoding. |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | const _STRING_FUNCTIONS = [ |
| 56 | 56 | 'UTF-8' => [ |
| 57 | 57 | 'strlen' => 'mb_strlen', |
| 58 | - 'str_split' => [ __CLASS__, 'mb_str_split' ], |
|
| 58 | + 'str_split' => [__CLASS__, 'mb_str_split'], |
|
| 59 | 59 | 'strtolower' => 'mb_strtolower', |
| 60 | 60 | 'strtoupper' => 'mb_strtoupper', |
| 61 | 61 | 'substr' => 'mb_substr', |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | * 'u' => modifier string |
| 88 | 88 | * } |
| 89 | 89 | */ |
| 90 | - public static function functions( $str ) { |
|
| 91 | - return self::_STRING_FUNCTIONS[ mb_detect_encoding( $str, self::_ENCODINGS, true ) ]; |
|
| 90 | + public static function functions($str) { |
|
| 91 | + return self::_STRING_FUNCTIONS[mb_detect_encoding($str, self::_ENCODINGS, true)]; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -102,13 +102,13 @@ discard block |
||
| 102 | 102 | * |
| 103 | 103 | * @return array An array of $split_length character chunks. |
| 104 | 104 | */ |
| 105 | - public static function mb_str_split( $str, $split_length = 1 ) { |
|
| 106 | - $result = preg_split( '//u', $str , -1, PREG_SPLIT_NO_EMPTY ); |
|
| 105 | + public static function mb_str_split($str, $split_length = 1) { |
|
| 106 | + $result = preg_split('//u', $str, -1, PREG_SPLIT_NO_EMPTY); |
|
| 107 | 107 | |
| 108 | - if ( $split_length > 1 ) { |
|
| 108 | + if ($split_length > 1) { |
|
| 109 | 109 | $splits = []; |
| 110 | - foreach ( array_chunk( $result, $split_length ) as $chunk ) { |
|
| 111 | - $splits[] = join( '', $chunk ); |
|
| 110 | + foreach (array_chunk($result, $split_length) as $chunk) { |
|
| 111 | + $splits[] = join('', $chunk); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | $result = $splits; |
@@ -124,17 +124,17 @@ discard block |
||
| 124 | 124 | * |
| 125 | 125 | * @return string Unicode character(s). |
| 126 | 126 | */ |
| 127 | - public static function uchr( $codes ) { |
|
| 127 | + public static function uchr($codes) { |
|
| 128 | 128 | |
| 129 | 129 | // Single character code. |
| 130 | - if ( is_scalar( $codes ) ) { |
|
| 130 | + if (is_scalar($codes)) { |
|
| 131 | 131 | $codes = func_get_args(); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | // Deal with an array of character codes. |
| 135 | 135 | $str = ''; |
| 136 | - foreach ( $codes as $code ) { |
|
| 137 | - $str .= self::_uchr( (int) $code ); |
|
| 136 | + foreach ($codes as $code) { |
|
| 137 | + $str .= self::_uchr((int) $code); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | return $str; |
@@ -148,8 +148,8 @@ discard block |
||
| 148 | 148 | * |
| 149 | 149 | * @return string Unicode character. |
| 150 | 150 | */ |
| 151 | - public static function _uchr( $code ) { |
|
| 152 | - return html_entity_decode( '&#' . $code . ';', ENT_NOQUOTES, 'UTF-8' ); |
|
| 151 | + public static function _uchr($code) { |
|
| 152 | + return html_entity_decode('&#' . $code . ';', ENT_NOQUOTES, 'UTF-8'); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
@@ -159,9 +159,9 @@ discard block |
||
| 159 | 159 | * |
| 160 | 160 | * @return array |
| 161 | 161 | */ |
| 162 | - public static function maybe_split_parameters( $params ) { |
|
| 163 | - if ( ! is_array( $params ) ) { |
|
| 164 | - $params = preg_split( self::_RE_PARAMETER_SPLITTING, $params, -1, PREG_SPLIT_NO_EMPTY ); |
|
| 162 | + public static function maybe_split_parameters($params) { |
|
| 163 | + if ( ! is_array($params)) { |
|
| 164 | + $params = preg_split(self::_RE_PARAMETER_SPLITTING, $params, -1, PREG_SPLIT_NO_EMPTY); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | return $params; |