Test Failed
Branch ci (e543e4)
by Florian
03:15
created
src/Authenticator/HttpDigestAuthenticator.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
     protected function getDigestFromApacheHeaders(?string $digest)
203 203
     {
204 204
         if (empty($digest) && function_exists('apache_request_headers')) {
205
-            $headers = (array)apache_request_headers();
205
+            $headers = (array) apache_request_headers();
206 206
             if (!empty($headers['Authorization']) && strpos($headers['Authorization'], 'Digest ') === 0) {
207 207
                 $digest = substr($headers['Authorization'], 7);
208 208
             }
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
     public function generateResponseHash(array $digest, string $password, string $method): string
250 250
     {
251 251
         return md5(
252
-            $password .
253
-            ':' . $digest['nonce'] . ':' . $digest['nc'] . ':' . $digest['cnonce'] . ':' . $digest['qop'] . ':' .
254
-            md5($method . ':' . $digest['uri'])
252
+            $password.
253
+            ':'.$digest['nonce'].':'.$digest['nc'].':'.$digest['cnonce'].':'.$digest['qop'].':'.
254
+            md5($method.':'.$digest['uri'])
255 255
         );
256 256
     }
257 257
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
      */
266 266
     public static function generatePasswordHash(string $username, string $password, string $realm): string
267 267
     {
268
-        return md5($username . ':' . $realm . ':' . $password);
268
+        return md5($username.':'.$realm.':'.$password);
269 269
     }
270 270
 
271 271
     /**
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
             $formattedOptions[] = $this->formatOptions($key, $value);
316 316
         }
317 317
 
318
-        return ['WWW-Authenticate' => 'Digest ' . implode(',', $formattedOptions)];
318
+        return ['WWW-Authenticate' => 'Digest '.implode(',', $formattedOptions)];
319 319
     }
320 320
 
321 321
     /**
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
     protected function generateNonce(): string
327 327
     {
328 328
         $expiryTime = microtime(true) + $this->nonceLifetime;
329
-        $signatureValue = hash_hmac('sha1', $expiryTime . ':' . $this->secret, $this->secret);
330
-        $nonceValue = $expiryTime . ':' . $signatureValue;
329
+        $signatureValue = hash_hmac('sha1', $expiryTime.':'.$this->secret, $this->secret);
330
+        $nonceValue = $expiryTime.':'.$signatureValue;
331 331
 
332 332
         return base64_encode($nonceValue);
333 333
     }
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
             return false;
354 354
         }
355 355
         $secret = $this->secret;
356
-        $check = hash_hmac('sha1', $expires . ':' . $secret, $secret);
356
+        $check = hash_hmac('sha1', $expires.':'.$secret, $secret);
357 357
 
358 358
         return hash_equals($check, $checksum);
359 359
     }
Please login to merge, or discard this patch.