Passed
Pull Request — master (#1111)
by Aleksei
11:44
created
src/Reactor/src/TraitDeclaration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
         $this->element = new TraitType($name);
24 24
     }
25 25
 
26
-    public function addMember(Method|Property|Constant|TraitUse $member): static
26
+    public function addMember(Method | Property | Constant | TraitUse $member): static
27 27
     {
28 28
         $this->element->addMember($member->getElement());
29 29
 
Please login to merge, or discard this patch.
src/Reactor/src/Writer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 {
11 11
     public function __construct(
12 12
         protected FilesInterface $files
13
-    ) {
13
+    ){
14 14
     }
15 15
 
16 16
     public function write(string $filename, FileDeclaration $file): bool
Please login to merge, or discard this patch.
src/Reactor/src/FileDeclaration.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,8 @@
 block discarded – undo
63 63
 
64 64
     public function addNamespace(string|PhpNamespace $namespace): PhpNamespace
65 65
     {
66
-        if ($namespace instanceof PhpNamespace) {
66
+        if ($namespace instanceof PhpNamespace)
67
+        {
67 68
             $this->element->addNamespace($namespace->getElement());
68 69
 
69 70
             return $namespace;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@
 block discarded – undo
53 53
         return self::fromElement((new Factory())->fromCode(\file_get_contents($reflection->getFileName())));
54 54
     }
55 55
 
56
-    public function addNamespace(string|PhpNamespace $namespace): PhpNamespace
56
+    public function addNamespace(string | PhpNamespace $namespace): PhpNamespace
57 57
     {
58
-        if ($namespace instanceof PhpNamespace) {
58
+        if ($namespace instanceof PhpNamespace){
59 59
             $this->element->addNamespace($namespace->getElement());
60 60
 
61 61
             return $namespace;
Please login to merge, or discard this patch.
src/Validation/tests/ValidationProviderTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 
12 12
 final class ValidationProviderTest extends TestCase
13 13
 {
14
-    private m\MockInterface|InvokerInterface $invoker;
14
+    private m\MockInterface | InvokerInterface $invoker;
15 15
     private ValidationProvider $provider;
16 16
 
17 17
     protected function setUp(): void
Please login to merge, or discard this patch.
src/Validation/src/ValidatorInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     /**
15 15
      * Create validator copy with new data set.
16 16
      */
17
-    public function withData(array|object $data): ValidatorInterface;
17
+    public function withData(array | object $data): ValidatorInterface;
18 18
 
19 19
     /**
20 20
      * Receive field from context data or return default value.
Please login to merge, or discard this patch.
src/Validation/src/ValidationInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,5 +17,5 @@
 block discarded – undo
17 17
      * @param mixed         $context Validation context (available for checkers and validation
18 18
      *                               methods but is not validated).
19 19
      */
20
-    public function validate(array|object $data, array $rules, mixed $context = null): ValidatorInterface;
20
+    public function validate(array | object $data, array $rules, mixed $context = null): ValidatorInterface;
21 21
 }
Please login to merge, or discard this patch.
src/Framework/Session/SectionScope.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
     public function __construct(
10 10
         private readonly SessionScope $session,
11 11
         private readonly string $name
12
-    ) {
12
+    ){
13 13
     }
14 14
 
15 15
     /**
Please login to merge, or discard this patch.
src/Framework/Auth/Session/Token.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
     public function __construct(
12 12
         private readonly string $id,
13 13
         private readonly array $payload,
14
-        private readonly ?\DateTimeInterface $expiresAt = null
15
-    ) {
14
+        private readonly ? \DateTimeInterface $expiresAt = null
15
+    ){
16 16
     }
17 17
 
18 18
     public function getID(): string
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     public static function unpack(array $data): Token
51 51
     {
52 52
         $expiresAt = null;
53
-        if ($data['expiresAt'] !== null) {
53
+        if ($data['expiresAt'] !== null){
54 54
             $expiresAt = (new \DateTimeImmutable())->setTimestamp($data['expiresAt']);
55 55
         }
56 56
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,8 @@
 block discarded – undo
50 50
     public static function unpack(array $data): Token
51 51
     {
52 52
         $expiresAt = null;
53
-        if ($data['expiresAt'] !== null) {
53
+        if ($data['expiresAt'] !== null)
54
+        {
54 55
             $expiresAt = (new \DateTimeImmutable())->setTimestamp($data['expiresAt']);
55 56
         }
56 57
 
Please login to merge, or discard this patch.
src/Framework/Auth/Session/TokenStorage.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,28 +19,28 @@  discard block
 block discarded – undo
19 19
 
20 20
     public function __construct(
21 21
         private readonly SessionScope $session
22
-    ) {
22
+    ){
23 23
     }
24 24
 
25 25
     public function load(string $id): ?TokenInterface
26 26
     {
27
-        try {
27
+        try{
28 28
             $tokenData = $this->session->getSection(self::SESSION_SECTION)->get('token');
29
-            if ($tokenData === null) {
29
+            if ($tokenData === null){
30 30
                 return null;
31 31
             }
32 32
 
33 33
             $token = Token::unpack($tokenData);
34
-        } catch (\Throwable $e) {
35
-            throw new TokenStorageException('Unable to load session token', (int) $e->getCode(), $e);
34
+        }catch (\Throwable $e){
35
+            throw new TokenStorageException('Unable to load session token', (int)$e->getCode(), $e);
36 36
         }
37 37
 
38
-        if (!\hash_equals($token->getID(), $id)) {
38
+        if (!\hash_equals($token->getID(), $id)){
39 39
             return null;
40 40
         }
41 41
 
42 42
         $expiresAt = $token->getExpiresAt();
43
-        if ($expiresAt !== null && $expiresAt < new \DateTimeImmutable()) {
43
+        if ($expiresAt !== null && $expiresAt < new \DateTimeImmutable()){
44 44
             $this->delete($token);
45 45
             return null;
46 46
         }
@@ -50,13 +50,13 @@  discard block
 block discarded – undo
50 50
 
51 51
     public function create(array $payload, \DateTimeInterface $expiresAt = null): TokenInterface
52 52
     {
53
-        try {
53
+        try{
54 54
             $token = new Token($this->randomHash(128), $payload, $expiresAt);
55 55
             $this->session->getSection(self::SESSION_SECTION)->set('token', $token->pack());
56 56
 
57 57
             return $token;
58
-        } catch (\Throwable $e) {
59
-            throw new TokenStorageException('Unable to create session token', (int) $e->getCode(), $e);
58
+        }catch (\Throwable $e){
59
+            throw new TokenStorageException('Unable to create session token', (int)$e->getCode(), $e);
60 60
         }
61 61
     }
62 62
 
Please login to merge, or discard this patch.
Braces   +16 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,23 +24,29 @@  discard block
 block discarded – undo
24 24
 
25 25
     public function load(string $id): ?TokenInterface
26 26
     {
27
-        try {
27
+        try
28
+        {
28 29
             $tokenData = $this->session->getSection(self::SESSION_SECTION)->get('token');
29
-            if ($tokenData === null) {
30
+            if ($tokenData === null)
31
+            {
30 32
                 return null;
31 33
             }
32 34
 
33 35
             $token = Token::unpack($tokenData);
34
-        } catch (\Throwable $e) {
36
+        }
37
+        catch (\Throwable $e)
38
+        {
35 39
             throw new TokenStorageException('Unable to load session token', (int) $e->getCode(), $e);
36 40
         }
37 41
 
38
-        if (!\hash_equals($token->getID(), $id)) {
42
+        if (!\hash_equals($token->getID(), $id))
43
+        {
39 44
             return null;
40 45
         }
41 46
 
42 47
         $expiresAt = $token->getExpiresAt();
43
-        if ($expiresAt !== null && $expiresAt < new \DateTimeImmutable()) {
48
+        if ($expiresAt !== null && $expiresAt < new \DateTimeImmutable())
49
+        {
44 50
             $this->delete($token);
45 51
             return null;
46 52
         }
@@ -50,12 +56,15 @@  discard block
 block discarded – undo
50 56
 
51 57
     public function create(array $payload, \DateTimeInterface $expiresAt = null): TokenInterface
52 58
     {
53
-        try {
59
+        try
60
+        {
54 61
             $token = new Token($this->randomHash(128), $payload, $expiresAt);
55 62
             $this->session->getSection(self::SESSION_SECTION)->set('token', $token->pack());
56 63
 
57 64
             return $token;
58
-        } catch (\Throwable $e) {
65
+        }
66
+        catch (\Throwable $e)
67
+        {
59 68
             throw new TokenStorageException('Unable to create session token', (int) $e->getCode(), $e);
60 69
         }
61 70
     }
Please login to merge, or discard this patch.