Passed
Branch master (e0d98e)
by Rubén
06:37
created
inc/Exts/phpseclib/Crypt/TripleDES.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -255,8 +255,8 @@
 block discarded – undo
255 255
         // because we will then act as regular DES-CBC with just a <= 64bit key.
256 256
         // So only if the key > 64bits (> 8 bytes) we will call setKey() for the 3 $des.
257 257
         if ($this->mode_3cbc && $length > 8) {
258
-            $this->des[0]->setKey(substr($key,  0, 8));
259
-            $this->des[1]->setKey(substr($key,  8, 8));
258
+            $this->des[0]->setKey(substr($key, 0, 8));
259
+            $this->des[1]->setKey(substr($key, 8, 8));
260 260
             $this->des[2]->setKey(substr($key, 16, 8));
261 261
         }
262 262
     }
Please login to merge, or discard this patch.
inc/Exts/phpseclib/Net/SCP.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     /**
70 70
      * SSH2 is being used.
71 71
      */
72
-    const MODE_SSH2 =  2;
72
+    const MODE_SSH2 = 2;
73 73
     /**#@-*/
74 74
 
75 75
     /**
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
         while ($sent < $size) {
190 190
             $temp = $mode & self::SOURCE_STRING ? substr($data, $sent, $this->packet_size) : fread($fp, $this->packet_size);
191 191
             $this->_send($temp);
192
-            $sent+= strlen($temp);
192
+            $sent += strlen($temp);
193 193
 
194 194
             if (is_callable($callback)) {
195 195
                 call_user_func($callback, $sent);
@@ -247,10 +247,10 @@  discard block
 block discarded – undo
247 247
         while ($size < $info['size']) {
248 248
             $data = $this->_receive();
249 249
             // SCP usually seems to split stuff out into 16k chunks
250
-            $size+= strlen($data);
250
+            $size += strlen($data);
251 251
 
252 252
             if ($local_file === false) {
253
-                $content.= $data;
253
+                $content .= $data;
254 254
             } else {
255 255
                 fputs($fp, $data);
256 256
             }
Please login to merge, or discard this patch.
inc/Exts/phpseclib/Net/SFTP.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -438,8 +438,8 @@  discard block
 block discarded – undo
438 438
         if ($response === false) {
439 439
             // from PuTTY's psftp.exe
440 440
             $command = "test -x /usr/lib/sftp-server && exec /usr/lib/sftp-server\n" .
441
-                       "test -x /usr/local/lib/sftp-server && exec /usr/local/lib/sftp-server\n" .
442
-                       "exec sftp-server";
441
+                        "test -x /usr/local/lib/sftp-server && exec /usr/local/lib/sftp-server\n" .
442
+                        "exec sftp-server";
443 443
             // we don't do $this->exec($command, false) because exec() operates on a different channel and plus the SSH_MSG_CHANNEL_OPEN that exec() does
444 444
             // is redundant
445 445
             $packet = pack(
@@ -2678,7 +2678,7 @@  discard block
 block discarded – undo
2678 2678
 
2679 2679
         if (defined('NET_SFTP_LOGGING')) {
2680 2680
             $packet_type = '-> ' . $this->packet_types[$type] .
2681
-                           ' (' . round($stop - $start, 4) . 's)';
2681
+                            ' (' . round($stop - $start, 4) . 's)';
2682 2682
             if (NET_SFTP_LOGGING == NET_SFTP_LOG_REALTIME) {
2683 2683
                 echo "<pre>\r\n" . $this->_format_log(array($data), array($packet_type)) . "\r\n</pre>\r\n";
2684 2684
                 flush();
@@ -2754,7 +2754,7 @@  discard block
 block discarded – undo
2754 2754
 
2755 2755
         if (defined('NET_SFTP_LOGGING')) {
2756 2756
             $packet_type = '<- ' . $this->packet_types[$this->packet_type] .
2757
-                           ' (' . round($stop - $start, 4) . 's)';
2757
+                            ' (' . round($stop - $start, 4) . 's)';
2758 2758
             if (NET_SFTP_LOGGING == NET_SFTP_LOG_REALTIME) {
2759 2759
                 echo "<pre>\r\n" . $this->_format_log(array($packet), array($packet_type)) . "\r\n</pre>\r\n";
2760 2760
                 flush();
Please login to merge, or discard this patch.
Spacing   +32 added lines, -33 removed lines patch added patch discarded remove patch
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
             $dir = './';
683 683
         // suffix a slash if needed
684 684
         } elseif ($dir[strlen($dir) - 1] != '/') {
685
-            $dir.= '/';
685
+            $dir .= '/';
686 686
         }
687 687
 
688 688
         $dir = $this->_realpath($dir);
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
                 $files[$key] = $this->rawlist($dir . '/' . $key, true);
802 802
                 $depth--;
803 803
             } else {
804
-                $files[$key] = (object) $value;
804
+                $files[$key] = (object)$value;
805 805
             }
806 806
         }
807 807
 
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
                             } else {
887 887
                                 $temp = $dir . '/' . $shortname;
888 888
                             }
889
-                            $this->_update_stat_cache($temp, (object) array('lstat' => $attributes));
889
+                            $this->_update_stat_cache($temp, (object)array('lstat' => $attributes));
890 890
                         }
891 891
                         // SFTPv6 has an optional boolean end-of-list field, but we'll ignore that, since the
892 892
                         // final SSH_FXP_STATUS packet should tell us that, already.
@@ -968,8 +968,8 @@  discard block
 block discarded – undo
968 968
                     break;
969 969
                 case 'permissions':
970 970
                 case 'mode':
971
-                    $a[$sort]&= 07777;
972
-                    $b[$sort]&= 07777;
971
+                    $a[$sort] &= 07777;
972
+                    $b[$sort] &= 07777;
973 973
                 default:
974 974
                     if ($a[$sort] === $b[$sort]) {
975 975
                         break;
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
             return;
1008 1008
         }
1009 1009
         $len = count($args) & 0x7FFFFFFE;
1010
-        for ($i = 0; $i < $len; $i+=2) {
1010
+        for ($i = 0; $i < $len; $i += 2) {
1011 1011
             $this->sortOptions[$args[$i]] = $args[$i + 1];
1012 1012
         }
1013 1013
         if (!count($this->sortOptions)) {
@@ -1166,9 +1166,9 @@  discard block
 block discarded – undo
1166 1166
         }
1167 1167
         if (isset($stat['type'])) {
1168 1168
             if ($stat['type'] == NET_SFTP_TYPE_DIRECTORY) {
1169
-                $filename.= '/.';
1169
+                $filename .= '/.';
1170 1170
             }
1171
-            $this->_update_stat_cache($filename, (object) array('stat' => $stat));
1171
+            $this->_update_stat_cache($filename, (object)array('stat' => $stat));
1172 1172
             return $stat;
1173 1173
         }
1174 1174
 
@@ -1179,9 +1179,9 @@  discard block
 block discarded – undo
1179 1179
         $this->pwd = $pwd;
1180 1180
 
1181 1181
         if ($stat['type'] == NET_SFTP_TYPE_DIRECTORY) {
1182
-            $filename.= '/.';
1182
+            $filename .= '/.';
1183 1183
         }
1184
-        $this->_update_stat_cache($filename, (object) array('stat' => $stat));
1184
+        $this->_update_stat_cache($filename, (object)array('stat' => $stat));
1185 1185
 
1186 1186
         return $stat;
1187 1187
     }
@@ -1223,9 +1223,9 @@  discard block
 block discarded – undo
1223 1223
         }
1224 1224
         if (isset($lstat['type'])) {
1225 1225
             if ($lstat['type'] == NET_SFTP_TYPE_DIRECTORY) {
1226
-                $filename.= '/.';
1226
+                $filename .= '/.';
1227 1227
             }
1228
-            $this->_update_stat_cache($filename, (object) array('lstat' => $lstat));
1228
+            $this->_update_stat_cache($filename, (object)array('lstat' => $lstat));
1229 1229
             return $lstat;
1230 1230
         }
1231 1231
 
@@ -1233,7 +1233,7 @@  discard block
 block discarded – undo
1233 1233
 
1234 1234
         if ($lstat != $stat) {
1235 1235
             $lstat = array_merge($lstat, array('type' => NET_SFTP_TYPE_SYMLINK));
1236
-            $this->_update_stat_cache($filename, (object) array('lstat' => $lstat));
1236
+            $this->_update_stat_cache($filename, (object)array('lstat' => $lstat));
1237 1237
             return $stat;
1238 1238
         }
1239 1239
 
@@ -1244,9 +1244,9 @@  discard block
 block discarded – undo
1244 1244
         $this->pwd = $pwd;
1245 1245
 
1246 1246
         if ($lstat['type'] == NET_SFTP_TYPE_DIRECTORY) {
1247
-            $filename.= '/.';
1247
+            $filename .= '/.';
1248 1248
         }
1249
-        $this->_update_stat_cache($filename, (object) array('lstat' => $lstat));
1249
+        $this->_update_stat_cache($filename, (object)array('lstat' => $lstat));
1250 1250
 
1251 1251
         return $lstat;
1252 1252
     }
@@ -1827,7 +1827,7 @@  discard block
 block discarded – undo
1827 1827
             $offset = $size !== false ? $size : 0;
1828 1828
         } else {
1829 1829
             $offset = 0;
1830
-            $flags|= NET_SFTP_OPEN_TRUNCATE;
1830
+            $flags |= NET_SFTP_OPEN_TRUNCATE;
1831 1831
         }
1832 1832
 
1833 1833
         $packet = pack('Na*N2', strlen($remote_file), $remote_file, $flags, 0);
@@ -1893,7 +1893,7 @@  discard block
 block discarded – undo
1893 1893
 
1894 1894
         $sftp_packet_size = 4096; // PuTTY uses 4096
1895 1895
         // make the SFTP packet be exactly 4096 bytes by including the bytes in the NET_SFTP_WRITE packets "header"
1896
-        $sftp_packet_size-= strlen($handle) + 25;
1896
+        $sftp_packet_size -= strlen($handle) + 25;
1897 1897
         $i = 0;
1898 1898
         while ($dataCallback || $sent < $size) {
1899 1899
             if ($dataCallback) {
@@ -1912,7 +1912,7 @@  discard block
 block discarded – undo
1912 1912
                 }
1913 1913
                 return false;
1914 1914
             }
1915
-            $sent+= strlen($temp);
1915
+            $sent += strlen($temp);
1916 1916
             if (is_callable($progressCallback)) {
1917 1917
                 call_user_func($progressCallback, $sent);
1918 1918
             }
@@ -2080,9 +2080,9 @@  discard block
 block discarded – undo
2080 2080
             switch ($this->packet_type) {
2081 2081
                 case NET_SFTP_DATA:
2082 2082
                     $temp = substr($response, 4);
2083
-                    $offset+= strlen($temp);
2083
+                    $offset += strlen($temp);
2084 2084
                     if ($local_file === false) {
2085
-                        $content.= $temp;
2085
+                        $content .= $temp;
2086 2086
                     } else {
2087 2087
                         fputs($fp, $temp);
2088 2088
                     }
@@ -2550,20 +2550,20 @@  discard block
 block discarded – undo
2550 2550
                     $attr['size'] = hexdec(bin2hex($this->_string_shift($response, 8)));
2551 2551
                     break;
2552 2552
                 case NET_SFTP_ATTR_UIDGID: // 0x00000002 (SFTPv3 only)
2553
-                    $attr+= unpack('Nuid/Ngid', $this->_string_shift($response, 8));
2553
+                    $attr += unpack('Nuid/Ngid', $this->_string_shift($response, 8));
2554 2554
                     break;
2555 2555
                 case NET_SFTP_ATTR_PERMISSIONS: // 0x00000004
2556
-                    $attr+= unpack('Npermissions', $this->_string_shift($response, 4));
2556
+                    $attr += unpack('Npermissions', $this->_string_shift($response, 4));
2557 2557
                     // mode == permissions; permissions was the original array key and is retained for bc purposes.
2558 2558
                     // mode was added because that's the more industry standard terminology
2559
-                    $attr+= array('mode' => $attr['permissions']);
2559
+                    $attr += array('mode' => $attr['permissions']);
2560 2560
                     $fileType = $this->_parseMode($attr['permissions']);
2561 2561
                     if ($fileType !== false) {
2562
-                        $attr+= array('type' => $fileType);
2562
+                        $attr += array('type' => $fileType);
2563 2563
                     }
2564 2564
                     break;
2565 2565
                 case NET_SFTP_ATTR_ACCESSTIME: // 0x00000008
2566
-                    $attr+= unpack('Natime/Nmtime', $this->_string_shift($response, 8));
2566
+                    $attr += unpack('Natime/Nmtime', $this->_string_shift($response, 8));
2567 2567
                     break;
2568 2568
                 case NET_SFTP_ATTR_EXTENDED: // 0x80000000
2569 2569
                     extract(unpack('Ncount', $this->_string_shift($response, 4)));
@@ -2669,8 +2669,7 @@  discard block
 block discarded – undo
2669 2669
     function _send_sftp_packet($type, $data)
2670 2670
     {
2671 2671
         $packet = $this->request_id !== false ?
2672
-            pack('NCNa*', strlen($data) + 5, $type, $this->request_id, $data) :
2673
-            pack('NCa*',  strlen($data) + 1, $type, $data);
2672
+            pack('NCNa*', strlen($data) + 5, $type, $this->request_id, $data) : pack('NCa*', strlen($data) + 1, $type, $data);
2674 2673
 
2675 2674
         $start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838
2676 2675
         $result = $this->_send_channel_packet(self::CHANNEL, $packet);
@@ -2721,11 +2720,11 @@  discard block
 block discarded – undo
2721 2720
                 $this->packet_buffer = '';
2722 2721
                 return false;
2723 2722
             }
2724
-            $this->packet_buffer.= $temp;
2723
+            $this->packet_buffer .= $temp;
2725 2724
         }
2726 2725
         extract(unpack('Nlength', $this->_string_shift($this->packet_buffer, 4)));
2727 2726
         $tempLength = $length;
2728
-        $tempLength-= strlen($this->packet_buffer);
2727
+        $tempLength -= strlen($this->packet_buffer);
2729 2728
 
2730 2729
         // SFTP packet type and data payload
2731 2730
         while ($tempLength > 0) {
@@ -2735,8 +2734,8 @@  discard block
 block discarded – undo
2735 2734
                 $this->packet_buffer = '';
2736 2735
                 return false;
2737 2736
             }
2738
-            $this->packet_buffer.= $temp;
2739
-            $tempLength-= strlen($temp);
2737
+            $this->packet_buffer .= $temp;
2738
+            $tempLength -= strlen($temp);
2740 2739
         }
2741 2740
 
2742 2741
         $stop = strtok(microtime(), ' ') + strtok('');
@@ -2745,9 +2744,9 @@  discard block
 block discarded – undo
2745 2744
 
2746 2745
         if ($this->request_id !== false) {
2747 2746
             $this->_string_shift($this->packet_buffer, 4); // remove the request id
2748
-            $length-= 5; // account for the request id and the packet type
2747
+            $length -= 5; // account for the request id and the packet type
2749 2748
         } else {
2750
-            $length-= 1; // account for the packet type
2749
+            $length -= 1; // account for the packet type
2751 2750
         }
2752 2751
 
2753 2752
         $packet = $this->_string_shift($this->packet_buffer, $length);
Please login to merge, or discard this patch.
inc/Exts/phpseclib/Net/SSH1.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
             throw new \RuntimeException("Cannot connect to $parts[1] servers");
563 563
         }
564 564
 
565
-        fputs($this->fsock, $this->identifier."\r\n");
565
+        fputs($this->fsock, $this->identifier . "\r\n");
566 566
 
567 567
         $response = $this->_get_binary_packet();
568 568
         if ($response[self::RESPONSE_TYPE] != NET_SSH1_SMSG_PUBLIC_KEY) {
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
                 $this->crypto = new DES();
662 662
                 $this->crypto->disablePadding();
663 663
                 $this->crypto->enableContinuousBuffer();
664
-                $this->crypto->setKey(substr($session_key, 0,  8));
664
+                $this->crypto->setKey(substr($session_key, 0, 8));
665 665
                 break;
666 666
             case self::CIPHER_3DES:
667 667
                 $this->crypto = new TripleDES(TripleDES::MODE_3CBC);
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
 
811 811
         if ($response !== false) {
812 812
             do {
813
-                $output.= substr($response[self::RESPONSE_DATA], 4);
813
+                $output .= substr($response[self::RESPONSE_DATA], 4);
814 814
                 $response = $this->_get_binary_packet();
815 815
             } while (is_array($response) && $response[self::RESPONSE_TYPE] != NET_SSH1_SMSG_EXITSTATUS);
816 816
         }
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
             if ($response === true) {
923 923
                 return $this->_string_shift($this->interactiveBuffer, strlen($this->interactiveBuffer));
924 924
             }
925
-            $this->interactiveBuffer.= substr($response[self::RESPONSE_DATA], 4);
925
+            $this->interactiveBuffer .= substr($response[self::RESPONSE_DATA], 4);
926 926
         }
927 927
     }
928 928
 
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
                 return true;
1076 1076
             }
1077 1077
             $elapsed = strtok(microtime(), ' ') + strtok('') - $start;
1078
-            $this->curTimeout-= $elapsed;
1078
+            $this->curTimeout -= $elapsed;
1079 1079
         }
1080 1080
 
1081 1081
         $start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838
@@ -1087,8 +1087,8 @@  discard block
 block discarded – undo
1087 1087
 
1088 1088
         while ($length > 0) {
1089 1089
             $temp = fread($this->fsock, $length);
1090
-            $raw.= $temp;
1091
-            $length-= strlen($temp);
1090
+            $raw .= $temp;
1091
+            $length -= strlen($temp);
1092 1092
         }
1093 1093
         $stop = strtok(microtime(), ' ') + strtok('');
1094 1094
 
@@ -1145,7 +1145,7 @@  discard block
 block discarded – undo
1145 1145
 
1146 1146
         $orig = $data;
1147 1147
         $data = $padding . $data;
1148
-        $data.= pack('N', $this->_crc($data));
1148
+        $data .= pack('N', $this->_crc($data));
1149 1149
 
1150 1150
         if ($this->crypto !== false) {
1151 1151
             $data = $this->crypto->encrypt($data);
@@ -1254,7 +1254,7 @@  discard block
 block discarded – undo
1254 1254
         $crc = 0x00000000;
1255 1255
         $length = strlen($data);
1256 1256
 
1257
-        for ($i=0; $i<$length; $i++) {
1257
+        for ($i = 0; $i < $length; $i++) {
1258 1258
             // We AND $crc >> 8 with 0x00FFFFFF because we want the eight newly added bits to all
1259 1259
             // be zero.  PHP, unfortunately, doesn't always do this.  0x80000000 >> 8, as an example,
1260 1260
             // yields 0xFF800000 - not 0x00800000.  The following link elaborates:
@@ -1325,7 +1325,7 @@  discard block
 block discarded – undo
1325 1325
         while (strlen($random) != $length) {
1326 1326
             $block = Random::string($length - strlen($random));
1327 1327
             $block = str_replace("\x00", '', $block);
1328
-            $random.= $block;
1328
+            $random .= $block;
1329 1329
         }
1330 1330
         $temp = chr(0) . chr(2) . $random . chr(0) . $m;
1331 1331
 
@@ -1397,12 +1397,12 @@  discard block
 block discarded – undo
1397 1397
     {
1398 1398
         $output = '';
1399 1399
         for ($i = 0; $i < count($message_log); $i++) {
1400
-            $output.= $message_number_log[$i] . "\r\n";
1400
+            $output .= $message_number_log[$i] . "\r\n";
1401 1401
             $current_log = $message_log[$i];
1402 1402
             $j = 0;
1403 1403
             do {
1404 1404
                 if (strlen($current_log)) {
1405
-                    $output.= str_pad(dechex($j), 7, '0', STR_PAD_LEFT) . '0  ';
1405
+                    $output .= str_pad(dechex($j), 7, '0', STR_PAD_LEFT) . '0  ';
1406 1406
                 }
1407 1407
                 $fragment = $this->_string_shift($current_log, $this->log_short_width);
1408 1408
                 $hex = substr(preg_replace_callback('#.#s', array($this, '_format_log_helper'), $fragment), strlen($this->log_boundary));
@@ -1410,10 +1410,10 @@  discard block
 block discarded – undo
1410 1410
                 // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
1411 1411
                 // also replace < with a . since < messes up the output on web browsers
1412 1412
                 $raw = preg_replace('#[^\x20-\x7E]|<#', '.', $fragment);
1413
-                $output.= str_pad($hex, $this->log_long_width - $this->log_short_width, ' ') . $raw . "\r\n";
1413
+                $output .= str_pad($hex, $this->log_long_width - $this->log_short_width, ' ') . $raw . "\r\n";
1414 1414
                 $j++;
1415 1415
             } while (strlen($current_log));
1416
-            $output.= "\r\n";
1416
+            $output .= "\r\n";
1417 1417
         }
1418 1418
 
1419 1419
         return $output;
@@ -1555,10 +1555,10 @@  discard block
 block discarded – undo
1555 1555
             case self::LOG_COMPLEX:
1556 1556
                 $this->protocol_flags_log[] = $protocol_flags;
1557 1557
                 $this->_string_shift($message);
1558
-                $this->log_size+= strlen($message);
1558
+                $this->log_size += strlen($message);
1559 1559
                 $this->message_log[] = $message;
1560 1560
                 while ($this->log_size > self::LOG_MAX_SIZE) {
1561
-                    $this->log_size-= strlen(array_shift($this->message_log));
1561
+                    $this->log_size -= strlen(array_shift($this->message_log));
1562 1562
                     array_shift($this->protocol_flags_log);
1563 1563
                 }
1564 1564
                 break;
@@ -1587,10 +1587,10 @@  discard block
 block discarded – undo
1587 1587
                 $entry = $this->_format_log(array($message), array($protocol_flags));
1588 1588
                 if ($this->realtime_log_wrap) {
1589 1589
                     $temp = "<<< START >>>\r\n";
1590
-                    $entry.= $temp;
1590
+                    $entry .= $temp;
1591 1591
                     fseek($this->realtime_log_file, ftell($this->realtime_log_file) - strlen($temp));
1592 1592
                 }
1593
-                $this->realtime_log_size+= strlen($entry);
1593
+                $this->realtime_log_size += strlen($entry);
1594 1594
                 if ($this->realtime_log_size > self::LOG_MAX_SIZE) {
1595 1595
                     fseek($this->realtime_log_file, 0);
1596 1596
                     $this->realtime_log_size = strlen($entry);
Please login to merge, or discard this patch.
inc/Exts/phpseclib/Net/SFTP/Stream.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -202,8 +202,8 @@  discard block
 block discarded – undo
202 202
             }
203 203
 
204 204
             // casting $pass to a string is necessary in the event that it's a \phpseclib\Crypt\RSA object
205
-            if (isset(self::$instances[$host][$port][$user][(string) $pass])) {
206
-                $this->sftp = self::$instances[$host][$port][$user][(string) $pass];
205
+            if (isset(self::$instances[$host][$port][$user][(string)$pass])) {
206
+                $this->sftp = self::$instances[$host][$port][$user][(string)$pass];
207 207
             } else {
208 208
                 $this->sftp = new SFTP($host, $port);
209 209
                 $this->sftp->disableStatCache();
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
                         return false;
230 230
                     }
231 231
                 }
232
-                self::$instances[$host][$port][$user][(string) $pass] = $this->sftp;
232
+                self::$instances[$host][$port][$user][(string)$pass] = $this->sftp;
233 233
             }
234 234
         }
235 235
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
             $this->eof = true;
319 319
             return false;
320 320
         }
321
-        $this->pos+= strlen($result);
321
+        $this->pos += strlen($result);
322 322
 
323 323
         return $result;
324 324
     }
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
         if ($result === false) {
351 351
             return false;
352 352
         }
353
-        $this->pos+= strlen($data);
353
+        $this->pos += strlen($data);
354 354
         if ($this->pos > $this->size) {
355 355
             $this->size = $this->pos;
356 356
         }
@@ -404,10 +404,10 @@  discard block
 block discarded – undo
404 404
                 }
405 405
                 break;
406 406
             case SEEK_CUR:
407
-                $offset+= $this->pos;
407
+                $offset += $this->pos;
408 408
                 break;
409 409
             case SEEK_END:
410
-                $offset+= $this->size;
410
+                $offset += $this->size;
411 411
         }
412 412
 
413 413
         $this->pos = $offset;
Please login to merge, or discard this patch.
inc/Exts/phpseclib/Net/SSH2.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -956,16 +956,16 @@  discard block
 block discarded – undo
956 956
             array(60 => 'NET_SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ'),
957 957
             array(60 => 'NET_SSH2_MSG_USERAUTH_PK_OK'),
958 958
             array(60 => 'NET_SSH2_MSG_USERAUTH_INFO_REQUEST',
959
-                  61 => 'NET_SSH2_MSG_USERAUTH_INFO_RESPONSE'),
959
+                    61 => 'NET_SSH2_MSG_USERAUTH_INFO_RESPONSE'),
960 960
             // RFC 4419 - diffie-hellman-group-exchange-sha{1,256}
961 961
             array(30 => 'NET_SSH2_MSG_KEXDH_GEX_REQUEST_OLD',
962
-                  31 => 'NET_SSH2_MSG_KEXDH_GEX_GROUP',
963
-                  32 => 'NET_SSH2_MSG_KEXDH_GEX_INIT',
964
-                  33 => 'NET_SSH2_MSG_KEXDH_GEX_REPLY',
965
-                  34 => 'NET_SSH2_MSG_KEXDH_GEX_REQUEST'),
962
+                    31 => 'NET_SSH2_MSG_KEXDH_GEX_GROUP',
963
+                    32 => 'NET_SSH2_MSG_KEXDH_GEX_INIT',
964
+                    33 => 'NET_SSH2_MSG_KEXDH_GEX_REPLY',
965
+                    34 => 'NET_SSH2_MSG_KEXDH_GEX_REQUEST'),
966 966
             // RFC 5656 - Elliptic Curves (for [email protected])
967 967
             array(30 => 'NET_SSH2_MSG_KEX_ECDH_INIT',
968
-                  31 => 'NET_SSH2_MSG_KEX_ECDH_REPLY')
968
+                    31 => 'NET_SSH2_MSG_KEX_ECDH_REPLY')
969 969
         );
970 970
 
971 971
         self::$connections[$this->getResourceId()] = $this;
@@ -1207,7 +1207,7 @@  discard block
 block discarded – undo
1207 1207
             'twofish192-cbc', // OPTIONAL          Twofish with a 192-bit key
1208 1208
             'twofish256-cbc',
1209 1209
             'twofish-cbc',    // OPTIONAL          alias for "twofish256-cbc"
1210
-                              //                   (this is being retained for historical reasons)
1210
+                                //                   (this is being retained for historical reasons)
1211 1211
 
1212 1212
             'blowfish-ctr',   // OPTIONAL          Blowfish in SDCTR mode
1213 1213
 
@@ -2946,7 +2946,7 @@  discard block
 block discarded – undo
2946 2946
             $current = microtime(true);
2947 2947
             $message_number = isset($this->message_numbers[ord($payload[0])]) ? $this->message_numbers[ord($payload[0])] : 'UNKNOWN (' . ord($payload[0]) . ')';
2948 2948
             $message_number = '<- ' . $message_number .
2949
-                              ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)';
2949
+                                ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)';
2950 2950
             $this->_append_log($message_number, $payload);
2951 2951
             $this->last_packet = $current;
2952 2952
         }
@@ -3421,7 +3421,7 @@  discard block
 block discarded – undo
3421 3421
             $current = microtime(true);
3422 3422
             $message_number = isset($this->message_numbers[ord($data[0])]) ? $this->message_numbers[ord($data[0])] : 'UNKNOWN (' . ord($data[0]) . ')';
3423 3423
             $message_number = '-> ' . $message_number .
3424
-                              ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)';
3424
+                                ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)';
3425 3425
             $this->_append_log($message_number, isset($logged) ? $logged : $data);
3426 3426
             $this->last_packet = $current;
3427 3427
         }
Please login to merge, or discard this patch.
Spacing   +59 added lines, -60 removed lines patch added patch discarded remove patch
@@ -1025,7 +1025,7 @@  discard block
 block discarded – undo
1025 1025
             }
1026 1026
             $elapsed = microtime(true) - $start;
1027 1027
 
1028
-            $this->curTimeout-= $elapsed;
1028
+            $this->curTimeout -= $elapsed;
1029 1029
 
1030 1030
             if ($this->curTimeout <= 0) {
1031 1031
                 $this->is_timeout = true;
@@ -1044,7 +1044,7 @@  discard block
 block discarded – undo
1044 1044
         $extra = '';
1045 1045
         while (!feof($this->fsock) && !preg_match('#^SSH-(\d\.\d+)#', $temp, $matches)) {
1046 1046
             if (substr($temp, -2) == "\r\n") {
1047
-                $extra.= $temp;
1047
+                $extra .= $temp;
1048 1048
                 $temp = '';
1049 1049
             }
1050 1050
 
@@ -1065,10 +1065,10 @@  discard block
 block discarded – undo
1065 1065
                     return false;
1066 1066
                 }
1067 1067
                 $elapsed = microtime(true) - $start;
1068
-                $this->curTimeout-= $elapsed;
1068
+                $this->curTimeout -= $elapsed;
1069 1069
             }
1070 1070
 
1071
-            $temp.= fgets($this->fsock, 255);
1071
+            $temp .= fgets($this->fsock, 255);
1072 1072
         }
1073 1073
 
1074 1074
         if (feof($this->fsock)) {
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
             return false;
1107 1107
         }
1108 1108
 
1109
-        $this->bitmap|= self::MASK_CONNECTED;
1109
+        $this->bitmap |= self::MASK_CONNECTED;
1110 1110
 
1111 1111
         return true;
1112 1112
     }
@@ -1191,31 +1191,31 @@  discard block
 block discarded – undo
1191 1191
             //'arcfour',      // OPTIONAL          the ARCFOUR stream cipher with a 128-bit key
1192 1192
 
1193 1193
             // CTR modes from <http://tools.ietf.org/html/rfc4344#section-4>:
1194
-            'aes128-ctr',     // RECOMMENDED       AES (Rijndael) in SDCTR mode, with 128-bit key
1195
-            'aes192-ctr',     // RECOMMENDED       AES with 192-bit key
1196
-            'aes256-ctr',     // RECOMMENDED       AES with 256-bit key
1194
+            'aes128-ctr', // RECOMMENDED       AES (Rijndael) in SDCTR mode, with 128-bit key
1195
+            'aes192-ctr', // RECOMMENDED       AES with 192-bit key
1196
+            'aes256-ctr', // RECOMMENDED       AES with 256-bit key
1197 1197
 
1198 1198
             'twofish128-ctr', // OPTIONAL          Twofish in SDCTR mode, with 128-bit key
1199 1199
             'twofish192-ctr', // OPTIONAL          Twofish with 192-bit key
1200 1200
             'twofish256-ctr', // OPTIONAL          Twofish with 256-bit key
1201 1201
 
1202
-            'aes128-cbc',     // RECOMMENDED       AES with a 128-bit key
1203
-            'aes192-cbc',     // OPTIONAL          AES with a 192-bit key
1204
-            'aes256-cbc',     // OPTIONAL          AES in CBC mode, with a 256-bit key
1202
+            'aes128-cbc', // RECOMMENDED       AES with a 128-bit key
1203
+            'aes192-cbc', // OPTIONAL          AES with a 192-bit key
1204
+            'aes256-cbc', // OPTIONAL          AES in CBC mode, with a 256-bit key
1205 1205
 
1206 1206
             'twofish128-cbc', // OPTIONAL          Twofish with a 128-bit key
1207 1207
             'twofish192-cbc', // OPTIONAL          Twofish with a 192-bit key
1208 1208
             'twofish256-cbc',
1209
-            'twofish-cbc',    // OPTIONAL          alias for "twofish256-cbc"
1209
+            'twofish-cbc', // OPTIONAL          alias for "twofish256-cbc"
1210 1210
                               //                   (this is being retained for historical reasons)
1211 1211
 
1212
-            'blowfish-ctr',   // OPTIONAL          Blowfish in SDCTR mode
1212
+            'blowfish-ctr', // OPTIONAL          Blowfish in SDCTR mode
1213 1213
 
1214
-            'blowfish-cbc',   // OPTIONAL          Blowfish in CBC mode
1214
+            'blowfish-cbc', // OPTIONAL          Blowfish in CBC mode
1215 1215
 
1216
-            '3des-ctr',       // RECOMMENDED       Three-key 3DES in SDCTR mode
1216
+            '3des-ctr', // RECOMMENDED       Three-key 3DES in SDCTR mode
1217 1217
 
1218
-            '3des-cbc',       // REQUIRED          three-key 3DES in CBC mode
1218
+            '3des-cbc', // REQUIRED          three-key 3DES in CBC mode
1219 1219
                 //'none'         // OPTIONAL          no encryption; NOT RECOMMENDED
1220 1220
         );
1221 1221
 
@@ -1262,12 +1262,12 @@  discard block
 block discarded – undo
1262 1262
 
1263 1263
         $mac_algorithms = array(
1264 1264
             // from <http://www.ietf.org/rfc/rfc6668.txt>:
1265
-            'hmac-sha2-256',// RECOMMENDED     HMAC-SHA256 (digest length = key length = 32)
1265
+            'hmac-sha2-256', // RECOMMENDED     HMAC-SHA256 (digest length = key length = 32)
1266 1266
 
1267 1267
             'hmac-sha1-96', // RECOMMENDED     first 96 bits of HMAC-SHA1 (digest length = 12, key length = 20)
1268
-            'hmac-sha1',    // REQUIRED        HMAC-SHA1 (digest length = key length = 20)
1269
-            'hmac-md5-96',  // OPTIONAL        first 96 bits of HMAC-MD5 (digest length = 12, key length = 16)
1270
-            'hmac-md5',     // OPTIONAL        HMAC-MD5 (digest length = key length = 16)
1268
+            'hmac-sha1', // REQUIRED        HMAC-SHA1 (digest length = key length = 20)
1269
+            'hmac-md5-96', // OPTIONAL        first 96 bits of HMAC-MD5 (digest length = 12, key length = 16)
1270
+            'hmac-md5', // OPTIONAL        HMAC-MD5 (digest length = key length = 16)
1271 1271
             //'none'          // OPTIONAL        no MAC; NOT RECOMMENDED
1272 1272
         );
1273 1273
 
@@ -1618,13 +1618,13 @@  discard block
 block discarded – undo
1618 1618
 
1619 1619
             $iv = $kexHash->hash($keyBytes . $this->exchange_hash . 'A' . $this->session_id);
1620 1620
             while ($this->encrypt_block_size > strlen($iv)) {
1621
-                $iv.= $kexHash->hash($keyBytes . $this->exchange_hash . $iv);
1621
+                $iv .= $kexHash->hash($keyBytes . $this->exchange_hash . $iv);
1622 1622
             }
1623 1623
             $this->encrypt->setIV(substr($iv, 0, $this->encrypt_block_size));
1624 1624
 
1625 1625
             $key = $kexHash->hash($keyBytes . $this->exchange_hash . 'C' . $this->session_id);
1626 1626
             while ($encryptKeyLength > strlen($key)) {
1627
-                $key.= $kexHash->hash($keyBytes . $this->exchange_hash . $key);
1627
+                $key .= $kexHash->hash($keyBytes . $this->exchange_hash . $key);
1628 1628
             }
1629 1629
             $this->encrypt->setKey(substr($key, 0, $encryptKeyLength));
1630 1630
         }
@@ -1642,13 +1642,13 @@  discard block
 block discarded – undo
1642 1642
 
1643 1643
             $iv = $kexHash->hash($keyBytes . $this->exchange_hash . 'B' . $this->session_id);
1644 1644
             while ($this->decrypt_block_size > strlen($iv)) {
1645
-                $iv.= $kexHash->hash($keyBytes . $this->exchange_hash . $iv);
1645
+                $iv .= $kexHash->hash($keyBytes . $this->exchange_hash . $iv);
1646 1646
             }
1647 1647
             $this->decrypt->setIV(substr($iv, 0, $this->decrypt_block_size));
1648 1648
 
1649 1649
             $key = $kexHash->hash($keyBytes . $this->exchange_hash . 'D' . $this->session_id);
1650 1650
             while ($decryptKeyLength > strlen($key)) {
1651
-                $key.= $kexHash->hash($keyBytes . $this->exchange_hash . $key);
1651
+                $key .= $kexHash->hash($keyBytes . $this->exchange_hash . $key);
1652 1652
             }
1653 1653
             $this->decrypt->setKey(substr($key, 0, $decryptKeyLength));
1654 1654
         }
@@ -1733,13 +1733,13 @@  discard block
 block discarded – undo
1733 1733
 
1734 1734
         $key = $kexHash->hash($keyBytes . $this->exchange_hash . 'E' . $this->session_id);
1735 1735
         while ($createKeyLength > strlen($key)) {
1736
-            $key.= $kexHash->hash($keyBytes . $this->exchange_hash . $key);
1736
+            $key .= $kexHash->hash($keyBytes . $this->exchange_hash . $key);
1737 1737
         }
1738 1738
         $this->hmac_create->setKey(substr($key, 0, $createKeyLength));
1739 1739
 
1740 1740
         $key = $kexHash->hash($keyBytes . $this->exchange_hash . 'F' . $this->session_id);
1741 1741
         while ($checkKeyLength > strlen($key)) {
1742
-            $key.= $kexHash->hash($keyBytes . $this->exchange_hash . $key);
1742
+            $key .= $kexHash->hash($keyBytes . $this->exchange_hash . $key);
1743 1743
         }
1744 1744
         $this->hmac_check->setKey(substr($key, 0, $checkKeyLength));
1745 1745
 
@@ -2177,8 +2177,8 @@  discard block
 block discarded – undo
2177 2177
                 // see http://tools.ietf.org/html/rfc4256#section-3.4
2178 2178
                 $packet = $logged = pack('CN', NET_SSH2_MSG_USERAUTH_INFO_RESPONSE, count($responses));
2179 2179
                 for ($i = 0; $i < count($responses); $i++) {
2180
-                    $packet.= pack('Na*', strlen($responses[$i]), $responses[$i]);
2181
-                    $logged.= pack('Na*', strlen('dummy-answer'), 'dummy-answer');
2180
+                    $packet .= pack('Na*', strlen($responses[$i]), $responses[$i]);
2181
+                    $logged .= pack('Na*', strlen('dummy-answer'), 'dummy-answer');
2182 2182
                 }
2183 2183
 
2184 2184
                 if (!$this->_send_binary_packet($packet, $logged)) {
@@ -2309,7 +2309,7 @@  discard block
 block discarded – undo
2309 2309
         $privatekey->setSignatureMode(RSA::SIGNATURE_PKCS1);
2310 2310
         $signature = $privatekey->sign(pack('Na*a*', strlen($this->session_id), $this->session_id, $packet));
2311 2311
         $signature = pack('Na*Na*', strlen('ssh-rsa'), 'ssh-rsa', strlen($signature), $signature);
2312
-        $packet.= pack('Na*', strlen($signature), $signature);
2312
+        $packet .= pack('Na*', strlen($signature), $signature);
2313 2313
 
2314 2314
         if (!$this->_send_binary_packet($packet)) {
2315 2315
             return false;
@@ -2502,7 +2502,7 @@  discard block
 block discarded – undo
2502 2502
                             return true;
2503 2503
                         }
2504 2504
                     } else {
2505
-                        $output.= $temp;
2505
+                        $output .= $temp;
2506 2506
                     }
2507 2507
             }
2508 2508
         }
@@ -2695,7 +2695,7 @@  discard block
 block discarded – undo
2695 2695
                 return $response ? $this->_string_shift($this->interactiveBuffer, strlen($this->interactiveBuffer)) : false;
2696 2696
             }
2697 2697
 
2698
-            $this->interactiveBuffer.= $response;
2698
+            $this->interactiveBuffer .= $response;
2699 2699
         }
2700 2700
     }
2701 2701
 
@@ -2863,7 +2863,7 @@  discard block
 block discarded – undo
2863 2863
      */
2864 2864
     function isConnected()
2865 2865
     {
2866
-        return (bool) ($this->bitmap & self::MASK_CONNECTED);
2866
+        return (bool)($this->bitmap & self::MASK_CONNECTED);
2867 2867
     }
2868 2868
 
2869 2869
     /**
@@ -2915,12 +2915,12 @@  discard block
 block discarded – undo
2915 2915
                 $this->bitmap = 0;
2916 2916
                 throw new \RuntimeException('Error reading from socket');
2917 2917
             }
2918
-            $buffer.= $temp;
2919
-            $remaining_length-= strlen($temp);
2918
+            $buffer .= $temp;
2919
+            $remaining_length -= strlen($temp);
2920 2920
         }
2921 2921
         $stop = microtime(true);
2922 2922
         if (strlen($buffer)) {
2923
-            $raw.= $this->decrypt !== false ? $this->decrypt->decrypt($buffer) : $buffer;
2923
+            $raw .= $this->decrypt !== false ? $this->decrypt->decrypt($buffer) : $buffer;
2924 2924
         }
2925 2925
 
2926 2926
         $payload = $this->_string_shift($raw, $packet_length - $padding_length - 1);
@@ -3072,7 +3072,7 @@  discard block
 block discarded – undo
3072 3072
                     $this->_string_shift($payload, 1);
3073 3073
                     extract(unpack('Nchannel', $this->_string_shift($payload, 4)));
3074 3074
                     extract(unpack('Nwindow_size', $this->_string_shift($payload, 4)));
3075
-                    $this->window_size_client_to_server[$channel]+= $window_size;
3075
+                    $this->window_size_client_to_server[$channel] += $window_size;
3076 3076
 
3077 3077
                     $payload = ($this->bitmap & self::MASK_WINDOW_ADJUST) ? true : $this->_get_binary_packet();
3078 3078
             }
@@ -3188,7 +3188,7 @@  discard block
 block discarded – undo
3188 3188
                     return true;
3189 3189
                 }
3190 3190
                 $elapsed = microtime(true) - $start;
3191
-                $this->curTimeout-= $elapsed;
3191
+                $this->curTimeout -= $elapsed;
3192 3192
             }
3193 3193
 
3194 3194
             $response = $this->_get_binary_packet();
@@ -3212,7 +3212,7 @@  discard block
 block discarded – undo
3212 3212
 
3213 3213
             // will not be setup yet on incoming channel open request
3214 3214
             if (isset($channel) && isset($this->channel_status[$channel]) && isset($this->window_size_server_to_client[$channel])) {
3215
-                $this->window_size_server_to_client[$channel]-= strlen($response);
3215
+                $this->window_size_server_to_client[$channel] -= strlen($response);
3216 3216
 
3217 3217
                 // resize the window, if appropriate
3218 3218
                 if ($this->window_size_server_to_client[$channel] < 0) {
@@ -3220,7 +3220,7 @@  discard block
 block discarded – undo
3220 3220
                     if (!$this->_send_binary_packet($packet)) {
3221 3221
                         return false;
3222 3222
                     }
3223
-                    $this->window_size_server_to_client[$channel]+= $this->window_size;
3223
+                    $this->window_size_server_to_client[$channel] += $this->window_size;
3224 3224
                 }
3225 3225
 
3226 3226
                 switch ($this->channel_status[$channel]) {
@@ -3231,8 +3231,8 @@  discard block
 block discarded – undo
3231 3231
                                 $this->server_channels[$channel] = $server_channel;
3232 3232
                                 extract(unpack('Nwindow_size', $this->_string_shift($response, 4)));
3233 3233
                                 if ($window_size < 0) {
3234
-                                    $window_size&= 0x7FFFFFFF;
3235
-                                    $window_size+= 0x80000000;
3234
+                                    $window_size &= 0x7FFFFFFF;
3235
+                                    $window_size += 0x80000000;
3236 3236
                                 }
3237 3237
                                 $this->window_size_client_to_server[$channel] = $window_size;
3238 3238
                                 $temp = unpack('Npacket_size_client_to_server', $this->_string_shift($response, 4));
@@ -3302,7 +3302,7 @@  discard block
 block discarded – undo
3302 3302
                     // currently, there's only one possible value for $data_type_code: NET_SSH2_EXTENDED_DATA_STDERR
3303 3303
                     extract(unpack('Ndata_type_code/Nlength', $this->_string_shift($response, 8)));
3304 3304
                     $data = $this->_string_shift($response, $length);
3305
-                    $this->stdErrorLog.= $data;
3305
+                    $this->stdErrorLog .= $data;
3306 3306
                     if ($skip_extended || $this->quiet_mode) {
3307 3307
                         break;
3308 3308
                     }
@@ -3325,7 +3325,7 @@  discard block
 block discarded – undo
3325 3325
                             $this->_string_shift($response, 1);
3326 3326
                             extract(unpack('Nlength', $this->_string_shift($response, 4)));
3327 3327
                             if ($length) {
3328
-                                $this->errors[count($this->errors)].= "\r\n" . $this->_string_shift($response, $length);
3328
+                                $this->errors[count($this->errors)] .= "\r\n" . $this->_string_shift($response, $length);
3329 3329
                             }
3330 3330
 
3331 3331
                             $this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_EOF, $this->server_channels[$client_channel]));
@@ -3352,7 +3352,7 @@  discard block
 block discarded – undo
3352 3352
                     $this->curTimeout = 0;
3353 3353
 
3354 3354
                     if ($this->bitmap & self::MASK_SHELL) {
3355
-                        $this->bitmap&= ~self::MASK_SHELL;
3355
+                        $this->bitmap &= ~self::MASK_SHELL;
3356 3356
                     }
3357 3357
                     if ($this->channel_status[$channel] != NET_SSH2_MSG_CHANNEL_EOF) {
3358 3358
                         $this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$channel]));
@@ -3396,7 +3396,7 @@  discard block
 block discarded – undo
3396 3396
         // 4 (packet length) + 1 (padding length) + 4 (minimal padding amount) == 9
3397 3397
         $packet_length = strlen($data) + 9;
3398 3398
         // round up to the nearest $this->encrypt_block_size
3399
-        $packet_length+= (($this->encrypt_block_size - 1) * $packet_length) % $this->encrypt_block_size;
3399
+        $packet_length += (($this->encrypt_block_size - 1) * $packet_length) % $this->encrypt_block_size;
3400 3400
         // subtracting strlen($data) is obvious - subtracting 5 is necessary because of packet_length and padding_length
3401 3401
         $padding_length = $packet_length - strlen($data) - 5;
3402 3402
         $padding = Random::string($padding_length);
@@ -3411,7 +3411,7 @@  discard block
 block discarded – undo
3411 3411
             $packet = $this->encrypt->encrypt($packet);
3412 3412
         }
3413 3413
 
3414
-        $packet.= $hmac;
3414
+        $packet .= $hmac;
3415 3415
 
3416 3416
         $start = microtime(true);
3417 3417
         $result = strlen($packet) == fputs($this->fsock, $packet);
@@ -3452,10 +3452,10 @@  discard block
 block discarded – undo
3452 3452
             // the most useful log for SSH2
3453 3453
             case self::LOG_COMPLEX:
3454 3454
                 $this->message_number_log[] = $message_number;
3455
-                $this->log_size+= strlen($message);
3455
+                $this->log_size += strlen($message);
3456 3456
                 $this->message_log[] = $message;
3457 3457
                 while ($this->log_size > self::LOG_MAX_SIZE) {
3458
-                    $this->log_size-= strlen(array_shift($this->message_log));
3458
+                    $this->log_size -= strlen(array_shift($this->message_log));
3459 3459
                     array_shift($this->message_number_log);
3460 3460
                 }
3461 3461
                 break;
@@ -3492,10 +3492,10 @@  discard block
 block discarded – undo
3492 3492
                 $entry = $this->_format_log(array($message), array($message_number));
3493 3493
                 if ($this->realtime_log_wrap) {
3494 3494
                     $temp = "<<< START >>>\r\n";
3495
-                    $entry.= $temp;
3495
+                    $entry .= $temp;
3496 3496
                     fseek($this->realtime_log_file, ftell($this->realtime_log_file) - strlen($temp));
3497 3497
                 }
3498
-                $this->realtime_log_size+= strlen($entry);
3498
+                $this->realtime_log_size += strlen($entry);
3499 3499
                 if ($this->realtime_log_size > self::LOG_MAX_SIZE) {
3500 3500
                     fseek($this->realtime_log_file, 0);
3501 3501
                     $this->realtime_log_size = strlen($entry);
@@ -3519,10 +3519,10 @@  discard block
 block discarded – undo
3519 3519
     {
3520 3520
         while (strlen($data)) {
3521 3521
             if (!$this->window_size_client_to_server[$client_channel]) {
3522
-                $this->bitmap^= self::MASK_WINDOW_ADJUST;
3522
+                $this->bitmap ^= self::MASK_WINDOW_ADJUST;
3523 3523
                 // using an invalid channel will let the buffers be built up for the valid channels
3524 3524
                 $this->_get_channel_packet(-1);
3525
-                $this->bitmap^= self::MASK_WINDOW_ADJUST;
3525
+                $this->bitmap ^= self::MASK_WINDOW_ADJUST;
3526 3526
             }
3527 3527
 
3528 3528
             /* The maximum amount of data allowed is determined by the maximum
@@ -3542,7 +3542,7 @@  discard block
 block discarded – undo
3542 3542
                 strlen($temp),
3543 3543
                 $temp
3544 3544
             );
3545
-            $this->window_size_client_to_server[$client_channel]-= strlen($temp);
3545
+            $this->window_size_client_to_server[$client_channel] -= strlen($temp);
3546 3546
             if (!$this->_send_binary_packet($packet)) {
3547 3547
                 return false;
3548 3548
             }
@@ -3585,7 +3585,7 @@  discard block
 block discarded – undo
3585 3585
         }
3586 3586
 
3587 3587
         if ($this->bitmap & self::MASK_SHELL) {
3588
-            $this->bitmap&= ~self::MASK_SHELL;
3588
+            $this->bitmap &= ~self::MASK_SHELL;
3589 3589
         }
3590 3590
     }
3591 3591
 
@@ -3686,12 +3686,12 @@  discard block
 block discarded – undo
3686 3686
     {
3687 3687
         $output = '';
3688 3688
         for ($i = 0; $i < count($message_log); $i++) {
3689
-            $output.= $message_number_log[$i] . "\r\n";
3689
+            $output .= $message_number_log[$i] . "\r\n";
3690 3690
             $current_log = $message_log[$i];
3691 3691
             $j = 0;
3692 3692
             do {
3693 3693
                 if (strlen($current_log)) {
3694
-                    $output.= str_pad(dechex($j), 7, '0', STR_PAD_LEFT) . '0  ';
3694
+                    $output .= str_pad(dechex($j), 7, '0', STR_PAD_LEFT) . '0  ';
3695 3695
                 }
3696 3696
                 $fragment = $this->_string_shift($current_log, $this->log_short_width);
3697 3697
                 $hex = substr(preg_replace_callback('#.#s', array($this, '_format_log_helper'), $fragment), strlen($this->log_boundary));
@@ -3699,10 +3699,10 @@  discard block
 block discarded – undo
3699 3699
                 // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
3700 3700
                 // also replace < with a . since < messes up the output on web browsers
3701 3701
                 $raw = preg_replace('#[^\x20-\x7E]|<#', '.', $fragment);
3702
-                $output.= str_pad($hex, $this->log_long_width - $this->log_short_width, ' ') . $raw . "\r\n";
3702
+                $output .= str_pad($hex, $this->log_long_width - $this->log_short_width, ' ') . $raw . "\r\n";
3703 3703
                 $j++;
3704 3704
             } while (strlen($current_log));
3705
-            $output.= "\r\n";
3705
+            $output .= "\r\n";
3706 3706
         }
3707 3707
 
3708 3708
         return $output;
@@ -3963,8 +3963,7 @@  discard block
 block discarded – undo
3963 3963
 
3964 3964
         if ($this->signature_validated) {
3965 3965
             return $this->bitmap ?
3966
-                $this->signature_format . ' ' . base64_encode($this->server_public_host_key) :
3967
-                false;
3966
+                $this->signature_format . ' ' . base64_encode($this->server_public_host_key) : false;
3968 3967
         }
3969 3968
 
3970 3969
         $this->signature_validated = true;
Please login to merge, or discard this patch.
inc/Exts/phpseclib/File/X509.php 2 patches
Indentation   +254 added lines, -254 removed lines patch added patch discarded remove patch
@@ -386,10 +386,10 @@  discard block
 block discarded – undo
386 386
             'children' => array(
387 387
                 'extnId'   => array('type' => ASN1::TYPE_OBJECT_IDENTIFIER),
388 388
                 'critical' => array(
389
-                                  'type'     => ASN1::TYPE_BOOLEAN,
390
-                                  'optional' => true,
391
-                                  'default'  => false
392
-                              ),
389
+                                    'type'     => ASN1::TYPE_BOOLEAN,
390
+                                    'optional' => true,
391
+                                    'default'  => false
392
+                                ),
393 393
                 'extnValue' => array('type' => ASN1::TYPE_OCTET_STRING)
394 394
             )
395 395
         );
@@ -444,11 +444,11 @@  discard block
 block discarded – undo
444 444
                 // technically, default implies optional, but we'll define it as being optional, none-the-less, just to
445 445
                 // reenforce that fact
446 446
                 'version'             => array(
447
-                                             'constant' => 0,
448
-                                             'optional' => true,
449
-                                             'explicit' => true,
450
-                                             'default'  => 'v1'
451
-                                         ) + $Version,
447
+                                                'constant' => 0,
448
+                                                'optional' => true,
449
+                                                'explicit' => true,
450
+                                                'default'  => 'v1'
451
+                                            ) + $Version,
452 452
                 'serialNumber'         => $CertificateSerialNumber,
453 453
                 'signature'            => $AlgorithmIdentifier,
454 454
                 'issuer'               => $this->Name,
@@ -457,31 +457,31 @@  discard block
 block discarded – undo
457 457
                 'subjectPublicKeyInfo' => $SubjectPublicKeyInfo,
458 458
                 // implicit means that the T in the TLV structure is to be rewritten, regardless of the type
459 459
                 'issuerUniqueID'       => array(
460
-                                               'constant' => 1,
461
-                                               'optional' => true,
462
-                                               'implicit' => true
463
-                                           ) + $UniqueIdentifier,
460
+                                                'constant' => 1,
461
+                                                'optional' => true,
462
+                                                'implicit' => true
463
+                                            ) + $UniqueIdentifier,
464 464
                 'subjectUniqueID'       => array(
465
-                                               'constant' => 2,
466
-                                               'optional' => true,
467
-                                               'implicit' => true
468
-                                           ) + $UniqueIdentifier,
465
+                                                'constant' => 2,
466
+                                                'optional' => true,
467
+                                                'implicit' => true
468
+                                            ) + $UniqueIdentifier,
469 469
                 // <http://tools.ietf.org/html/rfc2459#page-74> doesn't use the EXPLICIT keyword but if
470 470
                 // it's not IMPLICIT, it's EXPLICIT
471 471
                 'extensions'            => array(
472
-                                               'constant' => 3,
473
-                                               'optional' => true,
474
-                                               'explicit' => true
475
-                                           ) + $this->Extensions
472
+                                                'constant' => 3,
473
+                                                'optional' => true,
474
+                                                'explicit' => true
475
+                                            ) + $this->Extensions
476 476
             )
477 477
         );
478 478
 
479 479
         $this->Certificate = array(
480 480
             'type'     => ASN1::TYPE_SEQUENCE,
481 481
             'children' => array(
482
-                 'tbsCertificate'     => $TBSCertificate,
483
-                 'signatureAlgorithm' => $AlgorithmIdentifier,
484
-                 'signature'          => array('type' => ASN1::TYPE_BIT_STRING)
482
+                    'tbsCertificate'     => $TBSCertificate,
483
+                    'signatureAlgorithm' => $AlgorithmIdentifier,
484
+                    'signature'          => array('type' => ASN1::TYPE_BIT_STRING)
485 485
             )
486 486
         );
487 487
 
@@ -504,14 +504,14 @@  discard block
 block discarded – undo
504 504
             'type'     => ASN1::TYPE_SEQUENCE,
505 505
             'children' => array(
506 506
                 'cA'                => array(
507
-                                                 'type'     => ASN1::TYPE_BOOLEAN,
508
-                                                 'optional' => true,
509
-                                                 'default'  => false
510
-                                       ),
507
+                                                    'type'     => ASN1::TYPE_BOOLEAN,
508
+                                                    'optional' => true,
509
+                                                    'default'  => false
510
+                                        ),
511 511
                 'pathLenConstraint' => array(
512
-                                                 'type' => ASN1::TYPE_INTEGER,
513
-                                                 'optional' => true
514
-                                       )
512
+                                                    'type' => ASN1::TYPE_INTEGER,
513
+                                                    'optional' => true
514
+                                        )
515 515
             )
516 516
         );
517 517
 
@@ -528,29 +528,29 @@  discard block
 block discarded – undo
528 528
             'type'     => ASN1::TYPE_SET,
529 529
             'children' => array(
530 530
                 'surname'              => array(
531
-                                           'type' => ASN1::TYPE_PRINTABLE_STRING,
532
-                                           'constant' => 0,
533
-                                           'optional' => true,
534
-                                           'implicit' => true
535
-                                         ),
531
+                                            'type' => ASN1::TYPE_PRINTABLE_STRING,
532
+                                            'constant' => 0,
533
+                                            'optional' => true,
534
+                                            'implicit' => true
535
+                                            ),
536 536
                 'given-name'           => array(
537
-                                           'type' => ASN1::TYPE_PRINTABLE_STRING,
538
-                                           'constant' => 1,
539
-                                           'optional' => true,
540
-                                           'implicit' => true
541
-                                         ),
537
+                                            'type' => ASN1::TYPE_PRINTABLE_STRING,
538
+                                            'constant' => 1,
539
+                                            'optional' => true,
540
+                                            'implicit' => true
541
+                                            ),
542 542
                 'initials'             => array(
543
-                                           'type' => ASN1::TYPE_PRINTABLE_STRING,
544
-                                           'constant' => 2,
545
-                                           'optional' => true,
546
-                                           'implicit' => true
547
-                                         ),
543
+                                            'type' => ASN1::TYPE_PRINTABLE_STRING,
544
+                                            'constant' => 2,
545
+                                            'optional' => true,
546
+                                            'implicit' => true
547
+                                            ),
548 548
                 'generation-qualifier' => array(
549
-                                           'type' => ASN1::TYPE_PRINTABLE_STRING,
550
-                                           'constant' => 3,
551
-                                           'optional' => true,
552
-                                           'implicit' => true
553
-                                         )
549
+                                            'type' => ASN1::TYPE_PRINTABLE_STRING,
550
+                                            'constant' => 3,
551
+                                            'optional' => true,
552
+                                            'implicit' => true
553
+                                            )
554 554
             )
555 555
         );
556 556
 
@@ -597,26 +597,26 @@  discard block
 block discarded – undo
597 597
         $AnotherName = array(
598 598
             'type'     => ASN1::TYPE_SEQUENCE,
599 599
             'children' => array(
600
-                 'type-id' => array('type' => ASN1::TYPE_OBJECT_IDENTIFIER),
601
-                 'value'   => array(
602
-                                  'type' => ASN1::TYPE_ANY,
603
-                                  'constant' => 0,
604
-                                  'optional' => true,
605
-                                  'explicit' => true
606
-                              )
600
+                    'type-id' => array('type' => ASN1::TYPE_OBJECT_IDENTIFIER),
601
+                    'value'   => array(
602
+                                    'type' => ASN1::TYPE_ANY,
603
+                                    'constant' => 0,
604
+                                    'optional' => true,
605
+                                    'explicit' => true
606
+                                )
607 607
             )
608 608
         );
609 609
 
610 610
         $ExtensionAttribute = array(
611 611
             'type'     => ASN1::TYPE_SEQUENCE,
612 612
             'children' => array(
613
-                 'extension-attribute-type'  => array(
613
+                    'extension-attribute-type'  => array(
614 614
                                                     'type' => ASN1::TYPE_PRINTABLE_STRING,
615 615
                                                     'constant' => 0,
616 616
                                                     'optional' => true,
617 617
                                                     'implicit' => true
618 618
                                                 ),
619
-                 'extension-attribute-value' => array(
619
+                    'extension-attribute-value' => array(
620 620
                                                     'type' => ASN1::TYPE_ANY,
621 621
                                                     'constant' => 1,
622 622
                                                     'optional' => true,
@@ -635,8 +635,8 @@  discard block
 block discarded – undo
635 635
         $BuiltInDomainDefinedAttribute = array(
636 636
             'type'     => ASN1::TYPE_SEQUENCE,
637 637
             'children' => array(
638
-                 'type'  => array('type' => ASN1::TYPE_PRINTABLE_STRING),
639
-                 'value' => array('type' => ASN1::TYPE_PRINTABLE_STRING)
638
+                    'type'  => array('type' => ASN1::TYPE_PRINTABLE_STRING),
639
+                    'value' => array('type' => ASN1::TYPE_PRINTABLE_STRING)
640 640
             )
641 641
         );
642 642
 
@@ -653,63 +653,63 @@  discard block
 block discarded – undo
653 653
                 'country-name'               => array('optional' => true) + $CountryName,
654 654
                 'administration-domain-name' => array('optional' => true) + $AdministrationDomainName,
655 655
                 'network-address'            => array(
656
-                                                 'constant' => 0,
657
-                                                 'optional' => true,
658
-                                                 'implicit' => true
659
-                                               ) + $NetworkAddress,
656
+                                                    'constant' => 0,
657
+                                                    'optional' => true,
658
+                                                    'implicit' => true
659
+                                                ) + $NetworkAddress,
660 660
                 'terminal-identifier'        => array(
661
-                                                 'constant' => 1,
662
-                                                 'optional' => true,
663
-                                                 'implicit' => true
664
-                                               ) + $TerminalIdentifier,
661
+                                                    'constant' => 1,
662
+                                                    'optional' => true,
663
+                                                    'implicit' => true
664
+                                                ) + $TerminalIdentifier,
665 665
                 'private-domain-name'        => array(
666
-                                                 'constant' => 2,
667
-                                                 'optional' => true,
668
-                                                 'explicit' => true
669
-                                               ) + $PrivateDomainName,
666
+                                                    'constant' => 2,
667
+                                                    'optional' => true,
668
+                                                    'explicit' => true
669
+                                                ) + $PrivateDomainName,
670 670
                 'organization-name'          => array(
671
-                                                 'constant' => 3,
672
-                                                 'optional' => true,
673
-                                                 'implicit' => true
674
-                                               ) + $OrganizationName,
671
+                                                    'constant' => 3,
672
+                                                    'optional' => true,
673
+                                                    'implicit' => true
674
+                                                ) + $OrganizationName,
675 675
                 'numeric-user-identifier'    => array(
676
-                                                 'constant' => 4,
677
-                                                 'optional' => true,
678
-                                                 'implicit' => true
679
-                                               ) + $NumericUserIdentifier,
676
+                                                    'constant' => 4,
677
+                                                    'optional' => true,
678
+                                                    'implicit' => true
679
+                                                ) + $NumericUserIdentifier,
680 680
                 'personal-name'              => array(
681
-                                                 'constant' => 5,
682
-                                                 'optional' => true,
683
-                                                 'implicit' => true
684
-                                               ) + $PersonalName,
681
+                                                    'constant' => 5,
682
+                                                    'optional' => true,
683
+                                                    'implicit' => true
684
+                                                ) + $PersonalName,
685 685
                 'organizational-unit-names'  => array(
686
-                                                 'constant' => 6,
687
-                                                 'optional' => true,
688
-                                                 'implicit' => true
689
-                                               ) + $OrganizationalUnitNames
686
+                                                    'constant' => 6,
687
+                                                    'optional' => true,
688
+                                                    'implicit' => true
689
+                                                ) + $OrganizationalUnitNames
690 690
             )
691 691
         );
692 692
 
693 693
         $ORAddress = array(
694 694
             'type'     => ASN1::TYPE_SEQUENCE,
695 695
             'children' => array(
696
-                 'built-in-standard-attributes'       => $BuiltInStandardAttributes,
697
-                 'built-in-domain-defined-attributes' => array('optional' => true) + $BuiltInDomainDefinedAttributes,
698
-                 'extension-attributes'               => array('optional' => true) + $ExtensionAttributes
696
+                    'built-in-standard-attributes'       => $BuiltInStandardAttributes,
697
+                    'built-in-domain-defined-attributes' => array('optional' => true) + $BuiltInDomainDefinedAttributes,
698
+                    'extension-attributes'               => array('optional' => true) + $ExtensionAttributes
699 699
             )
700 700
         );
701 701
 
702 702
         $EDIPartyName = array(
703 703
             'type'     => ASN1::TYPE_SEQUENCE,
704 704
             'children' => array(
705
-                 'nameAssigner' => array(
705
+                    'nameAssigner' => array(
706 706
                                     'constant' => 0,
707 707
                                     'optional' => true,
708 708
                                     'implicit' => true
709 709
                                 ) + $this->DirectoryString,
710
-                 // partyName is technically required but \phpseclib\File\ASN1 doesn't currently support non-optional constants and
711
-                 // setting it to optional gets the job done in any event.
712
-                 'partyName'    => array(
710
+                    // partyName is technically required but \phpseclib\File\ASN1 doesn't currently support non-optional constants and
711
+                    // setting it to optional gets the job done in any event.
712
+                    'partyName'    => array(
713 713
                                     'constant' => 1,
714 714
                                     'optional' => true,
715 715
                                     'implicit' => true
@@ -721,55 +721,55 @@  discard block
 block discarded – undo
721 721
             'type'     => ASN1::TYPE_CHOICE,
722 722
             'children' => array(
723 723
                 'otherName'                 => array(
724
-                                                 'constant' => 0,
725
-                                                 'optional' => true,
726
-                                                 'implicit' => true
727
-                                               ) + $AnotherName,
724
+                                                    'constant' => 0,
725
+                                                    'optional' => true,
726
+                                                    'implicit' => true
727
+                                                ) + $AnotherName,
728 728
                 'rfc822Name'                => array(
729
-                                                 'type' => ASN1::TYPE_IA5_STRING,
730
-                                                 'constant' => 1,
731
-                                                 'optional' => true,
732
-                                                 'implicit' => true
733
-                                               ),
729
+                                                    'type' => ASN1::TYPE_IA5_STRING,
730
+                                                    'constant' => 1,
731
+                                                    'optional' => true,
732
+                                                    'implicit' => true
733
+                                                ),
734 734
                 'dNSName'                   => array(
735
-                                                 'type' => ASN1::TYPE_IA5_STRING,
736
-                                                 'constant' => 2,
737
-                                                 'optional' => true,
738
-                                                 'implicit' => true
739
-                                               ),
735
+                                                    'type' => ASN1::TYPE_IA5_STRING,
736
+                                                    'constant' => 2,
737
+                                                    'optional' => true,
738
+                                                    'implicit' => true
739
+                                                ),
740 740
                 'x400Address'               => array(
741
-                                                 'constant' => 3,
742
-                                                 'optional' => true,
743
-                                                 'implicit' => true
744
-                                               ) + $ORAddress,
741
+                                                    'constant' => 3,
742
+                                                    'optional' => true,
743
+                                                    'implicit' => true
744
+                                                ) + $ORAddress,
745 745
                 'directoryName'             => array(
746
-                                                 'constant' => 4,
747
-                                                 'optional' => true,
748
-                                                 'explicit' => true
749
-                                               ) + $this->Name,
746
+                                                    'constant' => 4,
747
+                                                    'optional' => true,
748
+                                                    'explicit' => true
749
+                                                ) + $this->Name,
750 750
                 'ediPartyName'              => array(
751
-                                                 'constant' => 5,
752
-                                                 'optional' => true,
753
-                                                 'implicit' => true
754
-                                               ) + $EDIPartyName,
751
+                                                    'constant' => 5,
752
+                                                    'optional' => true,
753
+                                                    'implicit' => true
754
+                                                ) + $EDIPartyName,
755 755
                 'uniformResourceIdentifier' => array(
756
-                                                 'type' => ASN1::TYPE_IA5_STRING,
757
-                                                 'constant' => 6,
758
-                                                 'optional' => true,
759
-                                                 'implicit' => true
760
-                                               ),
756
+                                                    'type' => ASN1::TYPE_IA5_STRING,
757
+                                                    'constant' => 6,
758
+                                                    'optional' => true,
759
+                                                    'implicit' => true
760
+                                                ),
761 761
                 'iPAddress'                 => array(
762
-                                                 'type' => ASN1::TYPE_OCTET_STRING,
763
-                                                 'constant' => 7,
764
-                                                 'optional' => true,
765
-                                                 'implicit' => true
766
-                                               ),
762
+                                                    'type' => ASN1::TYPE_OCTET_STRING,
763
+                                                    'constant' => 7,
764
+                                                    'optional' => true,
765
+                                                    'implicit' => true
766
+                                                ),
767 767
                 'registeredID'              => array(
768
-                                                 'type' => ASN1::TYPE_OBJECT_IDENTIFIER,
769
-                                                 'constant' => 8,
770
-                                                 'optional' => true,
771
-                                                 'implicit' => true
772
-                                               )
768
+                                                    'type' => ASN1::TYPE_OBJECT_IDENTIFIER,
769
+                                                    'constant' => 8,
770
+                                                    'optional' => true,
771
+                                                    'implicit' => true
772
+                                                )
773 773
             )
774 774
         );
775 775
 
@@ -801,15 +801,15 @@  discard block
 block discarded – undo
801 801
             'type'     => ASN1::TYPE_CHOICE,
802 802
             'children' => array(
803 803
                 'fullName'                => array(
804
-                                                 'constant' => 0,
805
-                                                 'optional' => true,
806
-                                                 'implicit' => true
807
-                                       ) + $GeneralNames,
804
+                                                    'constant' => 0,
805
+                                                    'optional' => true,
806
+                                                    'implicit' => true
807
+                                        ) + $GeneralNames,
808 808
                 'nameRelativeToCRLIssuer' => array(
809
-                                                 'constant' => 1,
810
-                                                 'optional' => true,
811
-                                                 'implicit' => true
812
-                                       ) + $this->RelativeDistinguishedName
809
+                                                    'constant' => 1,
810
+                                                    'optional' => true,
811
+                                                    'implicit' => true
812
+                                        ) + $this->RelativeDistinguishedName
813 813
             )
814 814
         );
815 815
 
@@ -817,20 +817,20 @@  discard block
 block discarded – undo
817 817
             'type'     => ASN1::TYPE_SEQUENCE,
818 818
             'children' => array(
819 819
                 'distributionPoint' => array(
820
-                                                 'constant' => 0,
821
-                                                 'optional' => true,
822
-                                                 'explicit' => true
823
-                                       ) + $DistributionPointName,
820
+                                                    'constant' => 0,
821
+                                                    'optional' => true,
822
+                                                    'explicit' => true
823
+                                        ) + $DistributionPointName,
824 824
                 'reasons'           => array(
825
-                                                 'constant' => 1,
826
-                                                 'optional' => true,
827
-                                                 'implicit' => true
828
-                                       ) + $ReasonFlags,
825
+                                                    'constant' => 1,
826
+                                                    'optional' => true,
827
+                                                    'implicit' => true
828
+                                        ) + $ReasonFlags,
829 829
                 'cRLIssuer'         => array(
830
-                                                 'constant' => 2,
831
-                                                 'optional' => true,
832
-                                                 'implicit' => true
833
-                                       ) + $GeneralNames
830
+                                                    'constant' => 2,
831
+                                                    'optional' => true,
832
+                                                    'implicit' => true
833
+                                        ) + $GeneralNames
834 834
             )
835 835
         );
836 836
 
@@ -845,20 +845,20 @@  discard block
 block discarded – undo
845 845
             'type'     => ASN1::TYPE_SEQUENCE,
846 846
             'children' => array(
847 847
                 'keyIdentifier'             => array(
848
-                                                 'constant' => 0,
849
-                                                 'optional' => true,
850
-                                                 'implicit' => true
851
-                                               ) + $this->KeyIdentifier,
848
+                                                    'constant' => 0,
849
+                                                    'optional' => true,
850
+                                                    'implicit' => true
851
+                                                ) + $this->KeyIdentifier,
852 852
                 'authorityCertIssuer'       => array(
853
-                                                 'constant' => 1,
854
-                                                 'optional' => true,
855
-                                                 'implicit' => true
856
-                                               ) + $GeneralNames,
853
+                                                    'constant' => 1,
854
+                                                    'optional' => true,
855
+                                                    'implicit' => true
856
+                                                ) + $GeneralNames,
857 857
                 'authorityCertSerialNumber' => array(
858
-                                                 'constant' => 2,
859
-                                                 'optional' => true,
860
-                                                 'implicit' => true
861
-                                               ) + $CertificateSerialNumber
858
+                                                    'constant' => 2,
859
+                                                    'optional' => true,
860
+                                                    'implicit' => true
861
+                                                ) + $CertificateSerialNumber
862 862
             )
863 863
         );
864 864
 
@@ -879,12 +879,12 @@  discard block
 block discarded – undo
879 879
             'children' => array(
880 880
                 'policyIdentifier' => $CertPolicyId,
881 881
                 'policyQualifiers' => array(
882
-                                          'type'     => ASN1::TYPE_SEQUENCE,
883
-                                          'min'      => 0,
884
-                                          'max'      => -1,
885
-                                          'optional' => true,
886
-                                          'children' => $PolicyQualifierInfo
887
-                                      )
882
+                                            'type'     => ASN1::TYPE_SEQUENCE,
883
+                                            'min'      => 0,
884
+                                            'max'      => -1,
885
+                                            'optional' => true,
886
+                                            'children' => $PolicyQualifierInfo
887
+                                        )
888 888
             )
889 889
         );
890 890
 
@@ -900,12 +900,12 @@  discard block
 block discarded – undo
900 900
             'min'      => 1,
901 901
             'max'      => -1,
902 902
             'children' => array(
903
-                              'type'     => ASN1::TYPE_SEQUENCE,
904
-                              'children' => array(
905
-                                  'issuerDomainPolicy' => $CertPolicyId,
906
-                                  'subjectDomainPolicy' => $CertPolicyId
907
-                              )
908
-                       )
903
+                                'type'     => ASN1::TYPE_SEQUENCE,
904
+                                'children' => array(
905
+                                    'issuerDomainPolicy' => $CertPolicyId,
906
+                                    'subjectDomainPolicy' => $CertPolicyId
907
+                                )
908
+                        )
909 909
         );
910 910
 
911 911
         $KeyPurposeId = array('type' => ASN1::TYPE_OBJECT_IDENTIFIER);
@@ -938,15 +938,15 @@  discard block
 block discarded – undo
938 938
             'type'     => ASN1::TYPE_SEQUENCE,
939 939
             'children' => array(
940 940
                 'notBefore' => array(
941
-                                                 'constant' => 0,
942
-                                                 'optional' => true,
943
-                                                 'implicit' => true,
944
-                                                 'type' => ASN1::TYPE_GENERALIZED_TIME),
941
+                                                    'constant' => 0,
942
+                                                    'optional' => true,
943
+                                                    'implicit' => true,
944
+                                                    'type' => ASN1::TYPE_GENERALIZED_TIME),
945 945
                 'notAfter'  => array(
946
-                                                 'constant' => 1,
947
-                                                 'optional' => true,
948
-                                                 'implicit' => true,
949
-                                                 'type' => ASN1::TYPE_GENERALIZED_TIME)
946
+                                                    'constant' => 1,
947
+                                                    'optional' => true,
948
+                                                    'implicit' => true,
949
+                                                    'type' => ASN1::TYPE_GENERALIZED_TIME)
950 950
             )
951 951
         );
952 952
 
@@ -957,16 +957,16 @@  discard block
 block discarded – undo
957 957
             'children' => array(
958 958
                 'base'    => $GeneralName,
959 959
                 'minimum' => array(
960
-                                 'constant' => 0,
961
-                                 'optional' => true,
962
-                                 'implicit' => true,
963
-                                 'default' => new BigInteger(0)
964
-                             ) + $BaseDistance,
960
+                                    'constant' => 0,
961
+                                    'optional' => true,
962
+                                    'implicit' => true,
963
+                                    'default' => new BigInteger(0)
964
+                                ) + $BaseDistance,
965 965
                 'maximum' => array(
966
-                                 'constant' => 1,
967
-                                 'optional' => true,
968
-                                 'implicit' => true,
969
-                             ) + $BaseDistance
966
+                                    'constant' => 1,
967
+                                    'optional' => true,
968
+                                    'implicit' => true,
969
+                                ) + $BaseDistance
970 970
             )
971 971
         );
972 972
 
@@ -981,15 +981,15 @@  discard block
 block discarded – undo
981 981
             'type'     => ASN1::TYPE_SEQUENCE,
982 982
             'children' => array(
983 983
                 'permittedSubtrees' => array(
984
-                                           'constant' => 0,
985
-                                           'optional' => true,
986
-                                           'implicit' => true
987
-                                       ) + $GeneralSubtrees,
984
+                                            'constant' => 0,
985
+                                            'optional' => true,
986
+                                            'implicit' => true
987
+                                        ) + $GeneralSubtrees,
988 988
                 'excludedSubtrees'  => array(
989
-                                           'constant' => 1,
990
-                                           'optional' => true,
991
-                                           'implicit' => true
992
-                                       ) + $GeneralSubtrees
989
+                                            'constant' => 1,
990
+                                            'optional' => true,
991
+                                            'implicit' => true
992
+                                        ) + $GeneralSubtrees
993 993
             )
994 994
         );
995 995
 
@@ -1010,11 +1010,11 @@  discard block
 block discarded – undo
1010 1010
             'children' => array(
1011 1011
                 'organization'  => $DisplayText,
1012 1012
                 'noticeNumbers' => array(
1013
-                                       'type'     => ASN1::TYPE_SEQUENCE,
1014
-                                       'min'      => 1,
1015
-                                       'max'      => 200,
1016
-                                       'children' => array('type' => ASN1::TYPE_INTEGER)
1017
-                                   )
1013
+                                        'type'     => ASN1::TYPE_SEQUENCE,
1014
+                                        'min'      => 1,
1015
+                                        'max'      => 200,
1016
+                                        'children' => array('type' => ASN1::TYPE_INTEGER)
1017
+                                    )
1018 1018
             )
1019 1019
         );
1020 1020
 
@@ -1022,13 +1022,13 @@  discard block
 block discarded – undo
1022 1022
             'type'     => ASN1::TYPE_SEQUENCE,
1023 1023
             'children' => array(
1024 1024
                 'noticeRef' => array(
1025
-                                           'optional' => true,
1026
-                                           'implicit' => true
1027
-                                       ) + $NoticeReference,
1025
+                                            'optional' => true,
1026
+                                            'implicit' => true
1027
+                                        ) + $NoticeReference,
1028 1028
                 'explicitText'  => array(
1029
-                                           'optional' => true,
1030
-                                           'implicit' => true
1031
-                                       ) + $DisplayText
1029
+                                            'optional' => true,
1030
+                                            'implicit' => true
1031
+                                        ) + $DisplayText
1032 1032
             )
1033 1033
         );
1034 1034
 
@@ -1057,11 +1057,11 @@  discard block
 block discarded – undo
1057 1057
             'children' => array(
1058 1058
                 'type' => $AttributeType,
1059 1059
                 'value'=> array(
1060
-                              'type'     => ASN1::TYPE_SET,
1061
-                              'min'      => 1,
1062
-                              'max'      => -1,
1063
-                              'children' => $this->AttributeValue
1064
-                          )
1060
+                                'type'     => ASN1::TYPE_SET,
1061
+                                'min'      => 1,
1062
+                                'max'      => -1,
1063
+                                'children' => $this->AttributeValue
1064
+                            )
1065 1065
             )
1066 1066
         );
1067 1067
 
@@ -1078,16 +1078,16 @@  discard block
 block discarded – undo
1078 1078
             'type'     => ASN1::TYPE_SEQUENCE,
1079 1079
             'children' => array(
1080 1080
                 'version'       => array(
1081
-                                       'type' => ASN1::TYPE_INTEGER,
1082
-                                       'mapping' => array('v1')
1083
-                                   ),
1081
+                                        'type' => ASN1::TYPE_INTEGER,
1082
+                                        'mapping' => array('v1')
1083
+                                    ),
1084 1084
                 'subject'       => $this->Name,
1085 1085
                 'subjectPKInfo' => $SubjectPublicKeyInfo,
1086 1086
                 'attributes'    => array(
1087
-                                       'constant' => 0,
1088
-                                       'optional' => true,
1089
-                                       'implicit' => true
1090
-                                   ) + $Attributes,
1087
+                                        'constant' => 0,
1088
+                                        'optional' => true,
1089
+                                        'implicit' => true
1090
+                                    ) + $Attributes,
1091 1091
             )
1092 1092
         );
1093 1093
 
@@ -1103,39 +1103,39 @@  discard block
 block discarded – undo
1103 1103
         $RevokedCertificate = array(
1104 1104
             'type'     => ASN1::TYPE_SEQUENCE,
1105 1105
             'children' => array(
1106
-                              'userCertificate'    => $CertificateSerialNumber,
1107
-                              'revocationDate'     => $Time,
1108
-                              'crlEntryExtensions' => array(
1109
-                                                          'optional' => true
1110
-                                                      ) + $this->Extensions
1111
-                          )
1106
+                                'userCertificate'    => $CertificateSerialNumber,
1107
+                                'revocationDate'     => $Time,
1108
+                                'crlEntryExtensions' => array(
1109
+                                                            'optional' => true
1110
+                                                        ) + $this->Extensions
1111
+                            )
1112 1112
         );
1113 1113
 
1114 1114
         $TBSCertList = array(
1115 1115
             'type'     => ASN1::TYPE_SEQUENCE,
1116 1116
             'children' => array(
1117 1117
                 'version'             => array(
1118
-                                             'optional' => true,
1119
-                                             'default'  => 'v1'
1120
-                                         ) + $Version,
1118
+                                                'optional' => true,
1119
+                                                'default'  => 'v1'
1120
+                                            ) + $Version,
1121 1121
                 'signature'           => $AlgorithmIdentifier,
1122 1122
                 'issuer'              => $this->Name,
1123 1123
                 'thisUpdate'          => $Time,
1124 1124
                 'nextUpdate'          => array(
1125
-                                             'optional' => true
1126
-                                         ) + $Time,
1125
+                                                'optional' => true
1126
+                                            ) + $Time,
1127 1127
                 'revokedCertificates' => array(
1128
-                                             'type'     => ASN1::TYPE_SEQUENCE,
1129
-                                             'optional' => true,
1130
-                                             'min'      => 0,
1131
-                                             'max'      => -1,
1132
-                                             'children' => $RevokedCertificate
1133
-                                         ),
1128
+                                                'type'     => ASN1::TYPE_SEQUENCE,
1129
+                                                'optional' => true,
1130
+                                                'min'      => 0,
1131
+                                                'max'      => -1,
1132
+                                                'children' => $RevokedCertificate
1133
+                                            ),
1134 1134
                 'crlExtensions'       => array(
1135
-                                             'constant' => 0,
1136
-                                             'optional' => true,
1137
-                                             'explicit' => true
1138
-                                         ) + $this->Extensions
1135
+                                                'constant' => 0,
1136
+                                                'optional' => true,
1137
+                                                'explicit' => true
1138
+                                            ) + $this->Extensions
1139 1139
             )
1140 1140
         );
1141 1141
 
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
         $this->CRLNumber = array('type' => ASN1::TYPE_INTEGER);
1152 1152
 
1153 1153
         $this->CRLReason = array('type' => ASN1::TYPE_ENUMERATED,
1154
-           'mapping' => array(
1154
+            'mapping' => array(
1155 1155
                             'unspecified',
1156 1156
                             'keyCompromise',
1157 1157
                             'cACompromise',
@@ -1206,7 +1206,7 @@  discard block
 block discarded – undo
1206 1206
                                                     'default'  => false,
1207 1207
                                                     'implicit' => true
1208 1208
                                                 )
1209
-                          )
1209
+                            )
1210 1210
         );
1211 1211
 
1212 1212
         $this->InvalidityDate = array('type' => ASN1::TYPE_GENERALIZED_TIME);
@@ -4353,7 +4353,7 @@  discard block
 block discarded – undo
4353 4353
 
4354 4354
         $i = count($rclist);
4355 4355
         $rclist[] = array('userCertificate' => $serial,
4356
-                          'revocationDate'  => $this->_timeField(@date('D, d M Y H:i:s O')));
4356
+                            'revocationDate'  => $this->_timeField(@date('D, d M Y H:i:s O')));
4357 4357
         return $i;
4358 4358
     }
4359 4359
 
Please login to merge, or discard this patch.
Spacing   +16 added lines, -17 removed lines patch added patch discarded remove patch
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
             'children' => $BuiltInDomainDefinedAttribute
648 648
         );
649 649
 
650
-        $BuiltInStandardAttributes =  array(
650
+        $BuiltInStandardAttributes = array(
651 651
             'type'     => ASN1::TYPE_SEQUENCE,
652 652
             'children' => array(
653 653
                 'country-name'               => array('optional' => true) + $CountryName,
@@ -2316,7 +2316,7 @@  discard block
 block discarded – undo
2316 2316
             return false;
2317 2317
         }
2318 2318
 
2319
-        foreach ((array) $propValue as $v) {
2319
+        foreach ((array)$propValue as $v) {
2320 2320
             if (!is_array($v) && isset($type)) {
2321 2321
                 $v = array($type => $v);
2322 2322
             }
@@ -2441,7 +2441,7 @@  discard block
 block discarded – undo
2441 2441
 
2442 2442
         // handles everything else
2443 2443
         $results = preg_split('#((?:^|, *|/)(?:C=|O=|OU=|CN=|L=|ST=|SN=|postalCode=|streetAddress=|emailAddress=|serialNumber=|organizationalUnitName=|title=|description=|role=|x500UniqueIdentifier=))#', $dn, -1, PREG_SPLIT_DELIM_CAPTURE);
2444
-        for ($i = 1; $i < count($results); $i+=2) {
2444
+        for ($i = 1; $i < count($results); $i += 2) {
2445 2445
             $prop = trim($results[$i], ', =/');
2446 2446
             $value = $results[$i + 1];
2447 2447
             if (!$this->setDNProp($prop, $value, $type)) {
@@ -2466,7 +2466,7 @@  discard block
 block discarded – undo
2466 2466
             $dn = isset($this->currentCert['tbsCertList']) ? $this->currentCert['tbsCertList']['issuer'] : $this->dn;
2467 2467
         }
2468 2468
 
2469
-        switch ((int) $format) {
2469
+        switch ((int)$format) {
2470 2470
             case self::DN_ARRAY:
2471 2471
                 return $dn;
2472 2472
             case self::DN_ASN1:
@@ -2489,7 +2489,7 @@  discard block
 block discarded – undo
2489 2489
                     if (!isset($dn[$prop])) {
2490 2490
                         $dn[$prop] = $value;
2491 2491
                     } else {
2492
-                        $dn[$prop] = array_merge((array) $dn[$prop], array($value));
2492
+                        $dn[$prop] = array_merge((array)$dn[$prop], array($value));
2493 2493
                     }
2494 2494
                 }
2495 2495
                 return $dn;
@@ -2567,11 +2567,11 @@  discard block
 block discarded – undo
2567 2567
                     break;
2568 2568
                 default:
2569 2569
                     $delim = '/';
2570
-                    $desc = preg_replace('#.+-([^-]+)$#', '$1',  $prop) . '=';
2570
+                    $desc = preg_replace('#.+-([^-]+)$#', '$1', $prop) . '=';
2571 2571
             }
2572 2572
 
2573 2573
             if (!$start) {
2574
-                $output.= $delim;
2574
+                $output .= $delim;
2575 2575
             }
2576 2576
             if (is_array($value)) {
2577 2577
                 foreach ($value as $type => $v) {
@@ -2588,7 +2588,7 @@  discard block
 block discarded – undo
2588 2588
                     $value = array_pop($value); // Always strip data type.
2589 2589
                 }
2590 2590
             }
2591
-            $output.= $desc . $value;
2591
+            $output .= $desc . $value;
2592 2592
             $start = false;
2593 2593
         }
2594 2594
 
@@ -3210,7 +3210,7 @@  discard block
 block discarded – undo
3210 3210
         }
3211 3211
 
3212 3212
         $currentCert = isset($this->currentCert) ? $this->currentCert : null;
3213
-        $signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject: null;
3213
+        $signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject : null;
3214 3214
 
3215 3215
         if (isset($subject->currentCert) && is_array($subject->currentCert) && isset($subject->currentCert['tbsCertificate'])) {
3216 3216
             $this->currentCert = $subject->currentCert;
@@ -3253,8 +3253,7 @@  discard block
 block discarded – undo
3253 3253
                application of a bitmap
3254 3254
             */
3255 3255
             $serialNumber = !empty($this->serialNumber) ?
3256
-                $this->serialNumber :
3257
-                new BigInteger(Random::string(20) & ("\x7F" . str_repeat("\xFF", 19)), 256);
3256
+                $this->serialNumber : new BigInteger(Random::string(20) & ("\x7F" . str_repeat("\xFF", 19)), 256);
3258 3257
 
3259 3258
             $this->currentCert = array(
3260 3259
                 'tbsCertificate' =>
@@ -3393,7 +3392,7 @@  discard block
 block discarded – undo
3393 3392
         $this->publicKey = $origPublicKey;
3394 3393
 
3395 3394
         $currentCert = isset($this->currentCert) ? $this->currentCert : null;
3396
-        $signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject: null;
3395
+        $signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject : null;
3397 3396
 
3398 3397
         if (isset($this->currentCert) && is_array($this->currentCert) && isset($this->currentCert['certificationRequestInfo'])) {
3399 3398
             $this->currentCert['signatureAlgorithm']['algorithm'] = $signatureAlgorithm;
@@ -3452,7 +3451,7 @@  discard block
 block discarded – undo
3452 3451
         $this->publicKey = $origPublicKey;
3453 3452
 
3454 3453
         $currentCert = isset($this->currentCert) ? $this->currentCert : null;
3455
-        $signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject: null;
3454
+        $signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject : null;
3456 3455
 
3457 3456
         // re-signing a SPKAC seems silly but since everything else supports re-signing why not?
3458 3457
         if (isset($this->currentCert) && is_array($this->currentCert) && isset($this->currentCert['publicKeyAndChallenge'])) {
@@ -4141,7 +4140,7 @@  discard block
 block discarded – undo
4141 4140
                 $attributes[$last]['value'][] = $value;
4142 4141
                 break;
4143 4142
             default:
4144
-                $attributes[] = array('type' => $id, 'value' => $disposition == self::ATTR_ALL ? $value: array($value));
4143
+                $attributes[] = array('type' => $id, 'value' => $disposition == self::ATTR_ALL ? $value : array($value));
4145 4144
                 break;
4146 4145
         }
4147 4146
 
@@ -4213,12 +4212,12 @@  discard block
 block discarded – undo
4213 4212
                 // If the key is private, compute identifier from its corresponding public key.
4214 4213
                 $key = new RSA();
4215 4214
                 if (!$key->loadKey($raw)) {
4216
-                    return false;   // Not an unencrypted RSA key.
4215
+                    return false; // Not an unencrypted RSA key.
4217 4216
                 }
4218 4217
                 if ($key->getPrivateKey() !== false) {  // If private.
4219 4218
                     return $this->computeKeyIdentifier($key, $method);
4220 4219
                 }
4221
-                $key = $raw;    // Is a public key.
4220
+                $key = $raw; // Is a public key.
4222 4221
                 break;
4223 4222
             case $key instanceof X509:
4224 4223
                 if (isset($key->publicKey)) {
@@ -4488,7 +4487,7 @@  discard block
 block discarded – undo
4488 4487
 
4489 4488
         if (is_array($rclist = $this->_subArray($crl, 'tbsCertList/revokedCertificates'))) {
4490 4489
             if (($i = $this->_revokedCertificate($rclist, $serial)) !== false) {
4491
-                return $this->_getExtension($id, $crl,  "tbsCertList/revokedCertificates/$i/crlEntryExtensions");
4490
+                return $this->_getExtension($id, $crl, "tbsCertList/revokedCertificates/$i/crlEntryExtensions");
4492 4491
             }
4493 4492
         }
4494 4493
 
Please login to merge, or discard this patch.
inc/Exts/phpseclib/File/ANSI.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         $this->tokenization = array('');
236 236
         for ($i = 0; $i < strlen($source); $i++) {
237 237
             if (strlen($this->ansi)) {
238
-                $this->ansi.= $source[$i];
238
+                $this->ansi .= $source[$i];
239 239
                 $chr = ord($source[$i]);
240 240
                 // http://en.wikipedia.org/wiki/ANSI_escape_code#Sequence_elements
241 241
                 // single character CSI's not currently supported
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
                         switch (true) {
291 291
                             case preg_match('#\x1B\[(\d+)B#', $this->ansi, $match): // Move cursor down n lines
292 292
                                 $this->old_y = $this->y;
293
-                                $this->y+= $match[1];
293
+                                $this->y += $match[1];
294 294
                                 break;
295 295
                             case preg_match('#\x1B\[(\d+);(\d+)H#', $this->ansi, $match): // Move cursor to screen location v,h
296 296
                                 $this->old_x = $this->x;
@@ -300,11 +300,11 @@  discard block
 block discarded – undo
300 300
                                 break;
301 301
                             case preg_match('#\x1B\[(\d+)C#', $this->ansi, $match): // Move cursor right n lines
302 302
                                 $this->old_x = $this->x;
303
-                                $this->x+= $match[1];
303
+                                $this->x += $match[1];
304 304
                                 break;
305 305
                             case preg_match('#\x1B\[(\d+)D#', $this->ansi, $match): // Move cursor left n lines
306 306
                                 $this->old_x = $this->x;
307
-                                $this->x-= $match[1];
307
+                                $this->x -= $match[1];
308 308
                                 break;
309 309
                             case preg_match('#\x1B\[(\d+);(\d+)r#', $this->ansi, $match): // Set top and bottom lines of a window
310 310
                                 break;
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
                 continue;
374 374
             }
375 375
 
376
-            $this->tokenization[count($this->tokenization) - 1].= $source[$i];
376
+            $this->tokenization[count($this->tokenization) - 1] .= $source[$i];
377 377
             switch ($source[$i]) {
378 378
                 case "\r":
379 379
                     $this->x = 0;
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
                     //if (!strlen($this->tokenization[count($this->tokenization) - 1])) {
401 401
                     //    array_pop($this->tokenization);
402 402
                     //}
403
-                    $this->ansi.= "\x1B";
403
+                    $this->ansi .= "\x1B";
404 404
                     break;
405 405
                 default:
406 406
                     $this->attrs[$this->y][$this->x] = clone $this->attr_cell;
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
             $close = $open = '';
469 469
             if ($last_attr->foreground != $cur_attr->foreground) {
470 470
                 if ($cur_attr->foreground != 'white') {
471
-                    $open.= '<span style="color: ' . $cur_attr->foreground . '">';
471
+                    $open .= '<span style="color: ' . $cur_attr->foreground . '">';
472 472
                 }
473 473
                 if ($last_attr->foreground != 'white') {
474 474
                     $close = '</span>' . $close;
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
             }
477 477
             if ($last_attr->background != $cur_attr->background) {
478 478
                 if ($cur_attr->background != 'black') {
479
-                    $open.= '<span style="background: ' . $cur_attr->background . '">';
479
+                    $open .= '<span style="background: ' . $cur_attr->background . '">';
480 480
                 }
481 481
                 if ($last_attr->background != 'black') {
482 482
                     $close = '</span>' . $close;
@@ -484,29 +484,29 @@  discard block
 block discarded – undo
484 484
             }
485 485
             if ($last_attr->bold != $cur_attr->bold) {
486 486
                 if ($cur_attr->bold) {
487
-                    $open.= '<b>';
487
+                    $open .= '<b>';
488 488
                 } else {
489 489
                     $close = '</b>' . $close;
490 490
                 }
491 491
             }
492 492
             if ($last_attr->underline != $cur_attr->underline) {
493 493
                 if ($cur_attr->underline) {
494
-                    $open.= '<u>';
494
+                    $open .= '<u>';
495 495
                 } else {
496 496
                     $close = '</u>' . $close;
497 497
                 }
498 498
             }
499 499
             if ($last_attr->blink != $cur_attr->blink) {
500 500
                 if ($cur_attr->blink) {
501
-                    $open.= '<blink>';
501
+                    $open .= '<blink>';
502 502
                 } else {
503 503
                     $close = '</blink>' . $close;
504 504
                 }
505 505
             }
506
-            $output.= $close . $open;
506
+            $output .= $close . $open;
507 507
         }
508 508
 
509
-        $output.= htmlspecialchars($char);
509
+        $output .= htmlspecialchars($char);
510 510
 
511 511
         return $output;
512 512
     }
@@ -524,14 +524,14 @@  discard block
 block discarded – undo
524 524
         for ($i = 0; $i <= $this->max_y; $i++) {
525 525
             for ($j = 0; $j <= $this->max_x; $j++) {
526 526
                 $cur_attr = $this->attrs[$i][$j];
527
-                $output.= $this->_processCoordinate($last_attr, $cur_attr, isset($this->screen[$i][$j]) ? $this->screen[$i][$j] : '');
527
+                $output .= $this->_processCoordinate($last_attr, $cur_attr, isset($this->screen[$i][$j]) ? $this->screen[$i][$j] : '');
528 528
                 $last_attr = $this->attrs[$i][$j];
529 529
             }
530
-            $output.= "\r\n";
530
+            $output .= "\r\n";
531 531
         }
532 532
         $output = substr($output, 0, -2);
533 533
         // close any remaining open tags
534
-        $output.= $this->_processCoordinate($last_attr, $this->base_attr_cell, '');
534
+        $output .= $this->_processCoordinate($last_attr, $this->base_attr_cell, '');
535 535
         return rtrim($output);
536 536
     }
537 537
 
@@ -559,14 +559,14 @@  discard block
 block discarded – undo
559 559
         for ($i = 0; $i < count($this->history); $i++) {
560 560
             for ($j = 0; $j <= $this->max_x + 1; $j++) {
561 561
                 $cur_attr = $this->history_attrs[$i][$j];
562
-                $scrollback.= $this->_processCoordinate($last_attr, $cur_attr, isset($this->history[$i][$j]) ? $this->history[$i][$j] : '');
562
+                $scrollback .= $this->_processCoordinate($last_attr, $cur_attr, isset($this->history[$i][$j]) ? $this->history[$i][$j] : '');
563 563
                 $last_attr = $this->history_attrs[$i][$j];
564 564
             }
565
-            $scrollback.= "\r\n";
565
+            $scrollback .= "\r\n";
566 566
         }
567 567
         $base_attr_cell = $this->base_attr_cell;
568 568
         $this->base_attr_cell = $last_attr;
569
-        $scrollback.= $this->_getScreen();
569
+        $scrollback .= $this->_getScreen();
570 570
         $this->base_attr_cell = $base_attr_cell;
571 571
 
572 572
         return '<pre width="' . ($this->max_x + 1) . '" style="color: white; background: black">' . $scrollback . '</span></pre>';
Please login to merge, or discard this patch.
inc/Exts/phpseclib/File/ASN1.php 1 patch
Spacing   +29 added lines, -31 removed lines patch added patch discarded remove patch
@@ -258,14 +258,14 @@  discard block
 block discarded – undo
258 258
         } elseif ($length & 0x80) { // definite length, long form
259 259
             // technically, the long form of the length can be represented by up to 126 octets (bytes), but we'll only
260 260
             // support it up to four.
261
-            $length&= 0x7F;
261
+            $length &= 0x7F;
262 262
             $temp = $this->_string_shift($encoded, $length);
263 263
             // tags of indefinte length don't really have a header length; this length includes the tag
264
-            $current+= array('headerlength' => $length + 2);
265
-            $start+= $length;
264
+            $current += array('headerlength' => $length + 2);
265
+            $start += $length;
266 266
             extract(unpack('Nlength', substr(str_pad($temp, 4, chr(0), STR_PAD_LEFT), -4)));
267 267
         } else {
268
-            $current+= array('headerlength' => 2);
268
+            $current += array('headerlength' => 2);
269 269
         }
270 270
 
271 271
         if ($length > strlen($encoded)) {
@@ -306,13 +306,13 @@  discard block
 block discarded – undo
306 306
                     $length = $temp['length'];
307 307
                     // end-of-content octets - see paragraph 8.1.5
308 308
                     if (substr($content, $length, 2) == "\0\0") {
309
-                        $length+= 2;
310
-                        $start+= $length;
309
+                        $length += 2;
310
+                        $start += $length;
311 311
                         $newcontent[] = $temp;
312 312
                         break;
313 313
                     }
314
-                    $start+= $length;
315
-                    $remainingLength-= $length;
314
+                    $start += $length;
315
+                    $remainingLength -= $length;
316 316
                     $newcontent[] = $temp;
317 317
                     $this->_string_shift($content, $length);
318 318
                 }
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
                 ) + $current;
330 330
         }
331 331
 
332
-        $current+= array('type' => $tag);
332
+        $current += array('type' => $tag);
333 333
 
334 334
         // decode UNIVERSAL tags
335 335
         switch ($tag) {
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
                 //if (strlen($content) != 1) {
339 339
                 //    return false;
340 340
                 //}
341
-                $current['content'] = (bool) ord($content[0]);
341
+                $current['content'] = (bool)ord($content[0]);
342 342
                 break;
343 343
             case self::TYPE_INTEGER:
344 344
             case self::TYPE_ENUMERATED:
@@ -354,14 +354,14 @@  discard block
 block discarded – undo
354 354
                     $current['content'] = $content;
355 355
                 } else {
356 356
                     $temp = $this->_decode_ber($content, $start);
357
-                    $length-= strlen($content);
357
+                    $length -= strlen($content);
358 358
                     $last = count($temp) - 1;
359 359
                     for ($i = 0; $i < $last; $i++) {
360 360
                         // all subtags should be bit strings
361 361
                         //if ($temp[$i]['type'] != self::TYPE_BIT_STRING) {
362 362
                         //    return false;
363 363
                         //}
364
-                        $current['content'].= substr($temp[$i]['content'], 1);
364
+                        $current['content'] .= substr($temp[$i]['content'], 1);
365 365
                     }
366 366
                     // all subtags should be bit strings
367 367
                     //if ($temp[$last]['type'] != self::TYPE_BIT_STRING) {
@@ -383,11 +383,11 @@  discard block
 block discarded – undo
383 383
                         //if ($temp['type'] != self::TYPE_OCTET_STRING) {
384 384
                         //    return false;
385 385
                         //}
386
-                        $current['content'].= $temp['content'];
387
-                        $length+= $temp['length'];
386
+                        $current['content'] .= $temp['content'];
387
+                        $length += $temp['length'];
388 388
                     }
389 389
                     if (substr($content, 0, 2) == "\0\0") {
390
-                        $length+= 2; // +2 for the EOC
390
+                        $length += 2; // +2 for the EOC
391 391
                     }
392 392
                 }
393 393
                 break;
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
                     $temp = $this->_decode_ber($content, $start + $offset);
412 412
                     $this->_string_shift($content, $temp['length']);
413 413
                     $current['content'][] = $temp;
414
-                    $offset+= $temp['length'];
414
+                    $offset += $temp['length'];
415 415
                 }
416 416
                 break;
417 417
             case self::TYPE_OBJECT_IDENTIFIER:
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
                     $valuen <<= 7;
425 425
                     $valuen |= $temp & 0x7F;
426 426
                     if (~$temp & 0x80) {
427
-                        $current['content'].= ".$valuen";
427
+                        $current['content'] .= ".$valuen";
428 428
                         $valuen = 0;
429 429
                     }
430 430
                 }
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
             default:
470 470
         }
471 471
 
472
-        $start+= $length;
472
+        $start += $length;
473 473
 
474 474
         // ie. length is the length of the full TLV encoding - it's not just the length of the value
475 475
         return $current + array('length' => $start - $current['start']);
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
                 }
617 617
 
618 618
                 // Fail mapping if all input items have not been consumed.
619
-                return $i < $n? null: $map;
619
+                return $i < $n ? null: $map;
620 620
 
621 621
             // the main diff between sets and sequences is the encapsulation of the foreach in another for loop
622 622
             case self::TYPE_SET:
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
                     for ($i = strlen($decoded['content']) - 1; $i > 0; $i--) {
720 720
                         $current = ord($decoded['content'][$i]);
721 721
                         for ($j = $offset; $j < 8; $j++) {
722
-                            $bits[] = (bool) ($current & (1 << $j));
722
+                            $bits[] = (bool)($current & (1 << $j));
723 723
                         }
724 724
                         $offset = 0;
725 725
                     }
@@ -757,10 +757,9 @@  discard block
 block discarded – undo
757 757
                     $temp = new BigInteger($decoded['content'], -256);
758 758
                 }
759 759
                 if (isset($mapping['mapping'])) {
760
-                    $temp = (int) $temp->toString();
760
+                    $temp = (int)$temp->toString();
761 761
                     return isset($mapping['mapping'][$temp]) ?
762
-                        $mapping['mapping'][$temp] :
763
-                        false;
762
+                        $mapping['mapping'][$temp] : false;
764 763
                 }
765 764
                 return $temp;
766 765
         }
@@ -819,7 +818,7 @@  discard block
 block discarded – undo
819 818
         switch ($tag) {
820 819
             case self::TYPE_SET:    // Children order is not important, thus process in sequence.
821 820
             case self::TYPE_SEQUENCE:
822
-                $tag|= 0x20; // set the constructed bit
821
+                $tag |= 0x20; // set the constructed bit
823 822
                 $value = '';
824 823
 
825 824
                 // ignore the min and max
@@ -831,7 +830,7 @@  discard block
 block discarded – undo
831 830
                         if ($temp === false) {
832 831
                             return false;
833 832
                         }
834
-                        $value.= $temp;
833
+                        $value .= $temp;
835 834
                     }
836 835
                     break;
837 836
                 }
@@ -874,7 +873,7 @@  discard block
 block discarded – undo
874 873
                             $temp = $subtag . substr($temp, 1);
875 874
                         }
876 875
                     }
877
-                    $value.= $temp;
876
+                    $value .= $temp;
878 877
                 }
879 878
                 break;
880 879
             case self::TYPE_CHOICE:
@@ -941,7 +940,7 @@  discard block
 block discarded – undo
941 940
             case self::TYPE_UTC_TIME:
942 941
             case self::TYPE_GENERALIZED_TIME:
943 942
                 $format = $mapping['type'] == self::TYPE_UTC_TIME ? 'y' : 'Y';
944
-                $format.= 'mdHis';
943
+                $format .= 'mdHis';
945 944
                 $value = @gmdate($format, strtotime($source)) . 'Z';
946 945
                 break;
947 946
             case self::TYPE_BIT_STRING:
@@ -971,7 +970,7 @@  discard block
 block discarded – undo
971 970
                     $bits = implode('', array_pad($bits, $size + $offset + 1, 0));
972 971
                     $bytes = explode(' ', rtrim(chunk_split($bits, 8, ' ')));
973 972
                     foreach ($bytes as $byte) {
974
-                        $value.= chr(bindec($byte));
973
+                        $value .= chr(bindec($byte));
975 974
                     }
976 975
 
977 976
                     break;
@@ -1003,7 +1002,7 @@  discard block
 block discarded – undo
1003 1002
                         }
1004 1003
                         $temp[strlen($temp) - 1] = $temp[strlen($temp) - 1] & chr(0x7F);
1005 1004
                     }
1006
-                    $value.= $temp;
1005
+                    $value .= $temp;
1007 1006
                 }
1008 1007
                 break;
1009 1008
             case self::TYPE_ANY:
@@ -1124,8 +1123,7 @@  discard block
 block discarded – undo
1124 1123
            http://www.obj-sys.com/asn1tutorial/node14.html */
1125 1124
 
1126 1125
         $pattern = $tag == self::TYPE_UTC_TIME ?
1127
-            '#(..)(..)(..)(..)(..)(..)(.*)#' :
1128
-            '#(....)(..)(..)(..)(..)(..).*([Z+-].*)$#';
1126
+            '#(..)(..)(..)(..)(..)(..)(.*)#' : '#(....)(..)(..)(..)(..)(..).*([Z+-].*)$#';
1129 1127
 
1130 1128
         preg_match($pattern, $content, $matches);
1131 1129
 
Please login to merge, or discard this patch.