Passed
Pull Request — master (#1739)
by Gabriel
60:28
created
src/Infrastructure/UserDataKeyGenerator.php 3 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -7,31 +7,31 @@
 block discarded – undo
7 7
 
8 8
 class UserDataKeyGenerator
9 9
 {
10
-    private const START_TIME = '2020-01-01 0:00:00Z';
11
-
12
-    private string $masterKey;
13
-    private Clock $time;
14
-
15
-    public function __construct( string $masterKey, Clock $time )
16
-    {
17
-        $this->masterKey = $masterKey;
18
-        $this->time = $time;
19
-    }
20
-
21
-    public function getDailyKey(): string {
22
-        $now = $this->time->now();
23
-        $daysSince2020 = abs( $now->diff( new \DateTimeImmutable(self::START_TIME) )->days );
24
-        return sodium_bin2base64(
25
-            sodium_crypto_kdf_derive_from_key(
26
-                64,
27
-                $daysSince2020,
28
-                $now->format("Ymd"),
29
-                sodium_base642bin( $this->masterKey, SODIUM_BASE64_VARIANT_ORIGINAL )
30
-            ),
31
-            SODIUM_BASE64_VARIANT_ORIGINAL
32
-        );
33
-
34
-    }
10
+	private const START_TIME = '2020-01-01 0:00:00Z';
11
+
12
+	private string $masterKey;
13
+	private Clock $time;
14
+
15
+	public function __construct( string $masterKey, Clock $time )
16
+	{
17
+		$this->masterKey = $masterKey;
18
+		$this->time = $time;
19
+	}
20
+
21
+	public function getDailyKey(): string {
22
+		$now = $this->time->now();
23
+		$daysSince2020 = abs( $now->diff( new \DateTimeImmutable(self::START_TIME) )->days );
24
+		return sodium_bin2base64(
25
+			sodium_crypto_kdf_derive_from_key(
26
+				64,
27
+				$daysSince2020,
28
+				$now->format("Ymd"),
29
+				sodium_base642bin( $this->masterKey, SODIUM_BASE64_VARIANT_ORIGINAL )
30
+			),
31
+			SODIUM_BASE64_VARIANT_ORIGINAL
32
+		);
33
+
34
+	}
35 35
 
36 36
 
37 37
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 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 WMDE\Fundraising\Frontend\Infrastructure;
5 5
 
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
20 20
 
21 21
     public function getDailyKey(): string {
22 22
         $now = $this->time->now();
23
-        $daysSince2020 = abs( $now->diff( new \DateTimeImmutable(self::START_TIME) )->days );
23
+        $daysSince2020 = abs( $now->diff( new \DateTimeImmutable( self::START_TIME ) )->days );
24 24
         return sodium_bin2base64(
25 25
             sodium_crypto_kdf_derive_from_key(
26 26
                 64,
27 27
                 $daysSince2020,
28
-                $now->format("Ymd"),
28
+                $now->format( "Ymd" ),
29 29
                 sodium_base642bin( $this->masterKey, SODIUM_BASE64_VARIANT_ORIGINAL )
30 30
             ),
31 31
             SODIUM_BASE64_VARIANT_ORIGINAL
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,15 +5,13 @@
 block discarded – undo
5 5
 
6 6
 use WMDE\Clock\Clock;
7 7
 
8
-class UserDataKeyGenerator
9
-{
8
+class UserDataKeyGenerator {
10 9
     private const START_TIME = '2020-01-01 0:00:00Z';
11 10
 
12 11
     private string $masterKey;
13 12
     private Clock $time;
14 13
 
15
-    public function __construct( string $masterKey, Clock $time )
16
-    {
14
+    public function __construct( string $masterKey, Clock $time ) {
17 15
         $this->masterKey = $masterKey;
18 16
         $this->time = $time;
19 17
     }
Please login to merge, or discard this patch.