Completed
Push — master ( 604db9...9db94b )
by Alexey
07:34
created
system/modules/Users/models/User.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         'role_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'role'],
38 38
         'admin_text' => ['type' => 'html'],
39 39
         'activation' => ['type' => 'text'],
40
-        'blocked' => ['type' => 'bool',],
40
+        'blocked' => ['type' => 'bool', ],
41 41
         'date_last_active' => ['type' => 'dateTime'],
42 42
         'date_create' => ['type' => 'dateTime']
43 43
     ];
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                 ]
101 101
             ],
102 102
             'map' => [
103
-                ['login', 'mail',],
103
+                ['login', 'mail', ],
104 104
                 ['group_id', 'role_id'],
105 105
                 ['userSearch', 'blocked'],
106 106
                 ['pass'],
Please login to merge, or discard this patch.
system/modules/Users/models/User/Info.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -97,13 +97,13 @@
 block discarded – undo
97 97
         if ($this->first_name . $this->last_name . $this->middle_name) {
98 98
             $name = '';
99 99
             if ($this->first_name) {
100
-                $name.=$this->first_name;
100
+                $name .= $this->first_name;
101 101
             }
102 102
             if ($this->middle_name) {
103
-                $name.=($name ? ' ' : '') . $this->middle_name;
103
+                $name .= ($name ? ' ' : '') . $this->middle_name;
104 104
             }
105 105
             if ($this->last_name) {
106
-                $name.=($name ? ' ' : '') . $this->last_name;
106
+                $name .= ($name ? ' ' : '') . $this->last_name;
107 107
             }
108 108
             return $name;
109 109
         } else {
Please login to merge, or discard this patch.
system/modules/Users/models/User/Invite.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     static $forms = [
46 46
         'manager' => [
47 47
             'map' => [
48
-                ['code', 'type',],
48
+                ['code', 'type', ],
49 49
                 ['user_id'],
50 50
                 ['limit', 'count'],
51 51
             ]
Please login to merge, or discard this patch.
system/modules/Users/snippets/cabinetSection/socials.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if(!Users\Social::getList(['where' => ['active', 1]])){
2
+if (!Users\Social::getList(['where' => ['active', 1]])) {
3 3
     return false;
4 4
 }
5 5
 return [
Please login to merge, or discard this patch.
system/modules/Users/widgets/cabinet/usersTree.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 if (!empty($_POST['partnerInvite']['email'])) {
3 3
     $title = '';
4 4
     if (!empty($_POST['partnerInvite']['name'])) {
5
-        $title .='Ув. ' . htmlspecialchars($_POST['partnerInvite']['name']) . '. ';
5
+        $title .= 'Ув. ' . htmlspecialchars($_POST['partnerInvite']['name']) . '. ';
6 6
     }
7 7
     if (!filter_var($_POST['partnerInvite']['email'], FILTER_VALIDATE_EMAIL)) {
8 8
         Tools::redirect(null, 'Вы ввели не корректный E-mail', 'danger');
Please login to merge, or discard this patch.
system/modules/View/View.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -187,16 +187,16 @@  discard block
 block discarded – undo
187 187
     {
188 188
         $pos = strpos($source, $rawTag) - 1;
189 189
         echo substr($source, 0, $pos);
190
-        return substr($source, ( $pos + strlen($rawTag) + 2));
190
+        return substr($source, ($pos + strlen($rawTag) + 2));
191 191
     }
192 192
 
193 193
     function getHref($type, $params)
194 194
     {
195 195
         $href = '';
196 196
         if (is_string($params)) {
197
-            $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $params;
197
+            $href = ($this->app->type != 'app' ? '/' . $this->app->name : '') . $params;
198 198
         } elseif (empty($params['template']) && !empty($params['file'])) {
199
-            $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $params['file'];
199
+            $href = ($this->app->type != 'app' ? '/' . $this->app->name : '') . $params['file'];
200 200
         } elseif (!empty($params['template']) && !empty($params['file'])) {
201 201
             $href = $this->app->templatesPath . "/{$this->template->name}/{$type}/{$js['file']}";
202 202
         }
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 
256 256
         $this->checkNeedLibs();
257 257
         $this->parseCss();
258
-        echo "\n        <script src='" . Statics::file(($this->app->type != 'app' ? '/' . $this->app->name : '' ) . "/static/system/js/Inji.js") . "'></script>";
258
+        echo "\n        <script src='" . Statics::file(($this->app->type != 'app' ? '/' . $this->app->name : '') . "/static/system/js/Inji.js") . "'></script>";
259 259
     }
260 260
 
261 261
     function parseCss()
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             if (file_exists($path)) {
280 280
                 $this->loadedCss[$href] = $href;
281 281
                 $urls[$href] = $path;
282
-                $timeStr.=filemtime($path);
282
+                $timeStr .= filemtime($path);
283 283
             } else {
284 284
                 echo "\n        <link href='{$href}' rel='stylesheet' type='text/css' />";
285 285
             }
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
                     if (strpos($css, '//') !== false)
331 331
                         $href = $css;
332 332
                     else
333
-                        $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $css;
333
+                        $href = ($this->app->type != 'app' ? '/' . $this->app->name : '') . $css;
334 334
                     $hrefs[$href] = $href;
335 335
                 }
336 336
                 break;
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
                     if (strpos($css, '//') !== false)
357 357
                         $href = $css;
358 358
                     else
359
-                        $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $css;
359
+                        $href = ($this->app->type != 'app' ? '/' . $this->app->name : '') . $css;
360 360
                     $hrefs[$href] = $href;
361 361
                 }
362 362
                 break;
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
                 if (file_exists($path)) {
418 418
                     $nativeUrl[$script] = $script;
419 419
                     $urls[$script] = $path;
420
-                    $timeStr.=filemtime($path);
420
+                    $timeStr .= filemtime($path);
421 421
                 } else {
422 422
                     $noParsedScripts[$script] = $script;
423 423
                 }
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
                     if (!empty($script['name'])) {
433 433
                         $onLoadModules[$script['name']] = $script['name'];
434 434
                     }
435
-                    $timeStr.=filemtime($path);
435
+                    $timeStr .= filemtime($path);
436 436
                 } else {
437 437
                     $noParsedScripts[$script] = $script;
438 438
                 }
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
     function timegen()
529 529
     {
530 530
         $this->current_function = 'TIMEGEN';
531
-        echo round(( microtime(true) - INJI_TIME_START), 4);
531
+        echo round((microtime(true) - INJI_TIME_START), 4);
532 532
     }
533 533
 
534 534
     function customAsset($type, $asset, $lib = false)
Please login to merge, or discard this patch.
system/objects/CodeGenerator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,13 +16,13 @@
 block discarded – undo
16 16
         if ($level == 0)
17 17
             $return = "[";
18 18
         foreach ($data as $key => $item) {
19
-            $return .= "\n" . str_repeat(' ', ( $level * 4 + 4)) . "'{$key}' => ";
19
+            $return .= "\n" . str_repeat(' ', ($level * 4 + 4)) . "'{$key}' => ";
20 20
             if (!is_array($item))
21 21
                 $return .= "'{$item}',";
22 22
             else {
23 23
                 $return .= "[";
24 24
                 $return .= rtrim(self::genArray($item, $level + 1), ',');
25
-                $return .= "\n" . str_repeat(' ', ( $level * 4 + 4)) . "],";
25
+                $return .= "\n" . str_repeat(' ', ($level * 4 + 4)) . "],";
26 26
             }
27 27
         }
28 28
         if ($level == 0)
Please login to merge, or discard this patch.
system/objects/CodeGenerator/Method.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@
 block discarded – undo
28 28
             $code .= '$' . $param . ',';
29 29
         }
30 30
         $code = rtrim($code, ',');
31
-        $code.= ") {\n";
32
-        $code.= '    ' . str_replace("\n", "\n    ", $this->body);
33
-        $code .="\n}";
31
+        $code .= ") {\n";
32
+        $code .= '    ' . str_replace("\n", "\n    ", $this->body);
33
+        $code .= "\n}";
34 34
         return $code;
35 35
     }
36 36
 
Please login to merge, or discard this patch.
system/objects/IdnaConvert.php 1 patch
Spacing   +74 added lines, -79 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     protected $_lcount = 19;
73 73
     protected $_vcount = 21;
74 74
     protected $_tcount = 28;
75
-    protected $_ncount = 588;   // _vcount * _tcount
75
+    protected $_ncount = 588; // _vcount * _tcount
76 76
     protected $_scount = 11172; // _lcount * _tcount * _vcount
77 77
     protected $_error = false;
78 78
 
@@ -80,10 +80,10 @@  discard block
 block discarded – undo
80 80
 
81 81
     // See {@link set_paramter()} for details of how to change the following
82 82
     // settings from within your script / application
83
-    protected $_api_encoding = 'utf8';   // Default input charset is UTF-8
84
-    protected $_allow_overlong = false;  // Overlong UTF-8 encodings are forbidden
85
-    protected $_strict_mode = false;     // Behave strict or not
86
-    protected $_idn_version = 2003;      // Can be either 2003 (old, default) or 2008
83
+    protected $_api_encoding = 'utf8'; // Default input charset is UTF-8
84
+    protected $_allow_overlong = false; // Overlong UTF-8 encodings are forbidden
85
+    protected $_strict_mode = false; // Behave strict or not
86
+    protected $_idn_version = 2003; // Can be either 2003 (old, default) or 2008
87 87
 
88 88
     /**
89 89
      * the constructor
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
                     $this->_api_encoding = $v;
138 138
                     break;
139 139
                 default:
140
-                    $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k);
140
+                    $this->_error('Set Parameter: Unknown parameter ' . $v . ' for option ' . $k);
141 141
                     return false;
142 142
                 }
143 143
                 break;
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                 if (in_array($v, array('2003', '2008'))) {
152 152
                     $this->_idn_version = $v;
153 153
                 } else {
154
-                    $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k);
154
+                    $this->_error('Set Parameter: Unknown parameter ' . $v . ' for option ' . $k);
155 155
                 }
156 156
                 break;
157 157
             case 'encode_german_sz': // Deprecated
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                 }
163 163
                 break;
164 164
             default:
165
-                $this->_error('Set Parameter: Unknown option '.$k);
165
+                $this->_error('Set Parameter: Unknown option ' . $k);
166 166
                 return false;
167 167
             }
168 168
         }
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
             case 'ucs4_array':
186 186
                 break;
187 187
             default:
188
-                $this->_error('Unknown encoding '.$one_time_encoding);
188
+                $this->_error('Unknown encoding ' . $one_time_encoding);
189 189
                 return false;
190 190
             }
191 191
         }
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
             list ($email_pref, $input) = explode('@', $input, 2);
204 204
             $arr = explode('.', $input);
205 205
             foreach ($arr as $k => $v) {
206
-                if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) {
206
+                if (preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $v)) {
207 207
                     $conv = $this->_decode($v);
208 208
                     if ($conv) $arr[$k] = $conv;
209 209
                 }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
             $input = join('.', $arr);
212 212
             $arr = explode('.', $email_pref);
213 213
             foreach ($arr as $k => $v) {
214
-                if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) {
214
+                if (preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $v)) {
215 215
                     $conv = $this->_decode($v);
216 216
                     if ($conv) $arr[$k] = $conv;
217 217
                 }
@@ -233,13 +233,13 @@  discard block
 block discarded – undo
233 233
                 }
234 234
                 $parsed['host'] = join('.', $arr);
235 235
                 $return =
236
-                        (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://'))
237
-                        .(empty($parsed['user']) ? '' : $parsed['user'].(empty($parsed['pass']) ? '' : ':'.$parsed['pass']).'@')
236
+                        (empty($parsed['scheme']) ? '' : $parsed['scheme'] . (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://'))
237
+                        .(empty($parsed['user']) ? '' : $parsed['user'] . (empty($parsed['pass']) ? '' : ':' . $parsed['pass']) . '@')
238 238
                         .$parsed['host']
239
-                        .(empty($parsed['port']) ? '' : ':'.$parsed['port'])
239
+                        .(empty($parsed['port']) ? '' : ':' . $parsed['port'])
240 240
                         .(empty($parsed['path']) ? '' : $parsed['path'])
241
-                        .(empty($parsed['query']) ? '' : '?'.$parsed['query'])
242
-                        .(empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']);
241
+                        .(empty($parsed['query']) ? '' : '?' . $parsed['query'])
242
+                        .(empty($parsed['fragment']) ? '' : '#' . $parsed['fragment']);
243 243
             } else { // parse_url seems to have failed, try without it
244 244
                 $arr = explode('.', $input);
245 245
                 foreach ($arr as $k => $v) {
@@ -255,8 +255,7 @@  discard block
 block discarded – undo
255 255
         // The output is UTF-8 by default, other output formats need conversion here
256 256
         // If one time encoding is given, use this, else the objects property
257 257
         switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) {
258
-        case 'utf8':
259
-            return $return;
258
+        case 'utf8' : return $return;
260 259
             break;
261 260
         case 'ucs4_string':
262 261
            return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return));
@@ -281,15 +280,14 @@  discard block
 block discarded – undo
281 280
         // Forcing conversion of input to UCS4 array
282 281
         // If one time encoding is given, use this, else the objects property
283 282
         switch ($one_time_encoding ? $one_time_encoding : $this->_api_encoding) {
284
-        case 'utf8':
285
-            $decoded = $this->_utf8_to_ucs4($decoded);
283
+        case 'utf8' : $decoded = $this->_utf8_to_ucs4($decoded);
286 284
             break;
287 285
         case 'ucs4_string':
288 286
            $decoded = $this->_ucs4_string_to_ucs4($decoded);
289 287
         case 'ucs4_array':
290 288
            break;
291 289
         default:
292
-            $this->_error('Unsupported input format: '.($one_time_encoding ? $one_time_encoding : $this->_api_encoding));
290
+            $this->_error('Unsupported input format: ' . ($one_time_encoding ? $one_time_encoding : $this->_api_encoding));
293 291
             return false;
294 292
         }
295 293
 
@@ -302,7 +300,7 @@  discard block
 block discarded – undo
302 300
         $output = '';
303 301
         foreach ($decoded as $k => $v) {
304 302
             // Make sure to use just the plain dot
305
-            switch($v) {
303
+            switch ($v) {
306 304
             case 0x3002:
307 305
             case 0xFF0E:
308 306
             case 0xFF61:
@@ -322,11 +320,11 @@  discard block
 block discarded – undo
322 320
                     // Skip first char
323 321
                     if ($k) {
324 322
                         $encoded = '';
325
-                        $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k)-$last_begin)));
323
+                        $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k) - $last_begin)));
326 324
                         if ($encoded) {
327 325
                             $output .= $encoded;
328 326
                         } else {
329
-                            $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k)-$last_begin)));
327
+                            $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k) - $last_begin)));
330 328
                         }
331 329
                         $output .= chr($decoded[$k]);
332 330
                     }
@@ -338,11 +336,11 @@  discard block
 block discarded – undo
338 336
         if ($last_begin) {
339 337
             $inp_len = sizeof($decoded);
340 338
             $encoded = '';
341
-            $encoded = $this->_encode(array_slice($decoded, $last_begin, (($inp_len)-$last_begin)));
339
+            $encoded = $this->_encode(array_slice($decoded, $last_begin, (($inp_len) - $last_begin)));
342 340
             if ($encoded) {
343 341
                 $output .= $encoded;
344 342
             } else {
345
-                $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($inp_len)-$last_begin)));
343
+                $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($inp_len) - $last_begin)));
346 344
             }
347 345
             return $output;
348 346
         } else {
@@ -375,13 +373,13 @@  discard block
 block discarded – undo
375 373
         }
376 374
         $parsed['host'] = join('.', $arr);
377 375
         $return =
378
-                (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://'))
379
-                .(empty($parsed['user']) ? '' : $parsed['user'].(empty($parsed['pass']) ? '' : ':'.$parsed['pass']).'@')
376
+                (empty($parsed['scheme']) ? '' : $parsed['scheme'] . (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://'))
377
+                .(empty($parsed['user']) ? '' : $parsed['user'] . (empty($parsed['pass']) ? '' : ':' . $parsed['pass']) . '@')
380 378
                 .$parsed['host']
381
-                .(empty($parsed['port']) ? '' : ':'.$parsed['port'])
379
+                .(empty($parsed['port']) ? '' : ':' . $parsed['port'])
382 380
                 .(empty($parsed['path']) ? '' : $parsed['path'])
383
-                .(empty($parsed['query']) ? '' : '?'.$parsed['query'])
384
-                .(empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']);
381
+                .(empty($parsed['query']) ? '' : '?' . $parsed['query'])
382
+                .(empty($parsed['fragment']) ? '' : '#' . $parsed['fragment']);
385 383
         return $return;
386 384
     }
387 385
 
@@ -404,11 +402,11 @@  discard block
 block discarded – undo
404 402
     {
405 403
         $decoded = array();
406 404
         // find the Punycode prefix
407
-        if (!preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $encoded)) {
405
+        if (!preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $encoded)) {
408 406
             $this->_error('This is not a punycode string');
409 407
             return false;
410 408
         }
411
-        $encode_test = preg_replace('!^'.preg_quote($this->_punycode_prefix, '!').'!', '', $encoded);
409
+        $encode_test = preg_replace('!^' . preg_quote($this->_punycode_prefix, '!') . '!', '', $encoded);
412 410
         // If nothing left after removing the prefix, it is hopeless
413 411
         if (!$encode_test) {
414 412
             $this->_error('The given encoded string was empty');
@@ -431,11 +429,10 @@  discard block
 block discarded – undo
431 429
         $char = $this->_initial_n;
432 430
 
433 431
         for ($enco_idx = ($delim_pos) ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) {
434
-            for ($old_idx = $idx, $w = 1, $k = $this->_base; 1 ; $k += $this->_base) {
432
+            for ($old_idx = $idx, $w = 1, $k = $this->_base; 1; $k += $this->_base) {
435 433
                 $digit = $this->_decode_digit($encoded{$enco_idx++});
436 434
                 $idx += $digit * $w;
437
-                $t = ($k <= $bias) ? $this->_tmin :
438
-                        (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias));
435
+                $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias));
439 436
                 if ($digit < $t) break;
440 437
                 $w = (int) ($w * ($this->_base - $t));
441 438
             }
@@ -500,7 +497,7 @@  discard block
 block discarded – undo
500 497
         if ($codecount == $deco_len) return $encoded; // All codepoints were basic ones
501 498
 
502 499
         // Start with the prefix; copy it to output
503
-        $encoded = $this->_punycode_prefix.$encoded;
500
+        $encoded = $this->_punycode_prefix . $encoded;
504 501
         // If we have basic code points in output, add an hyphen to the end
505 502
         if ($codecount) $encoded .= '-';
506 503
         // Now find and encode all non-basic code points
@@ -525,14 +522,13 @@  discard block
 block discarded – undo
525 522
                     $delta++;
526 523
                 } elseif ($decoded[$i] == $cur_code) {
527 524
                     for ($q = $delta, $k = $this->_base; 1; $k += $this->_base) {
528
-                        $t = ($k <= $bias) ? $this->_tmin :
529
-                                (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias);
525
+                        $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias);
530 526
                         if ($q < $t) break;
531 527
                         $encoded .= $this->_encode_digit(intval($t + (($q - $t) % ($this->_base - $t)))); //v0.4.5 Changed from ceil() to intval()
532 528
                         $q = (int) (($q - $t) / ($this->_base - $t));
533 529
                     }
534 530
                     $encoded .= $this->_encode_digit($q);
535
-                    $bias = $this->_adapt($delta, $codecount+1, $is_first);
531
+                    $bias = $this->_adapt($delta, $codecount + 1, $is_first);
536 532
                     $codecount++;
537 533
                     $delta = 0;
538 534
                     $is_first = false;
@@ -610,12 +606,12 @@  discard block
 block discarded – undo
610 606
             if (in_array($v, self::$NP['map_nothing'])) continue;
611 607
             // Try to find prohibited input
612 608
             if (in_array($v, self::$NP['prohibit']) || in_array($v, self::$NP['general_prohibited'])) {
613
-                $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v));
609
+                $this->_error('NAMEPREP: Prohibited input U+' . sprintf('%08X', $v));
614 610
                 return false;
615 611
             }
616 612
             foreach (self::$NP['prohibit_ranges'] as $range) {
617 613
                 if ($range[0] <= $v && $v <= $range[1]) {
618
-                    $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v));
614
+                    $this->_error('NAMEPREP: Prohibited input U+' . sprintf('%08X', $v));
619 615
                     return false;
620 616
                 }
621 617
             }
@@ -654,13 +650,13 @@  discard block
 block discarded – undo
654 650
                 if ($out) {
655 651
                     $output[$last_starter] = $out;
656 652
                     if (count($out) != $seq_len) {
657
-                        for ($j = $i+1; $j < $out_len; ++$j) $output[$j-1] = $output[$j];
653
+                        for ($j = $i + 1; $j < $out_len; ++$j) $output[$j - 1] = $output[$j];
658 654
                         unset($output[$out_len]);
659 655
                     }
660 656
                     // Rewind the for loop by one, since there can be more possible compositions
661 657
                     $i--;
662 658
                     $out_len--;
663
-                    $last_class = ($i == $last_starter) ? 0 : $this->_get_combining_class($output[$i-1]);
659
+                    $last_class = ($i == $last_starter) ? 0 : $this->_get_combining_class($output[$i - 1]);
664 660
                     continue;
665 661
                 }
666 662
             }
@@ -752,15 +748,15 @@  discard block
 block discarded – undo
752 748
         while ($swap) {
753 749
             $swap = false;
754 750
             $last = $this->_get_combining_class(intval($input[0]));
755
-            for ($i = 0; $i < $size-1; ++$i) {
756
-                $next = $this->_get_combining_class(intval($input[$i+1]));
751
+            for ($i = 0; $i < $size - 1; ++$i) {
752
+                $next = $this->_get_combining_class(intval($input[$i + 1]));
757 753
                 if ($next != 0 && $last > $next) {
758 754
                     // Move item leftward until it fits
759 755
                     for ($j = $i + 1; $j > 0; --$j) {
760
-                        if ($this->_get_combining_class(intval($input[$j-1])) <= $next) break;
756
+                        if ($this->_get_combining_class(intval($input[$j - 1])) <= $next) break;
761 757
                         $t = intval($input[$j]);
762
-                        $input[$j] = intval($input[$j-1]);
763
-                        $input[$j-1] = $t;
758
+                        $input[$j] = intval($input[$j - 1]);
759
+                        $input[$j - 1] = $t;
764 760
                         $swap = true;
765 761
                     }
766 762
                     // Reentering the loop looking at the old character again
@@ -831,7 +827,7 @@  discard block
 block discarded – undo
831 827
                 $output[$out_len] = $v;
832 828
                 ++$out_len;
833 829
                 if ('add' == $mode) {
834
-                    $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k);
830
+                    $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k);
835 831
                     return false;
836 832
                 }
837 833
                 continue;
@@ -856,7 +852,7 @@  discard block
 block discarded – undo
856 852
                     $next_byte = 4;
857 853
                     $v = ($v - 252) << 30;
858 854
                 } else {
859
-                    $this->_error('This might be UTF-8, but I don\'t understand it at byte '.$k);
855
+                    $this->_error('This might be UTF-8, but I don\'t understand it at byte ' . $k);
860 856
                     return false;
861 857
                 }
862 858
                 if ('add' == $mode) {
@@ -869,7 +865,7 @@  discard block
 block discarded – undo
869 865
                 if (!$this->_allow_overlong && $test == 'range') {
870 866
                     $test = 'none';
871 867
                     if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) {
872
-                        $this->_error('Bogus UTF-8 character detected (out of legal range) at byte '.$k);
868
+                        $this->_error('Bogus UTF-8 character detected (out of legal range) at byte ' . $k);
873 869
                         return false;
874 870
                     }
875 871
                 }
@@ -878,7 +874,7 @@  discard block
 block discarded – undo
878 874
                     $output[($out_len - 1)] += $v;
879 875
                     --$next_byte;
880 876
                 } else {
881
-                    $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k);
877
+                    $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k);
882 878
                     return false;
883 879
                 }
884 880
                 if ($next_byte < 0) {
@@ -902,13 +898,13 @@  discard block
 block discarded – undo
902 898
             if ($v < 128) { // 7bit are transferred literally
903 899
                 $output .= chr($v);
904 900
             } elseif ($v < (1 << 11)) { // 2 bytes
905
-                $output .= chr(192+($v >> 6)).chr(128+($v & 63));
901
+                $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63));
906 902
             } elseif ($v < (1 << 16)) { // 3 bytes
907
-                $output .= chr(224+($v >> 12)).chr(128+(($v >> 6) & 63)).chr(128+($v & 63));
903
+                $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
908 904
             } elseif ($v < (1 << 21)) { // 4 bytes
909
-                $output .= chr(240+($v >> 18)).chr(128+(($v >> 12) & 63)).chr(128+(($v >> 6) & 63)).chr(128+($v & 63));
905
+                $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
910 906
             } else {
911
-                $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k);
907
+                $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte ' . $k);
912 908
                 return false;
913 909
             }
914 910
         }
@@ -927,7 +923,7 @@  discard block
 block discarded – undo
927 923
         // Take array values and split output to 4 bytes per value
928 924
         // The bit mask is 255, which reads &11111111
929 925
         foreach ($input as $v) {
930
-            $output .= chr(($v >> 24) & 255).chr(($v >> 16) & 255).chr(($v >> 8) & 255).chr($v & 255);
926
+            $output .= chr(($v >> 24) & 255) . chr(($v >> 16) & 255) . chr(($v >> 8) & 255) . chr($v & 255);
931 927
         }
932 928
         return $output;
933 929
     }
@@ -955,7 +951,7 @@  discard block
 block discarded – undo
955 951
                 $out_len++;
956 952
                 $output[$out_len] = 0;
957 953
             }
958
-            $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) );
954
+            $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4)));
959 955
         }
960 956
         return $output;
961 957
     }
@@ -1017,13 +1013,12 @@  discard block
 block discarded – undo
1017 1013
      * @private array
1018 1014
      * @since 0.5.2
1019 1015
      */
1020
-    protected static $NP = array
1021
-            ('map_nothing' => array(0xAD, 0x34F, 0x1806, 0x180B, 0x180C, 0x180D, 0x200B, 0x200C
1016
+    protected static $NP = array('map_nothing' => array(0xAD, 0x34F, 0x1806, 0x180B, 0x180C, 0x180D, 0x200B, 0x200C
1022 1017
                     ,0x200D, 0x2060, 0xFE00, 0xFE01, 0xFE02, 0xFE03, 0xFE04, 0xFE05, 0xFE06, 0xFE07
1023 1018
                     ,0xFE08, 0xFE09, 0xFE0A, 0xFE0B, 0xFE0C, 0xFE0D, 0xFE0E, 0xFE0F, 0xFEFF
1024 1019
                     )
1025 1020
             ,'general_prohibited' => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
1026
-                    ,20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 ,33, 34, 35, 36, 37, 38, 39, 40, 41, 42
1021
+                    ,20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42
1027 1022
                     ,43, 44, 47, 59, 60, 61, 62, 63, 64, 91, 92, 93, 94, 95, 96, 123, 124, 125, 126, 127, 0x3002
1028 1023
                     )
1029 1024
             ,'prohibit' => array(0xA0, 0x340, 0x341, 0x6DD, 0x70F, 0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003
@@ -1035,7 +1030,7 @@  discard block
 block discarded – undo
1035 1030
                     ,0xCFFFE, 0xCFFFF, 0xDFFFE, 0xDFFFF, 0xE0001, 0xEFFFE, 0xEFFFF, 0xFFFFE, 0xFFFFF, 0x10FFFE, 0x10FFFF
1036 1031
                     )
1037 1032
             ,'prohibit_ranges' => array(array(0x80, 0x9F), array(0x2060, 0x206F), array(0x1D173, 0x1D17A)
1038
-                    ,array(0xE000, 0xF8FF) ,array(0xF0000, 0xFFFFD), array(0x100000, 0x10FFFD)
1033
+                    ,array(0xE000, 0xF8FF), array(0xF0000, 0xFFFFD), array(0x100000, 0x10FFFD)
1039 1034
                     ,array(0xFDD0, 0xFDEF), array(0xD800, 0xDFFF), array(0x2FF0, 0x2FFB), array(0xE0020, 0xE007F)
1040 1035
                     )
1041 1036
             ,'replacemaps' => array(0x41 => array(0x61), 0x42 => array(0x62), 0x43 => array(0x63)
@@ -1301,7 +1296,7 @@  discard block
 block discarded – undo
1301 1296
                     ,0x2128  => array(0x7A), 0x212A  => array(0x6B), 0x212B  => array(0xE5)
1302 1297
                     ,0x212C  => array(0x62), 0x212D  => array(0x63), 0x2130  => array(0x65)
1303 1298
                     ,0x2131  => array(0x66), 0x2133  => array(0x6D), 0x213E  => array(0x3B3)
1304
-                    ,0x213F  => array(0x3C0), 0x2145  => array(0x64) ,0x2160  => array(0x2170)
1299
+                    ,0x213F  => array(0x3C0), 0x2145  => array(0x64), 0x2160  => array(0x2170)
1305 1300
                     ,0x2161  => array(0x2171), 0x2162  => array(0x2172), 0x2163  => array(0x2173)
1306 1301
                     ,0x2164  => array(0x2174), 0x2165  => array(0x2175), 0x2166  => array(0x2176)
1307 1302
                     ,0x2167  => array(0x2177), 0x2168  => array(0x2178), 0x2169  => array(0x2179)
@@ -1449,7 +1444,7 @@  discard block
 block discarded – undo
1449 1444
                     ,0x1D5E5 => array(0x72), 0x1D5E6 => array(0x73), 0x1D5E7 => array(0x74)
1450 1445
                     ,0x1D5E8 => array(0x75), 0x1D5E9 => array(0x76), 0x1D5EA => array(0x77)
1451 1446
                     ,0x1D5EB => array(0x78), 0x1D5EC => array(0x79), 0x1D5ED => array(0x7A)
1452
-                    ,0x1D608 => array(0x61), 0x1D609 => array(0x62) ,0x1D60A => array(0x63)
1447
+                    ,0x1D608 => array(0x61), 0x1D609 => array(0x62), 0x1D60A => array(0x63)
1453 1448
                     ,0x1D60B => array(0x64), 0x1D60C => array(0x65), 0x1D60D => array(0x66)
1454 1449
                     ,0x1D60E => array(0x67), 0x1D60F => array(0x68), 0x1D610 => array(0x69)
1455 1450
                     ,0x1D611 => array(0x6A), 0x1D612 => array(0x6B), 0x1D613 => array(0x6C)
@@ -1489,9 +1484,9 @@  discard block
 block discarded – undo
1489 1484
                     ,0x1D6E9 => array(0x3B8), 0x1D6EA => array(0x3B9), 0x1D6EB => array(0x3BA)
1490 1485
                     ,0x1D6EC => array(0x3BB), 0x1D6ED => array(0x3BC), 0x1D6EE => array(0x3BD)
1491 1486
                     ,0x1D6EF => array(0x3BE), 0x1D6F0 => array(0x3BF), 0x1D6F1 => array(0x3C0)
1492
-                    ,0x1D6F2 => array(0x3C1), 0x1D6F3 => array(0x3B8) ,0x1D6F4 => array(0x3C3)
1487
+                    ,0x1D6F2 => array(0x3C1), 0x1D6F3 => array(0x3B8), 0x1D6F4 => array(0x3C3)
1493 1488
                     ,0x1D6F5 => array(0x3C4), 0x1D6F6 => array(0x3C5), 0x1D6F7 => array(0x3C6)
1494
-                    ,0x1D6F8 => array(0x3C7), 0x1D6F9 => array(0x3C8) ,0x1D6FA => array(0x3C9)
1489
+                    ,0x1D6F8 => array(0x3C7), 0x1D6F9 => array(0x3C8), 0x1D6FA => array(0x3C9)
1495 1490
                     ,0x1D70D => array(0x3C3), 0x1D71C => array(0x3B1), 0x1D71D => array(0x3B2)
1496 1491
                     ,0x1D71E => array(0x3B3), 0x1D71F => array(0x3B4), 0x1D720 => array(0x3B5)
1497 1492
                     ,0x1D721 => array(0x3B6), 0x1D722 => array(0x3B7), 0x1D723 => array(0x3B8)
@@ -1531,18 +1526,18 @@  discard block
 block discarded – undo
1531 1526
                     ,0x337A  => array(0x69, 0x75), 0x33DE  => array(0x76, 0x2215, 0x6D)
1532 1527
                     ,0x33DF  => array(0x61, 0x2215, 0x6D)
1533 1528
                     )
1534
-            ,'norm_combcls' => array(0x334   => 1,   0x335   => 1,   0x336   => 1,   0x337   => 1
1535
-                    ,0x338   => 1,   0x93C   => 7,   0x9BC   => 7,   0xA3C   => 7,   0xABC   => 7
1536
-                    ,0xB3C   => 7,   0xCBC   => 7,   0x1037  => 7,   0x3099  => 8,   0x309A  => 8
1537
-                    ,0x94D   => 9,   0x9CD   => 9,   0xA4D   => 9,   0xACD   => 9,   0xB4D   => 9
1538
-                    ,0xBCD   => 9,   0xC4D   => 9,   0xCCD   => 9,   0xD4D   => 9,   0xDCA   => 9
1539
-                    ,0xE3A   => 9,   0xF84   => 9,   0x1039  => 9,   0x1714  => 9,   0x1734  => 9
1540
-                    ,0x17D2  => 9,   0x5B0   => 10,  0x5B1   => 11,  0x5B2   => 12,  0x5B3   => 13
1541
-                    ,0x5B4   => 14,  0x5B5   => 15,  0x5B6   => 16,  0x5B7   => 17,  0x5B8   => 18
1542
-                    ,0x5B9   => 19,  0x5BB   => 20,  0x5Bc   => 21,  0x5BD   => 22,  0x5BF   => 23
1543
-                    ,0x5C1   => 24,  0x5C2   => 25,  0xFB1E  => 26,  0x64B   => 27,  0x64C   => 28
1544
-                    ,0x64D   => 29,  0x64E   => 30,  0x64F   => 31,  0x650   => 32,  0x651   => 33
1545
-                    ,0x652   => 34,  0x670   => 35,  0x711   => 36,  0xC55   => 84,  0xC56   => 91
1529
+            ,'norm_combcls' => array(0x334   => 1, 0x335   => 1, 0x336   => 1, 0x337   => 1
1530
+                    ,0x338   => 1, 0x93C   => 7, 0x9BC   => 7, 0xA3C   => 7, 0xABC   => 7
1531
+                    ,0xB3C   => 7, 0xCBC   => 7, 0x1037  => 7, 0x3099  => 8, 0x309A  => 8
1532
+                    ,0x94D   => 9, 0x9CD   => 9, 0xA4D   => 9, 0xACD   => 9, 0xB4D   => 9
1533
+                    ,0xBCD   => 9, 0xC4D   => 9, 0xCCD   => 9, 0xD4D   => 9, 0xDCA   => 9
1534
+                    ,0xE3A   => 9, 0xF84   => 9, 0x1039  => 9, 0x1714  => 9, 0x1734  => 9
1535
+                    ,0x17D2  => 9, 0x5B0   => 10, 0x5B1   => 11, 0x5B2   => 12, 0x5B3   => 13
1536
+                    ,0x5B4   => 14, 0x5B5   => 15, 0x5B6   => 16, 0x5B7   => 17, 0x5B8   => 18
1537
+                    ,0x5B9   => 19, 0x5BB   => 20, 0x5Bc   => 21, 0x5BD   => 22, 0x5BF   => 23
1538
+                    ,0x5C1   => 24, 0x5C2   => 25, 0xFB1E  => 26, 0x64B   => 27, 0x64C   => 28
1539
+                    ,0x64D   => 29, 0x64E   => 30, 0x64F   => 31, 0x650   => 32, 0x651   => 33
1540
+                    ,0x652   => 34, 0x670   => 35, 0x711   => 36, 0xC55   => 84, 0xC56   => 91
1546 1541
                     ,0xE38   => 103, 0xE39   => 103, 0xE48   => 107, 0xE49   => 107, 0xE4A   => 107
1547 1542
                     ,0xE4B   => 107, 0xEB8   => 118, 0xEB9   => 118, 0xEC8   => 122, 0xEC9   => 122
1548 1543
                     ,0xECA   => 122, 0xECB   => 122, 0xF71   => 129, 0xF72   => 130, 0xF7A   => 130
Please login to merge, or discard this patch.