GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 4fe712...c697bc )
by Rich
15s
created
src/ASN1.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -45,25 +45,25 @@  discard block
 block discarded – undo
45 45
         $this->pemInitialDataCheck($keypair);
46 46
 
47 47
         $ecpemstruct = array(
48
-                             'sequence_beg' => '30',
49
-                             'total_len'    => '74',
50
-                             'int_sec_beg'  => '02',
51
-                             'int_sec_len'  => '01',
52
-                             'int_sec_val'  => '01',
53
-                             'oct_sec_beg'  => '04',
54
-                             'oct_sec_len'  => '20',
55
-                             'oct_sec_val'  => $keypair[0],
56
-                             'a0_ele_beg'   => 'a0',
57
-                             'a0_ele_len'   => '07',
58
-                             'obj_id_beg'   => '06',
59
-                             'obj_id_len'   => '05',
60
-                             'obj_id_val'   => '2b8104000a',
61
-                             'a1_ele_beg'   => 'a1',
62
-                             'a1_ele_len'   => '44',
63
-                             'bit_str_beg'  => '03',
64
-                             'bit_str_len'  => '42',
65
-                             'bit_str_val'  => '00' . $keypair[1],
66
-                             );
48
+                                'sequence_beg' => '30',
49
+                                'total_len'    => '74',
50
+                                'int_sec_beg'  => '02',
51
+                                'int_sec_len'  => '01',
52
+                                'int_sec_val'  => '01',
53
+                                'oct_sec_beg'  => '04',
54
+                                'oct_sec_len'  => '20',
55
+                                'oct_sec_val'  => $keypair[0],
56
+                                'a0_ele_beg'   => 'a0',
57
+                                'a0_ele_len'   => '07',
58
+                                'obj_id_beg'   => '06',
59
+                                'obj_id_len'   => '05',
60
+                                'obj_id_val'   => '2b8104000a',
61
+                                'a1_ele_beg'   => 'a1',
62
+                                'a1_ele_len'   => '44',
63
+                                'bit_str_beg'  => '03',
64
+                                'bit_str_len'  => '42',
65
+                                'bit_str_val'  => '00' . $keypair[1],
66
+                                );
67 67
 
68 68
         $dec = trim(implode($ecpemstruct));
69 69
 
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
         $this->pemDataLenCheck($decoded);
87 87
 
88 88
         $ecpemstruct = array(
89
-                             'oct_sec_val'  => substr($decoded, 14, 64),
90
-                             'obj_id_val'   => substr($decoded, 86, 10),
91
-                             'bit_str_val'  => substr($decoded, 106),
89
+                                'oct_sec_val'  => substr($decoded, 14, 64),
90
+                                'obj_id_val'   => substr($decoded, 86, 10),
91
+                                'bit_str_val'  => substr($decoded, 106),
92 92
                             );
93 93
 
94 94
         $this->pemOidCheck($ecpemstruct['obj_id_val']);
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
         $this->pemKeyLenCheck(array($private_key, $public_key));
100 100
 
101 101
         return array(
102
-                     'private_key' => $private_key,
103
-                     'public_key'  => $public_key
102
+                        'private_key' => $private_key,
103
+                        'public_key'  => $public_key
104 104
                     );
105 105
     }
106 106
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -62,14 +62,14 @@  discard block
 block discarded – undo
62 62
                              'a1_ele_len'   => '44',
63 63
                              'bit_str_beg'  => '03',
64 64
                              'bit_str_len'  => '42',
65
-                             'bit_str_val'  => '00' . $keypair[1],
65
+                             'bit_str_val'  => '00'.$keypair[1],
66 66
                              );
67 67
 
68 68
         $dec = trim(implode($ecpemstruct));
69 69
 
70 70
         $this->pemDataLenCheck($dec);
71 71
 
72
-        return '-----BEGIN EC PRIVATE KEY-----' . "\r\n" . chunk_split(base64_encode($this->binConv($dec)), 64) . '-----END EC PRIVATE KEY-----';
72
+        return '-----BEGIN EC PRIVATE KEY-----'."\r\n".chunk_split(base64_encode($this->binConv($dec)), 64).'-----END EC PRIVATE KEY-----';
73 73
     }
74 74
 
75 75
     /**
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $this->pemOidCheck($ecpemstruct['obj_id_val']);
95 95
 
96 96
         $private_key = $ecpemstruct['oct_sec_val'];
97
-        $public_key  = '04' . $ecpemstruct['bit_str_val'];
97
+        $public_key  = '04'.$ecpemstruct['bit_str_val'];
98 98
 
99 99
         $this->pemKeyLenCheck(array($private_key, $public_key));
100 100
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         $oid_string = '';
220 220
 
221 221
         foreach ($oid as $key => $value) {
222
-            $oid_string .= $value . ".";
222
+            $oid_string .= $value.".";
223 223
         }
224 224
 
225 225
         $oid_string = substr($oid_string, 0, -1);
Please login to merge, or discard this patch.
src/Signature.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
         $this->raw_signature     = '';
82 82
 
83 83
         $this->P = array(
84
-                         'x' => $this->Gx,
85
-                         'y' => $this->Gy
84
+                            'x' => $this->Gx,
85
+                            'y' => $this->Gy
86 86
                         );
87 87
 
88 88
         $this->keyUtil = new \Phactor\Key;
@@ -149,9 +149,9 @@  discard block
 block discarded – undo
149 149
         }
150 150
 
151 151
         $signature = array(
152
-                           'r' => $this->addHexPrefix(str_pad($this->encodeHex($r, false), 64, "0", STR_PAD_LEFT)),
153
-                           's' => $this->addHexPrefix(str_pad($this->encodeHex($s, false), 64, "0", STR_PAD_LEFT))
154
-                          );
152
+                            'r' => $this->addHexPrefix(str_pad($this->encodeHex($r, false), 64, "0", STR_PAD_LEFT)),
153
+                            's' => $this->addHexPrefix(str_pad($this->encodeHex($s, false), 64, "0", STR_PAD_LEFT))
154
+                            );
155 155
 
156 156
         $this->r_coordinate = $signature['r'];
157 157
         $this->s_coordinate = $signature['s'];
@@ -248,10 +248,10 @@  discard block
 block discarded – undo
248 248
         $retval = array(
249 249
                         'bin_r' => $this->msbCheck($r[0]) . $r,
250 250
                         'bin_s' => $this->msbCheck($s[0]) . $s
251
-                       );
251
+                        );
252 252
 
253 253
         $seq = chr(0x02) . chr(strlen($retval['bin_r'])) . $retval['bin_r'] .
254
-               chr(0x02) . chr(strlen($retval['bin_s'])) . $retval['bin_s'];
254
+                chr(0x02) . chr(strlen($retval['bin_s'])) . $retval['bin_s'];
255 255
 
256 256
         return bin2hex(chr(0x30) . chr(strlen($seq)) . $seq);
257 257
     }
@@ -270,19 +270,19 @@  discard block
 block discarded – undo
270 270
 
271 271
         /* This is the main structure we'll use for storing our parsed signature. */
272 272
         $ecdsa_struct = array(
273
-                              'sigstart' => '',
274
-                              'siglen'   => '',
275
-                              'rtype'    => '',
276
-                              'rlen'     => '',
277
-                              'roffset'  => 0,
278
-                              'r'        => '',
279
-                              'stype'    => '',
280
-                              'slen'     => '',
281
-                              'soffset'  => 0,
282
-                              's'        => '',
283
-                              'original' => '',
284
-                              'totallen' => 0
285
-                             );
273
+                                'sigstart' => '',
274
+                                'siglen'   => '',
275
+                                'rtype'    => '',
276
+                                'rlen'     => '',
277
+                                'roffset'  => 0,
278
+                                'r'        => '',
279
+                                'stype'    => '',
280
+                                'slen'     => '',
281
+                                'soffset'  => 0,
282
+                                's'        => '',
283
+                                'original' => '',
284
+                                'totallen' => 0
285
+                                );
286 286
 
287 287
         $ecdsa_struct['original'] = $signature;
288 288
         $ecdsa_struct['totallen'] = strlen($signature);
@@ -333,8 +333,8 @@  discard block
 block discarded – undo
333 333
         $this->RangeCheck($ecdsa_struct['r']);
334 334
 
335 335
         return array(
336
-                     'r' => $ecdsa_struct['r'],
337
-                     's' => $ecdsa_struct['s']
336
+                        'r' => $ecdsa_struct['r'],
337
+                        's' => $ecdsa_struct['s']
338 338
                     );
339 339
     }
340 340
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
             do {
132 132
                 /* Get the message hash and a new random number */
133
-                $e = $this->decodeHex('0x' . hash('sha256', $message));
133
+                $e = $this->decodeHex('0x'.hash('sha256', $message));
134 134
                 $k = $this->SecureRandomNumber();
135 135
 
136 136
                 /* Calculate a new curve point from R=k*G (x1,y1) */
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
             } while ($this->zeroCompare($r, $s));
148 148
 
149 149
         } catch (\Exception $e) {
150
-            throw new SignatureException("Caught the following exception in Signature::Generate(): " . $e->getMessage(), 0, $e);
150
+            throw new SignatureException("Caught the following exception in Signature::Generate(): ".$e->getMessage(), 0, $e);
151 151
         } catch (\Error $e) {
152
-            throw new SignatureException("Fatal error in Signature::Generate(): " . $e->getMessage(), 0, $e);
152
+            throw new SignatureException("Fatal error in Signature::Generate(): ".$e->getMessage(), 0, $e);
153 153
         }
154 154
 
155 155
         $signature = array(
@@ -230,9 +230,9 @@  discard block
 block discarded – undo
230 230
             return $congruent;
231 231
 
232 232
         } catch (\Exception $e) {
233
-            throw new SignatureException("Caught the following exception in Signature::Verify(): " . $e->getMessage(), 0, $e);
233
+            throw new SignatureException("Caught the following exception in Signature::Verify(): ".$e->getMessage(), 0, $e);
234 234
         } catch (\Error $e) {
235
-            throw new SignatureException("Fatal error in Signature::Verify(): " . $e->getMessage(), 0, $e);
235
+            throw new SignatureException("Fatal error in Signature::Verify(): ".$e->getMessage(), 0, $e);
236 236
         }
237 237
     }
238 238
 
@@ -251,14 +251,14 @@  discard block
 block discarded – undo
251 251
         $s = $this->binConv($this->CoordinateCheck($s));
252 252
 
253 253
         $retval = array(
254
-                        'bin_r' => $this->msbCheck($r[0]) . $r,
255
-                        'bin_s' => $this->msbCheck($s[0]) . $s
254
+                        'bin_r' => $this->msbCheck($r[0]).$r,
255
+                        'bin_s' => $this->msbCheck($s[0]).$s
256 256
                        );
257 257
 
258
-        $seq = chr(0x02) . chr(strlen($retval['bin_r'])) . $retval['bin_r'] .
259
-               chr(0x02) . chr(strlen($retval['bin_s'])) . $retval['bin_s'];
258
+        $seq = chr(0x02).chr(strlen($retval['bin_r'])).$retval['bin_r'].
259
+               chr(0x02).chr(strlen($retval['bin_s'])).$retval['bin_s'];
260 260
 
261
-        return bin2hex(chr(0x30) . chr(strlen($seq)) . $seq);
261
+        return bin2hex(chr(0x30).chr(strlen($seq)).$seq);
262 262
     }
263 263
 
264 264
     /**
Please login to merge, or discard this patch.
src/Point.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -267,9 +267,9 @@  discard block
 block discarded – undo
267 267
     public function GenerateNewPoint($ladder = true)
268 268
     {
269 269
         $P = array(
270
-                   'x' => $this->Gx,
271
-                   'y' => $this->Gy
272
-                  );
270
+                    'x' => $this->Gx,
271
+                    'y' => $this->Gy
272
+                    );
273 273
 
274 274
         do {
275 275
             $random_number = $this->SecureRandomNumber();
@@ -285,10 +285,10 @@  discard block
 block discarded – undo
285 285
         }
286 286
 
287 287
         return array(
288
-                     'random_number' => $random_number,
289
-                     'R'             => $R,
290
-                     'Rx_hex'        => $Rx_hex,
291
-                     'Ry_hex'        => $Ry_hex
288
+                        'random_number' => $random_number,
289
+                        'R'             => $R,
290
+                        'Rx_hex'        => $Rx_hex,
291
+                        'Ry_hex'        => $Ry_hex
292 292
                     );
293 293
     }
294 294
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -88,9 +88,9 @@  discard block
 block discarded – undo
88 88
             return $R;
89 89
 
90 90
         } catch (\Exception $e) {
91
-            throw new PointException("Caught the following exception in Point::pointAddW(): " . $e->getMessage(), 0, $e);
91
+            throw new PointException("Caught the following exception in Point::pointAddW(): ".$e->getMessage(), 0, $e);
92 92
         } catch (\Error $e) {
93
-            throw new PointException("Fatal error in Point::pointAddW(): " . $e->getMessage(), 0, $e);
93
+            throw new PointException("Fatal error in Point::pointAddW(): ".$e->getMessage(), 0, $e);
94 94
         }
95 95
     }
96 96
 
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
             return $R;
145 145
 
146 146
         } catch (\Exception $e) {
147
-            throw new PointException("Caught the following exception in Point::pointDoubleW(): " . $e->getMessage(), 0, $e);
147
+            throw new PointException("Caught the following exception in Point::pointDoubleW(): ".$e->getMessage(), 0, $e);
148 148
         } catch (\Error $e) {
149
-            throw new PointException("Fatal error in Point::pointDoubleW(): " . $e->getMessage(), 0, $e);
149
+            throw new PointException("Fatal error in Point::pointDoubleW(): ".$e->getMessage(), 0, $e);
150 150
         }
151 151
     }
152 152
 
@@ -197,12 +197,12 @@  discard block
 block discarded – undo
197 197
                 return true;
198 198
             }
199 199
 
200
-            throw new PointException('Point test failed! Cannot continue. I tested the point: ' . var_export($P, true) . ' but got the point: ' . var_export($test_point, true));
200
+            throw new PointException('Point test failed! Cannot continue. I tested the point: '.var_export($P, true).' but got the point: '.var_export($test_point, true));
201 201
 
202 202
         } catch (\Exception $e) {
203
-            throw new PointException("Caught the following exception in Point::pointTestW(): " . $e->getMessage(), 0, $e);
203
+            throw new PointException("Caught the following exception in Point::pointTestW(): ".$e->getMessage(), 0, $e);
204 204
         } catch (\Error $e) {
205
-            throw new PointException("Fatal error in Point::pointTestW(): " . $e->getMessage(), 0, $e);
205
+            throw new PointException("Fatal error in Point::pointTestW(): ".$e->getMessage(), 0, $e);
206 206
         }
207 207
     }
208 208
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
             $Rx_hex = str_pad($this->encodeHex($R['x']), 64, "0", STR_PAD_LEFT);
290 290
             $Ry_hex = str_pad($this->encodeHex($R['y']), 64, "0", STR_PAD_LEFT);
291 291
         } else {
292
-            throw new PointException('Point test failed! Cannot continue. I got the point: ' . var_export($R, true));
292
+            throw new PointException('Point test failed! Cannot continue. I got the point: '.var_export($R, true));
293 293
         }
294 294
 
295 295
         return array(
@@ -320,9 +320,9 @@  discard block
 block discarded – undo
320 320
             return $this->encodeHex($y);
321 321
 
322 322
         } catch (\Exception $e) {
323
-            throw new PointException("Caught the following exception in Point::calcYfromX(): " . $e->getMessage(), 0, $e);
323
+            throw new PointException("Caught the following exception in Point::calcYfromX(): ".$e->getMessage(), 0, $e);
324 324
         } catch (\Error $e) {
325
-            throw new PointException("Fatal error in Point::calcYfromX(): " . $e->getMessage(), 0, $e);
325
+            throw new PointException("Fatal error in Point::calcYfromX(): ".$e->getMessage(), 0, $e);
326 326
         }
327 327
     }
328 328
 
Please login to merge, or discard this patch.
src/BC.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@
 block discarded – undo
240 240
             case 'unk':
241 241
             throw new \Exception('Unknown number type in BC::bcNormalize().  Cannot process!');
242 242
         }
243
-        **/
243
+         **/
244 244
 
245 245
         return $a;
246 246
     }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -199,9 +199,9 @@  discard block
 block discarded – undo
199 199
             return $this->addMod($a, $modulus);
200 200
 
201 201
         } catch (Exception $e) {
202
-            throw new BCMathException("Caught the following exception in BC::inv(): " . $e->getMessage(), 0, $e);
202
+            throw new BCMathException("Caught the following exception in BC::inv(): ".$e->getMessage(), 0, $e);
203 203
         } catch (Error $e) {
204
-            throw new BCMathException("Fatal error in BC::inv(): " . $e->getMessage(), 0, $e);
204
+            throw new BCMathException("Fatal error in BC::inv(): ".$e->getMessage(), 0, $e);
205 205
         }
206 206
     }
207 207
 
@@ -225,9 +225,9 @@  discard block
 block discarded – undo
225 225
             }
226 226
 
227 227
         } catch (Exception $e) {
228
-            throw new BCMathException("Caught the following exception in BC::coprime(): " . $e->getMessage(), 0, $e);
228
+            throw new BCMathException("Caught the following exception in BC::coprime(): ".$e->getMessage(), 0, $e);
229 229
         } catch (Error $e) {
230
-            throw new BCMathException("Fatal error in BC::coprime(): " . $e->getMessage(), 0, $e);
230
+            throw new BCMathException("Fatal error in BC::coprime(): ".$e->getMessage(), 0, $e);
231 231
         }
232 232
 
233 233
         return (bccomp($a, '1') == 0) ? true : false;
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 
296 296
         list($remain, $last) = array(bcdiv(bcsub($dec, $last), '16'), bcmod($dec, '16'));
297 297
 
298
-        return ($remain == 0) ? dechex($last) : $this->convertDecToHex($remain) . dechex($last);
298
+        return ($remain == 0) ? dechex($last) : $this->convertDecToHex($remain).dechex($last);
299 299
     }
300 300
 
301 301
     /**
Please login to merge, or discard this patch.
src/Sin.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -65,12 +65,12 @@
 block discarded – undo
65 65
     public function __construct($pubkey = '', $type = '02', $version = '0F')
66 66
     {
67 67
         $this->rawHashes = array(
68
-                                 'step1' => null,
69
-                                 'step2' => null,
70
-                                 'step3' => null,
71
-                                 'step4' => null,
72
-                                 'step5' => null,
73
-                                 'step6' => null,
68
+                                    'step1' => null,
69
+                                    'step2' => null,
70
+                                    'step3' => null,
71
+                                    'step4' => null,
72
+                                    'step5' => null,
73
+                                    'step6' => null,
74 74
                                 );
75 75
 
76 76
         $this->encoded = '';
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         $this->rawHashes['step2'] = hash('ripemd160', $this->rawHashes['step1']);
131 131
 
132 132
         /* prepend the hex SINversion and hex SINtype to the hex form of the ripemd160 hash */
133
-        $this->rawHashes['step3'] = $this->SINversion . $this->SINtype . $this->rawHashes['step2'];
133
+        $this->rawHashes['step3'] = $this->SINversion.$this->SINtype.$this->rawHashes['step2'];
134 134
 
135 135
         /*
136 136
          * convert the appended hex string back to binary and double sha256 hash it leaving
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         $this->rawHashes['step5'] = substr(bin2hex($this->rawHashes['step4']), 0, 8);
143 143
 
144 144
         /* append the first 4 bytes to the fully appended string in step 3 */
145
-        $this->rawHashes['step6'] = $this->rawHashes['step3'] . $this->rawHashes['step5'];
145
+        $this->rawHashes['step6'] = $this->rawHashes['step3'].$this->rawHashes['step5'];
146 146
 
147 147
         /* finally base58 encode it */
148 148
         $this->encoded = $this->encodeBase58($this->rawHashes['step6']);
Please login to merge, or discard this patch.
src/Wallet.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -81,12 +81,12 @@  discard block
 block discarded – undo
81 81
     public function __toString()
82 82
     {
83 83
         return json_encode(array(
84
-                                 'WIF_address'       => $this->WIF_address,
85
-                                 'private_key'       => $this->private_key,
86
-                                 'network_type'      => $this->network_type,
87
-                                 'compressed_pubkey' => $this->compressed_pubkey_format,
88
-                                 'checksum'          => $this->checksum)
89
-                                 );
84
+                                    'WIF_address'       => $this->WIF_address,
85
+                                    'private_key'       => $this->private_key,
86
+                                    'network_type'      => $this->network_type,
87
+                                    'compressed_pubkey' => $this->compressed_pubkey_format,
88
+                                    'checksum'          => $this->checksum)
89
+                                    );
90 90
     }
91 91
 
92 92
     /**
@@ -382,9 +382,9 @@  discard block
 block discarded – undo
382 382
         $decoded_key = $this->stripHexPrefix($this->decodeBase58(trim($WIF_encoded_key)));
383 383
 
384 384
         list($private_key, $checksum_provided) = array(
385
-                                                       substr($decoded_key, 0, -8), 
386
-                                                       substr($decoded_key, strlen($decoded_key) - 8)
387
-                                                       );
385
+                                                        substr($decoded_key, 0, -8), 
386
+                                                        substr($decoded_key, strlen($decoded_key) - 8)
387
+                                                        );
388 388
 
389 389
         $private_key_type = substr($private_key, 0, 2);
390 390
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -330,13 +330,13 @@  discard block
 block discarded – undo
330 330
         /*
331 331
          * 2. Add a 0x80 byte in front of it for mainnet addresses or 0xef for testnet addresses.
332 332
          */
333
-        $step2 = ($network == 'main') ? '80' . $step1 : 'ef' . $step1;
333
+        $step2 = ($network == 'main') ? '80'.$step1 : 'ef'.$step1;
334 334
 
335 335
         /*
336 336
          * 3. Append a 0x01 byte after it if it should be used with compressed public keys. Nothing is appended
337 337
          *    if it is used with uncompressed public keys.
338 338
          */
339
-        $step3 = ($public_key_format == 'compressed') ? $step2 . '01' : $step2;
339
+        $step3 = ($public_key_format == 'compressed') ? $step2.'01' : $step2;
340 340
 
341 341
         /*
342 342
          * 4. Perform a SHA-256 hash on the extended key.
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
         /*
357 357
          * 7. Add the four checksum bytes from step 6 at the end of the extended key from step 3.
358 358
          */
359
-        $step7 = $step3 . $this->checksum;
359
+        $step7 = $step3.$this->checksum;
360 360
 
361 361
         /*
362 362
          * 8. Convert the result from a byte string into a Base58 string using Base58Check encoding.
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
         $private_key           = ($compressed_public_key == '01') ? substr($private_key, 0, -2) : $private_key;
398 398
 
399 399
         /* Now let's check our private key against the checksum provided. */
400
-        $new_checksum = substr(hash('sha256', hash('sha256', $this->binConv($private_key_type . $private_key . $compressed_public_key), true)), 0, 8);
400
+        $new_checksum = substr(hash('sha256', hash('sha256', $this->binConv($private_key_type.$private_key.$compressed_public_key), true)), 0, 8);
401 401
 
402 402
         if ($new_checksum != $checksum_provided) {
403 403
             throw new \Exception('Invalid WIF encoded private key! Checksum is incorrect!');
Please login to merge, or discard this patch.
src/Key.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
         $params = $params ?? [];
53 53
 
54 54
         $this->keyInfo = array(
55
-                               'private_key_hex'       => $this->keyValueCheck($params['private_key_hex']       ?? null),
56
-                               'private_key_dec'       => $this->keyValueCheck($params['private_key_dec']       ?? null),
57
-                               'public_key'            => $this->keyValueCheck($params['public_key']            ?? null),
58
-                               'public_key_compressed' => $this->keyValueCheck($params['public_key_compressed'] ?? null),
59
-                               'public_key_x'          => $this->keyValueCheck($params['public_key_x']          ?? null),
60
-                               'public_key_y'          => $this->keyValueCheck($params['public_key_y']          ?? null),
61
-                               'generation_time'       => '',
62
-                               );
55
+                                'private_key_hex'       => $this->keyValueCheck($params['private_key_hex']       ?? null),
56
+                                'private_key_dec'       => $this->keyValueCheck($params['private_key_dec']       ?? null),
57
+                                'public_key'            => $this->keyValueCheck($params['public_key']            ?? null),
58
+                                'public_key_compressed' => $this->keyValueCheck($params['public_key_compressed'] ?? null),
59
+                                'public_key_x'          => $this->keyValueCheck($params['public_key_x']          ?? null),
60
+                                'public_key_y'          => $this->keyValueCheck($params['public_key_y']          ?? null),
61
+                                'generation_time'       => '',
62
+                                );
63 63
     }
64 64
 
65 65
     /**
@@ -120,13 +120,13 @@  discard block
 block discarded – undo
120 120
         $comp_prefix = ($this->Modulo($point['R']['y'], '2') == '1') ? '03' : '02';
121 121
 
122 122
         $this->keyInfo = array(
123
-                               'private_key_hex'       => $this->encodeHex($point['random_number']),
124
-                               'private_key_dec'       => $point['random_number'],
125
-                               'public_key'            => '04' . $point['Rx_hex'] . $point['Ry_hex'],
126
-                               'public_key_compressed' => $comp_prefix . $point['Rx_hex'],
127
-                               'public_key_x'          => $point['Rx_hex'],
128
-                               'public_key_y'          => $point['Ry_hex'],
129
-                              );
123
+                                'private_key_hex'       => $this->encodeHex($point['random_number']),
124
+                                'private_key_dec'       => $point['random_number'],
125
+                                'public_key'            => '04' . $point['Rx_hex'] . $point['Ry_hex'],
126
+                                'public_key_compressed' => $comp_prefix . $point['Rx_hex'],
127
+                                'public_key_x'          => $point['Rx_hex'],
128
+                                'public_key_y'          => $point['Ry_hex'],
129
+                                );
130 130
 
131 131
         return $this->keyInfo;
132 132
     }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
         $params = $params ?? [];
53 53
 
54 54
         $this->keyInfo = array(
55
-                               'private_key_hex'       => $this->keyValueCheck($params['private_key_hex']       ?? null),
56
-                               'private_key_dec'       => $this->keyValueCheck($params['private_key_dec']       ?? null),
57
-                               'public_key'            => $this->keyValueCheck($params['public_key']            ?? null),
55
+                               'private_key_hex'       => $this->keyValueCheck($params['private_key_hex'] ?? null),
56
+                               'private_key_dec'       => $this->keyValueCheck($params['private_key_dec'] ?? null),
57
+                               'public_key'            => $this->keyValueCheck($params['public_key'] ?? null),
58 58
                                'public_key_compressed' => $this->keyValueCheck($params['public_key_compressed'] ?? null),
59
-                               'public_key_x'          => $this->keyValueCheck($params['public_key_x']          ?? null),
60
-                               'public_key_y'          => $this->keyValueCheck($params['public_key_y']          ?? null),
59
+                               'public_key_x'          => $this->keyValueCheck($params['public_key_x'] ?? null),
60
+                               'public_key_y'          => $this->keyValueCheck($params['public_key_y'] ?? null),
61 61
                                'generation_time'       => '',
62 62
                                );
63 63
     }
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
         $this->keyInfo = array(
123 123
                                'private_key_hex'       => $this->encodeHex($point['random_number']),
124 124
                                'private_key_dec'       => $point['random_number'],
125
-                               'public_key'            => '04' . $point['Rx_hex'] . $point['Ry_hex'],
126
-                               'public_key_compressed' => $comp_prefix . $point['Rx_hex'],
125
+                               'public_key'            => '04'.$point['Rx_hex'].$point['Ry_hex'],
126
+                               'public_key_compressed' => $comp_prefix.$point['Rx_hex'],
127 127
                                'public_key_x'          => $point['Rx_hex'],
128 128
                                'public_key_y'          => $point['Ry_hex'],
129 129
                               );
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         $pointX = substr($pubkey, 2);
161 161
         $pointY = substr($this->calcYfromX($pointX, $prefix), 2);
162 162
 
163
-        $parsedValue = $this->prepAndClean($pointX . $pointY);
163
+        $parsedValue = $this->prepAndClean($pointX.$pointY);
164 164
 
165 165
         return ($returnHex === false) ? $parsedValue : $this->encodeHex($parsedValue);
166 166
     }
Please login to merge, or discard this patch.
src/Number.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         $secure_random_number = '';
184 184
 
185 185
         while (strlen($secure_random_number) < 78) {
186
-            $secure_random_number = $secure_random_number . hexdec(bin2hex(openssl_random_pseudo_bytes(4, $cstrong)));
186
+            $secure_random_number = $secure_random_number.hexdec(bin2hex(openssl_random_pseudo_bytes(4, $cstrong)));
187 187
         }
188 188
 
189 189
         if ($secure_random_number === false || $cstrong === false) {
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
      */
217 217
     private function addHexPrefix($hex)
218 218
     {
219
-        return (substr($hex, 0, 2) != '0x') ? '0x' . $hex : $hex;
219
+        return (substr($hex, 0, 2) != '0x') ? '0x'.$hex : $hex;
220 220
     }
221 221
 
222 222
     /**
Please login to merge, or discard this patch.
src/Math.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -270,9 +270,9 @@  discard block
 block discarded – undo
270 270
             return $bin;
271 271
 
272 272
         } catch (\Exception $e) {
273
-            throw new MathException("Caught the following exception in Math::D2B(): " . $e->getMessage(), 0, $e);
273
+            throw new MathException("Caught the following exception in Math::D2B(): ".$e->getMessage(), 0, $e);
274 274
         } catch (\Error $e) {
275
-            throw new MathException("Fatal error in Math::D2B(): " . $e->getMessage(), 0, $e);
275
+            throw new MathException("Fatal error in Math::D2B(): ".$e->getMessage(), 0, $e);
276 276
         }
277 277
     }
278 278
 
@@ -323,15 +323,15 @@  discard block
 block discarded – undo
323 323
             $return  = strrev($this->encodeValue($hex, '58'));
324 324
 
325 325
             for ($i = 0; $i < strlen($orighex) && substr($orighex, $i, 2) == '00'; $i += 2) {
326
-                $return = '1' . $return;
326
+                $return = '1'.$return;
327 327
             }
328 328
 
329 329
             return $return;
330 330
 
331 331
         } catch (\Exception $e) {
332
-            throw new MathException("Caught the following exception in Math::encodeBase58(): " . $e->getMessage(), 0, $e);
332
+            throw new MathException("Caught the following exception in Math::encodeBase58(): ".$e->getMessage(), 0, $e);
333 333
         } catch (\Error $e) {
334
-            throw new MathException("Fatal error in Math::encodeBase58(): " . $e->getMessage(), 0, $e);
334
+            throw new MathException("Fatal error in Math::encodeBase58(): ".$e->getMessage(), 0, $e);
335 335
         }
336 336
     }
337 337
 
@@ -360,15 +360,15 @@  discard block
 block discarded – undo
360 360
             $return = $this->encodeHex($return);
361 361
 
362 362
             for ($i = 0; $i < strlen($origbase58) && $origbase58[$i] == '1'; $i++) {
363
-                $return = '00' . $return;
363
+                $return = '00'.$return;
364 364
             }
365 365
 
366
-            return (strlen($return) % 2 != 0) ? '0' . $return : $return;
366
+            return (strlen($return) % 2 != 0) ? '0'.$return : $return;
367 367
 
368 368
         } catch (\Exception $e) {
369
-            throw new MathException("Caught the following exception in Math::decodeBase58(): " . $e->getMessage(), 0, $e);
369
+            throw new MathException("Caught the following exception in Math::decodeBase58(): ".$e->getMessage(), 0, $e);
370 370
         } catch (\Error $e) {
371
-            throw new MathException("Fatal error in Math::decodeBase58(): " . $e->getMessage(), 0, $e);
371
+            throw new MathException("Fatal error in Math::decodeBase58(): ".$e->getMessage(), 0, $e);
372 372
         }
373 373
     }
374 374
 
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
         foreach ($params as $key => $value) {
408 408
             if ($this->numberCheck($value) === false) {
409 409
                 $caller = debug_backtrace();
410
-                throw new MathException('Empty or invalid parameters passed to ' . $caller[count($caller) - 1]['function'] . ' function.');
410
+                throw new MathException('Empty or invalid parameters passed to '.$caller[count($caller) - 1]['function'].' function.');
411 411
             }
412 412
         }
413 413
     }
@@ -434,15 +434,15 @@  discard block
 block discarded – undo
434 434
                 $qq  = $this->math->div($val, $base);
435 435
                 $rem = $this->math->mod($val, $base);
436 436
                 $val = $qq;
437
-                $new = $new . $digits[$rem];
437
+                $new = $new.$digits[$rem];
438 438
             }
439 439
 
440 440
             return $new;
441 441
 
442 442
         } catch (\Exception $e) {
443
-            throw new MathException("Caught the following exception in Math::encodeValue(): " . $e->getMessage(), 0, $e);
443
+            throw new MathException("Caught the following exception in Math::encodeValue(): ".$e->getMessage(), 0, $e);
444 444
         } catch (\Error $e) {
445
-            throw new MathException("Fatal error in Math::encodeValue(): " . $e->getMessage(), 0, $e);
445
+            throw new MathException("Fatal error in Math::encodeValue(): ".$e->getMessage(), 0, $e);
446 446
         }
447 447
     }
448 448
 
Please login to merge, or discard this patch.