Passed
Pull Request — master (#1207)
by Aleksei
10:55
created
src/Framework/Session/SessionScope.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
     public function __construct(
24 24
         #[Proxy] private readonly ContainerInterface $container,
25
-    ) {}
25
+    ){}
26 26
 
27 27
     /**
28 28
      * @throws ScopeException
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
      */
96 96
     public function getActiveSession(): SessionInterface
97 97
     {
98
-        try {
98
+        try{
99 99
             return $this->container->get(SessionInterface::class);
100
-        } catch (NotFoundExceptionInterface $e) {
100
+        }catch (NotFoundExceptionInterface $e){
101 101
             throw new ScopeException(
102 102
                 'Unable to receive active session, invalid request scope',
103 103
                 $e->getCode(),
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  discard block
 block discarded – undo
22 22
 
23 23
     public function __construct(
24 24
         #[Proxy] private readonly ContainerInterface $container,
25
-    ) {}
25
+    ) {
26
+}
26 27
 
27 28
     /**
28 29
      * @throws ScopeException
@@ -95,9 +96,12 @@  discard block
 block discarded – undo
95 96
      */
96 97
     public function getActiveSession(): SessionInterface
97 98
     {
98
-        try {
99
+        try
100
+        {
99 101
             return $this->container->get(SessionInterface::class);
100
-        } catch (NotFoundExceptionInterface $e) {
102
+        }
103
+        catch (NotFoundExceptionInterface $e)
104
+        {
101 105
             throw new ScopeException(
102 106
                 'Unable to receive active session, invalid request scope',
103 107
                 $e->getCode(),
Please login to merge, or discard this patch.
src/Framework/Session/SectionScope.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     public function __construct(
13 13
         private readonly SessionScope $session,
14 14
         private readonly string $name,
15
-    ) {}
15
+    ){}
16 16
 
17 17
     public function getIterator(): \Traversable
18 18
     {
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,8 @@
 block discarded – undo
12 12
     public function __construct(
13 13
         private readonly SessionScope $session,
14 14
         private readonly string $name,
15
-    ) {}
15
+    ) {
16
+}
16 17
 
17 18
     public function getIterator(): \Traversable
18 19
     {
Please login to merge, or discard this patch.
src/Framework/Module/PublisherInterface.php 1 patch
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         string $filename,
26 26
         string $destination,
27 27
         string $mergeMode = self::FOLLOW,
28
-        int $mode = FilesInterface::READONLY,
28
+        int $mode = FilesInterface::readonly,
29 29
     ): void;
30 30
 
31 31
     /**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         string $directory,
38 38
         string $destination,
39 39
         string $mergeMode = self::REPLACE,
40
-        int $mode = FilesInterface::READONLY,
40
+        int $mode = FilesInterface::readonly,
41 41
     ): void;
42 42
 
43 43
     /**
@@ -45,5 +45,5 @@  discard block
 block discarded – undo
45 45
      *
46 46
      * @throws PublishException
47 47
      */
48
-    public function ensureDirectory(string $directory, int $mode = FilesInterface::READONLY): void;
48
+    public function ensureDirectory(string $directory, int $mode = FilesInterface::readonly): void;
49 49
 }
Please login to merge, or discard this patch.
src/Framework/Module/Exception/PublishException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,4 +4,4 @@
 block discarded – undo
4 4
 
5 5
 namespace Spiral\Module\Exception;
6 6
 
7
-class PublishException extends \RuntimeException {}
7
+class PublishException extends \RuntimeException{}
Please login to merge, or discard this patch.
src/Framework/Module/Publisher.php 3 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 {
16 16
     public function __construct(
17 17
         private readonly FilesInterface $files,
18
-    ) {}
18
+    ){}
19 19
 
20 20
     public function publish(
21 21
         string $filename,
@@ -23,17 +23,17 @@  discard block
 block discarded – undo
23 23
         string $mergeMode = self::FOLLOW,
24 24
         int $mode = FilesInterface::READONLY,
25 25
     ): void {
26
-        if (!$this->files->isFile($filename)) {
26
+        if (!$this->files->isFile($filename)){
27 27
             throw new PublishException(\sprintf("Given '%s' is not valid file", $filename));
28 28
         }
29 29
 
30
-        if ($this->files->exists($destination)) {
31
-            if ($this->files->md5($destination) === $this->files->md5($filename)) {
30
+        if ($this->files->exists($destination)){
31
+            if ($this->files->md5($destination) === $this->files->md5($filename)){
32 32
                 //Nothing to do
33 33
                 return;
34 34
             }
35 35
 
36
-            if ($mergeMode === self::FOLLOW) {
36
+            if ($mergeMode === self::FOLLOW){
37 37
                 return;
38 38
             }
39 39
         }
@@ -52,17 +52,17 @@  discard block
 block discarded – undo
52 52
         string $mergeMode = self::REPLACE,
53 53
         int $mode = FilesInterface::READONLY,
54 54
     ): void {
55
-        if (!$this->files->isDirectory($directory)) {
55
+        if (!$this->files->isDirectory($directory)){
56 56
             throw new PublishException(\sprintf("Given '%s' is not valid directory", $directory));
57 57
         }
58 58
 
59 59
         $finder = new Finder();
60 60
         $finder->files()->in($directory);
61 61
 
62
-        foreach ($finder->getIterator() as $file) {
62
+        foreach ($finder->getIterator() as $file){
63 63
             $this->publish(
64
-                (string) $file,
65
-                $destination . '/' . $file->getRelativePathname(),
64
+                (string)$file,
65
+                $destination.'/'.$file->getRelativePathname(),
66 66
                 $mergeMode,
67 67
                 $mode,
68 68
             );
Please login to merge, or discard this patch.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -15,7 +15,8 @@  discard block
 block discarded – undo
15 15
 {
16 16
     public function __construct(
17 17
         private readonly FilesInterface $files,
18
-    ) {}
18
+    ) {
19
+}
19 20
 
20 21
     public function publish(
21 22
         string $filename,
@@ -23,17 +24,21 @@  discard block
 block discarded – undo
23 24
         string $mergeMode = self::FOLLOW,
24 25
         int $mode = FilesInterface::READONLY,
25 26
     ): void {
26
-        if (!$this->files->isFile($filename)) {
27
+        if (!$this->files->isFile($filename))
28
+        {
27 29
             throw new PublishException(\sprintf("Given '%s' is not valid file", $filename));
28 30
         }
29 31
 
30
-        if ($this->files->exists($destination)) {
31
-            if ($this->files->md5($destination) === $this->files->md5($filename)) {
32
+        if ($this->files->exists($destination))
33
+        {
34
+            if ($this->files->md5($destination) === $this->files->md5($filename))
35
+            {
32 36
                 //Nothing to do
33 37
                 return;
34 38
             }
35 39
 
36
-            if ($mergeMode === self::FOLLOW) {
40
+            if ($mergeMode === self::FOLLOW)
41
+            {
37 42
                 return;
38 43
             }
39 44
         }
@@ -52,14 +57,16 @@  discard block
 block discarded – undo
52 57
         string $mergeMode = self::REPLACE,
53 58
         int $mode = FilesInterface::READONLY,
54 59
     ): void {
55
-        if (!$this->files->isDirectory($directory)) {
60
+        if (!$this->files->isDirectory($directory))
61
+        {
56 62
             throw new PublishException(\sprintf("Given '%s' is not valid directory", $directory));
57 63
         }
58 64
 
59 65
         $finder = new Finder();
60 66
         $finder->files()->in($directory);
61 67
 
62
-        foreach ($finder->getIterator() as $file) {
68
+        foreach ($finder->getIterator() as $file)
69
+        {
63 70
             $this->publish(
64 71
                 (string) $file,
65 72
                 $destination . '/' . $file->getRelativePathname(),
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         string $filename,
22 22
         string $destination,
23 23
         string $mergeMode = self::FOLLOW,
24
-        int $mode = FilesInterface::READONLY,
24
+        int $mode = FilesInterface::readonly,
25 25
     ): void {
26 26
         if (!$this->files->isFile($filename)) {
27 27
             throw new PublishException(\sprintf("Given '%s' is not valid file", $filename));
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         string $directory,
51 51
         string $destination,
52 52
         string $mergeMode = self::REPLACE,
53
-        int $mode = FilesInterface::READONLY,
53
+        int $mode = FilesInterface::readonly,
54 54
     ): void {
55 55
         if (!$this->files->isDirectory($directory)) {
56 56
             throw new PublishException(\sprintf("Given '%s' is not valid directory", $directory));
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         }
70 70
     }
71 71
 
72
-    public function ensureDirectory(string $directory, int $mode = FilesInterface::READONLY): void
72
+    public function ensureDirectory(string $directory, int $mode = FilesInterface::readonly): void
73 73
     {
74 74
         $this->files->ensureDirectory($directory, $mode);
75 75
     }
Please login to merge, or discard this patch.
src/Framework/Snapshots/StorageSnapshooter.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public function __construct(
10 10
         private readonly StorageSnapshot $storageSnapshot,
11
-    ) {}
11
+    ){}
12 12
 
13 13
     public function register(\Throwable $e): SnapshotInterface
14 14
     {
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,8 @@
 block discarded – undo
8 8
 {
9 9
     public function __construct(
10 10
         private readonly StorageSnapshot $storageSnapshot,
11
-    ) {}
11
+    ) {
12
+}
12 13
 
13 14
     public function register(\Throwable $e): SnapshotInterface
14 15
     {
Please login to merge, or discard this patch.
src/Framework/Snapshots/FileSnapshooter.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public function __construct(
10 10
         private readonly FileSnapshot $fileSnapshot,
11
-    ) {}
11
+    ){}
12 12
 
13 13
     public function register(\Throwable $e): SnapshotInterface
14 14
     {
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,8 @@
 block discarded – undo
8 8
 {
9 9
     public function __construct(
10 10
         private readonly FileSnapshot $fileSnapshot,
11
-    ) {}
11
+    ) {
12
+}
12 13
 
13 14
     public function register(\Throwable $e): SnapshotInterface
14 15
     {
Please login to merge, or discard this patch.
src/Framework/Cookies/CookieManager.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 {
23 23
     public function __construct(
24 24
         #[Proxy] private readonly ContainerInterface $container,
25
-    ) {}
25
+    ){}
26 26
 
27 27
     /**
28 28
      * @throws ScopeException
@@ -149,9 +149,9 @@  discard block
 block discarded – undo
149 149
      */
150 150
     private function getRequest(): ServerRequestInterface
151 151
     {
152
-        try {
152
+        try{
153 153
             return $this->container->get(ServerRequestInterface::class);
154
-        } catch (NotFoundExceptionInterface $e) {
154
+        }catch (NotFoundExceptionInterface $e){
155 155
             throw new ScopeException('Unable to receive active request', $e->getCode(), $e);
156 156
         }
157 157
     }
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
      */
162 162
     private function getCookieQueue(): CookieQueue
163 163
     {
164
-        try {
164
+        try{
165 165
             return $this->container->get(CookieQueue::class);
166
-        } catch (NotFoundExceptionInterface $e) {
166
+        }catch (NotFoundExceptionInterface $e){
167 167
             throw new ScopeException('Unable to receive cookie queue, invalid request scope', $e->getCode(), $e);
168 168
         }
169 169
     }
Please login to merge, or discard this patch.
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  discard block
 block discarded – undo
22 22
 {
23 23
     public function __construct(
24 24
         #[Proxy] private readonly ContainerInterface $container,
25
-    ) {}
25
+    ) {
26
+}
26 27
 
27 28
     /**
28 29
      * @throws ScopeException
@@ -149,9 +150,12 @@  discard block
 block discarded – undo
149 150
      */
150 151
     private function getRequest(): ServerRequestInterface
151 152
     {
152
-        try {
153
+        try
154
+        {
153 155
             return $this->container->get(ServerRequestInterface::class);
154
-        } catch (NotFoundExceptionInterface $e) {
156
+        }
157
+        catch (NotFoundExceptionInterface $e)
158
+        {
155 159
             throw new ScopeException('Unable to receive active request', $e->getCode(), $e);
156 160
         }
157 161
     }
@@ -161,9 +165,12 @@  discard block
 block discarded – undo
161 165
      */
162 166
     private function getCookieQueue(): CookieQueue
163 167
     {
164
-        try {
168
+        try
169
+        {
165 170
             return $this->container->get(CookieQueue::class);
166
-        } catch (NotFoundExceptionInterface $e) {
171
+        }
172
+        catch (NotFoundExceptionInterface $e)
173
+        {
167 174
             throw new ScopeException('Unable to receive cookie queue, invalid request scope', $e->getCode(), $e);
168 175
         }
169 176
     }
Please login to merge, or discard this patch.
src/Framework/Auth/TokenStorageScope.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 {
20 20
     public function __construct(
21 21
         #[Proxy] private readonly ContainerInterface $container,
22
-    ) {}
22
+    ){}
23 23
 
24 24
     /**
25 25
      * Load token by id, must return null if token not found.
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
      */
57 57
     private function getTokenStorage(): TokenStorageInterface
58 58
     {
59
-        try {
59
+        try{
60 60
             return $this->container->get(TokenStorageInterface::class);
61
-        } catch (NotFoundExceptionInterface $e) {
61
+        }catch (NotFoundExceptionInterface $e){
62 62
             throw new ScopeException('Unable to resolve token storage, invalid scope', $e->getCode(), $e);
63 63
         }
64 64
     }
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,8 @@  discard block
 block discarded – undo
19 19
 {
20 20
     public function __construct(
21 21
         #[Proxy] private readonly ContainerInterface $container,
22
-    ) {}
22
+    ) {
23
+}
23 24
 
24 25
     /**
25 26
      * Load token by id, must return null if token not found.
@@ -56,9 +57,12 @@  discard block
 block discarded – undo
56 57
      */
57 58
     private function getTokenStorage(): TokenStorageInterface
58 59
     {
59
-        try {
60
+        try
61
+        {
60 62
             return $this->container->get(TokenStorageInterface::class);
61
-        } catch (NotFoundExceptionInterface $e) {
63
+        }
64
+        catch (NotFoundExceptionInterface $e)
65
+        {
62 66
             throw new ScopeException('Unable to resolve token storage, invalid scope', $e->getCode(), $e);
63 67
         }
64 68
     }
Please login to merge, or discard this patch.