Passed
Pull Request — master (#28)
by Timon
03:33
created
test/integration/Query/AbstractTableTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
src/Connection/Socket/Handshake.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.