@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | } |
| 242 | 242 | if ($c === $n) { |
| 243 | 243 | $q = $delta; |
| 244 | - for ($k = static::BASE;; $k += static::BASE) { |
|
| 244 | + for ($k = static::BASE; ; $k += static::BASE) { |
|
| 245 | 245 | $t = $this->calculateThreshold($k, $bias); |
| 246 | 246 | if ($q < $t) { |
| 247 | 247 | break; |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | $oldi = $i; |
| 345 | 345 | $w = 1; |
| 346 | 346 | |
| 347 | - for ($k = static::BASE;; $k += static::BASE) |
|
| 347 | + for ($k = static::BASE; ; $k += static::BASE) |
|
| 348 | 348 | { |
| 349 | 349 | if (!isset($input[$pos]) || !isset(static::$decodeTable[$input[$pos]])) |
| 350 | 350 | return false; |
@@ -157,12 +157,14 @@ discard block |
||
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | $parts = explode('.', $preprocessed); |
| 160 | - foreach ($parts as $p => &$part) { |
|
| 160 | + foreach ($parts as $p => &$part) |
|
| 161 | + { |
|
| 161 | 162 | $part = $this->encodePart($part); |
| 162 | 163 | |
| 163 | 164 | $validation_status = $this->validateLabel($part, true); |
| 164 | 165 | |
| 165 | - switch ($validation_status) { |
|
| 166 | + switch ($validation_status) |
|
| 167 | + { |
|
| 166 | 168 | case IDNA_ERROR_LABEL_TOO_LONG: |
| 167 | 169 | case IDNA_ERROR_LEADING_HYPHEN: |
| 168 | 170 | case IDNA_ERROR_TRAILING_HYPHEN: |
@@ -215,13 +217,16 @@ discard block |
||
| 215 | 217 | $h = $b = count($codePoints['basic']); |
| 216 | 218 | |
| 217 | 219 | $output = ''; |
| 218 | - foreach ($codePoints['basic'] as $code) { |
|
| 220 | + foreach ($codePoints['basic'] as $code) |
|
| 221 | + { |
|
| 219 | 222 | $output .= $this->codePointToChar($code); |
| 220 | 223 | } |
| 221 | - if ($input === $output) { |
|
| 224 | + if ($input === $output) |
|
| 225 | + { |
|
| 222 | 226 | return $output; |
| 223 | 227 | } |
| 224 | - if ($b > 0) { |
|
| 228 | + if ($b > 0) |
|
| 229 | + { |
|
| 225 | 230 | $output .= static::DELIMITER; |
| 226 | 231 | } |
| 227 | 232 | |
@@ -230,20 +235,26 @@ discard block |
||
| 230 | 235 | |
| 231 | 236 | $i = 0; |
| 232 | 237 | $length = mb_strlen($input, $this->encoding); |
| 233 | - while ($h < $length) { |
|
| 238 | + while ($h < $length) |
|
| 239 | + { |
|
| 234 | 240 | $m = $codePoints['nonBasic'][$i++]; |
| 235 | 241 | $delta = $delta + ($m - $n) * ($h + 1); |
| 236 | 242 | $n = $m; |
| 237 | 243 | |
| 238 | - foreach ($codePoints['all'] as $c) { |
|
| 239 | - if ($c < $n || $c < static::INITIAL_N) { |
|
| 244 | + foreach ($codePoints['all'] as $c) |
|
| 245 | + { |
|
| 246 | + if ($c < $n || $c < static::INITIAL_N) |
|
| 247 | + { |
|
| 240 | 248 | $delta++; |
| 241 | 249 | } |
| 242 | - if ($c === $n) { |
|
| 250 | + if ($c === $n) |
|
| 251 | + { |
|
| 243 | 252 | $q = $delta; |
| 244 | - for ($k = static::BASE;; $k += static::BASE) { |
|
| 253 | + for ($k = static::BASE;; $k += static::BASE) |
|
| 254 | + { |
|
| 245 | 255 | $t = $this->calculateThreshold($k, $bias); |
| 246 | - if ($q < $t) { |
|
| 256 | + if ($q < $t) |
|
| 257 | + { |
|
| 247 | 258 | break; |
| 248 | 259 | } |
| 249 | 260 | |