@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace TBolier\RethinkQL\IntegrationTest\Query; |
| 5 | 5 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | ->table('tabletest') |
| 38 | 38 | ->insert([ |
| 39 | 39 | 'id' => $documentId, |
| 40 | - 'title' => 'Test document ' . $documentId, |
|
| 40 | + 'title' => 'Test document '.$documentId, |
|
| 41 | 41 | 'description' => 'A document description.', |
| 42 | 42 | ]) |
| 43 | 43 | ->run(); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * @license http://www.apache.org/licenses/ Apache License 2.0 |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | private function pkbdf2Hmac(string $password, string $salt, int $iterations): string |
| 148 | 148 | { |
| 149 | - $t = hash_hmac('sha256', $salt . "\x00\x00\x00\x01", $password, true); |
|
| 149 | + $t = hash_hmac('sha256', $salt."\x00\x00\x00\x01", $password, true); |
|
| 150 | 150 | $u = $t; |
| 151 | 151 | for ($i = 0; $i < $iterations - 1; ++$i) { |
| 152 | 152 | $t = hash_hmac('sha256', $t, $password, true); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | private function createHandshakeMessage(): string |
| 163 | 163 | { |
| 164 | 164 | $this->myR = base64_encode(openssl_random_pseudo_bytes(18)); |
| 165 | - $this->clientFirstMessage = 'n=' . $this->username . ',r=' . $this->myR; |
|
| 165 | + $this->clientFirstMessage = 'n='.$this->username.',r='.$this->myR; |
|
| 166 | 166 | |
| 167 | 167 | $binaryVersion = pack('V', $this->version); |
| 168 | 168 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | [ |
| 175 | 175 | 'protocol_version' => $this->protocolVersion, |
| 176 | 176 | 'authentication_method' => 'SCRAM-SHA-256', |
| 177 | - 'authentication' => 'n,,' . $this->clientFirstMessage, |
|
| 177 | + 'authentication' => 'n,,'.$this->clientFirstMessage, |
|
| 178 | 178 | ] |
| 179 | 179 | ) |
| 180 | 180 | . \chr(0); |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | |
| 198 | 198 | $json = json_decode($response, true); |
| 199 | 199 | if ($json['success'] === false) { |
| 200 | - throw new Exception('Handshake failed: ' . $json["error"]); |
|
| 200 | + throw new Exception('Handshake failed: '.$json["error"]); |
|
| 201 | 201 | } |
| 202 | 202 | if ($this->protocolVersion > $json['max_protocol_version'] |
| 203 | 203 | || $this->protocolVersion < $json['min_protocol_version']) { |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | { |
| 219 | 219 | $json = json_decode($response, true); |
| 220 | 220 | if ($json['success'] === false) { |
| 221 | - throw new Exception('Handshake failed: ' . $json['error']); |
|
| 221 | + throw new Exception('Handshake failed: '.$json['error']); |
|
| 222 | 222 | } |
| 223 | 223 | $serverFirstMessage = $json['authentication']; |
| 224 | 224 | $authentication = []; |
@@ -231,15 +231,15 @@ discard block |
||
| 231 | 231 | throw new Exception('Invalid nonce from server.'); |
| 232 | 232 | } |
| 233 | 233 | $salt = base64_decode($authentication['s']); |
| 234 | - $iterations = (int)$authentication['i']; |
|
| 234 | + $iterations = (int) $authentication['i']; |
|
| 235 | 235 | |
| 236 | - $clientFinalMessageWithoutProof = 'c=biws,r=' . $serverR; |
|
| 236 | + $clientFinalMessageWithoutProof = 'c=biws,r='.$serverR; |
|
| 237 | 237 | $saltedPassword = $this->pkbdf2Hmac($this->password, $salt, $iterations); |
| 238 | 238 | $clientKey = hash_hmac('sha256', 'Client Key', $saltedPassword, true); |
| 239 | 239 | $storedKey = hash('sha256', $clientKey, true); |
| 240 | 240 | |
| 241 | 241 | $authMessage = |
| 242 | - $this->clientFirstMessage . ',' . $serverFirstMessage . ',' . $clientFinalMessageWithoutProof; |
|
| 242 | + $this->clientFirstMessage.','.$serverFirstMessage.','.$clientFinalMessageWithoutProof; |
|
| 243 | 243 | |
| 244 | 244 | $clientSignature = hash_hmac('sha256', $authMessage, $storedKey, true); |
| 245 | 245 | |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | return |
| 255 | 255 | json_encode( |
| 256 | 256 | [ |
| 257 | - 'authentication' => $clientFinalMessageWithoutProof . ',p=' . base64_encode($clientProof), |
|
| 257 | + 'authentication' => $clientFinalMessageWithoutProof.',p='.base64_encode($clientProof), |
|
| 258 | 258 | ] |
| 259 | 259 | ) |
| 260 | 260 | . \chr(0); |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | { |
| 270 | 270 | $json = json_decode($response, true); |
| 271 | 271 | if ($json['success'] === false) { |
| 272 | - throw new Exception('Handshake failed: ' . $json['error']); |
|
| 272 | + throw new Exception('Handshake failed: '.$json['error']); |
|
| 273 | 273 | } |
| 274 | 274 | $authentication = []; |
| 275 | 275 | foreach (explode(',', $json['authentication']) as $var) { |