@@ -36,7 +36,7 @@ |
||
| 36 | 36 | ); |
| 37 | 37 | |
| 38 | 38 | foreach ($files as $f) { |
| 39 | - require_once __DIR__ . "/src/$f.php"; |
|
| 39 | + require_once __DIR__."/src/$f.php"; |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | // @codeCoverageIgnoreEnd |
@@ -70,8 +70,8 @@ |
||
| 70 | 70 | while ($i < $n) { |
| 71 | 71 | $a = \substr($hexstr, $i, 2); |
| 72 | 72 | $c = \pack('H*', $a); |
| 73 | - $sbin.= $c; |
|
| 74 | - $i+=2; |
|
| 73 | + $sbin .= $c; |
|
| 74 | + $i += 2; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | return $sbin; |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | $pad = self::paddingString(Str::strlen($input), $blocksize); |
| 42 | 42 | |
| 43 | 43 | // Return input + padding |
| 44 | - return $input . $pad; |
|
| 44 | + return $input.$pad; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require __DIR__ . '/vendor/autoload.php'; |
|
| 3 | +require __DIR__.'/vendor/autoload.php'; |
|
| 4 | 4 | |
| 5 | 5 | // backward compatibility |
| 6 | 6 | if (!class_exists('\PHPUnit\Framework\TestCase')) { |
@@ -113,10 +113,10 @@ |
||
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | // Create the cypher text prefix (iv + checksum) |
| 116 | - $prefix = $iv . self::checksum($message, $iv, $key, self::RIJNDA, self::mode()); |
|
| 116 | + $prefix = $iv.self::checksum($message, $iv, $key, self::RIJNDA, self::mode()); |
|
| 117 | 117 | |
| 118 | 118 | // Return prefix + cyphertext |
| 119 | - return $prefix . $message; |
|
| 119 | + return $prefix.$message; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -105,10 +105,10 @@ |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // Create the cypher text prefix (iv + checksum) |
| 108 | - $prefix = $iv . self::checksum($message, $iv, $key, $cipher, $mode, $algo); |
|
| 108 | + $prefix = $iv.self::checksum($message, $iv, $key, $cipher, $mode, $algo); |
|
| 109 | 109 | |
| 110 | 110 | // Return prefix + cyphertext |
| 111 | - return $prefix . $message; |
|
| 111 | + return $prefix.$message; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // ... then hash other elements with previous hmac and return |
| 54 | - return \hash_hmac($algo, $sum . $iv . $mode . $cipher, $key, true); |
|
| 54 | + return \hash_hmac($algo, $sum.$iv.$mode.$cipher, $key, true); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | // Perform key derivation |
| 104 | - $key = Hash::ihmac($iv . $cipher . $mode, $password, $cost, $algo); |
|
| 104 | + $key = Hash::ihmac($iv.$cipher.$mode, $password, $cost, $algo); |
|
| 105 | 105 | |
| 106 | 106 | // Return hash normalized to key length |
| 107 | 107 | return self::hashNormalize($key, $keysize, $algo); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $hash = self::ihmac($input, $key, $cost, self::ALGO); |
| 61 | 61 | |
| 62 | 62 | // Return the salt + cost blob + hmac |
| 63 | - return $salt . self::costHash($cost, $salt, $password) . $hash; |
|
| 63 | + return $salt.self::costHash($cost, $salt, $password).$hash; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | // Convert cost to base 256 then encrypt with OTP stream cipher |
| 84 | 84 | $cost = Otp::crypt(self::dec2bin($cost), $password); |
| 85 | 85 | |
| 86 | - return $hash . $cost; |
|
| 86 | + return $hash.$cost; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $iter = abs($iter); |
| 105 | 105 | |
| 106 | 106 | for ($i = 0; $i <= $iter; $i++) { |
| 107 | - $data = \hash_hmac($algo, $data . $i . $iter, $key, true); |
|
| 107 | + $data = \hash_hmac($algo, $data.$i.$iter, $key, true); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | if ($data === false) { |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | /** |
| 136 | 136 | * Unpack dictionary |
| 137 | 137 | * |
| 138 | - * @param $data |
|
| 138 | + * @param string $data |
|
| 139 | 139 | * @return array |
| 140 | 140 | */ |
| 141 | 141 | private static function unpackDictionary($data) |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | * 101 |
| 164 | 164 | * 111 |
| 165 | 165 | * |
| 166 | - * @param $count |
|
| 166 | + * @param integer $count |
|
| 167 | 167 | * @return array |
| 168 | 168 | */ |
| 169 | 169 | private static function createBinaryIndexes($count) |
@@ -47,12 +47,12 @@ discard block |
||
| 47 | 47 | $pos = array_search(base64_encode($d), array_keys($dictionary)); |
| 48 | 48 | |
| 49 | 49 | // Append the binary to the running string |
| 50 | - $binaryString = $binaryString . $indexMap[$pos]; |
|
| 50 | + $binaryString = $binaryString.$indexMap[$pos]; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Pad the string to the byte boundry |
| 54 | 54 | while (strlen($binaryString) % 8 !== 0) { |
| 55 | - $binaryString = $binaryString . '0'; |
|
| 55 | + $binaryString = $binaryString.'0'; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | // Chunk data into bytes |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | // Return compressed data with packed dictionary |
| 68 | - return self::packDictionary($dictionary) . implode($chunks); |
|
| 68 | + return self::packDictionary($dictionary).implode($chunks); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $dictionary = array_keys($dictionary); |
| 127 | 127 | |
| 128 | 128 | foreach ($dictionary as $idx => $char) { |
| 129 | - $out = $out . chr(bindec($indexMap[$idx])) . base64_decode($char); |
|
| 129 | + $out = $out.chr(bindec($indexMap[$idx])).base64_decode($char); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | return $out; |