Passed
Pull Request — master (#1136)
by Abdul Malik
11:17
created
src/Bridge/Stempler/src/StemplerCache.php 2 patches
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -67,15 +67,18 @@  discard block
 block discarded – undo
67 67
     public function isFresh(string $key): bool
68 68
     {
69 69
         $mapFilename = $this->mapFilename($key);
70
-        if (!$this->files->exists($mapFilename)) {
70
+        if (!$this->files->exists($mapFilename))
71
+        {
71 72
             return false;
72 73
         }
73 74
 
74 75
         $time = $this->files->time($this->filename($key));
75 76
 
76 77
         $files = (array)include $mapFilename;
77
-        foreach ($files as $file) {
78
-            if ($this->files->time($file) > $time) {
78
+        foreach ($files as $file)
79
+        {
80
+            if ($this->files->time($file) > $time)
81
+            {
79 82
                 // some partial has changed
80 83
                 return false;
81 84
             }
@@ -92,12 +95,14 @@  discard block
 block discarded – undo
92 95
     public function delete(string $key): void
93 96
     {
94 97
         $filename = $this->filename($key);
95
-        if ($this->files->exists($filename)) {
98
+        if ($this->files->exists($filename))
99
+        {
96 100
             $this->files->delete($filename);
97 101
         }
98 102
 
99 103
         $mapFilename = $this->mapFilename($key);
100
-        if ($this->files->exists($mapFilename)) {
104
+        if ($this->files->exists($mapFilename))
105
+        {
101 106
             $this->files->delete($mapFilename);
102 107
         }
103 108
     }
@@ -110,7 +115,8 @@  discard block
 block discarded – undo
110 115
     public function load(string $key): void
111 116
     {
112 117
         $filename = $this->filename($key);
113
-        if ($this->files->exists($filename)) {
118
+        if ($this->files->exists($filename))
119
+        {
114 120
             include_once $filename;
115 121
         }
116 122
     }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     public function __construct(
13 13
         private readonly string $directory,
14 14
         private readonly FilesInterface $files = new Files()
15
-    ) {
15
+    ){
16 16
     }
17 17
 
18 18
     /**
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
     public function isFresh(string $key): bool
44 44
     {
45 45
         $mapFilename = $this->mapFilename($key);
46
-        if (!$this->files->exists($mapFilename)) {
46
+        if (!$this->files->exists($mapFilename)){
47 47
             return false;
48 48
         }
49 49
 
50 50
         $time = $this->files->time($this->filename($key));
51 51
 
52 52
         $files = (array)include $mapFilename;
53
-        foreach ($files as $file) {
54
-            if ($this->files->time($file) > $time) {
53
+        foreach ($files as $file){
54
+            if ($this->files->time($file) > $time){
55 55
                 // some partial has changed
56 56
                 return false;
57 57
             }
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
     public function delete(string $key): void
67 67
     {
68 68
         $filename = $this->filename($key);
69
-        if ($this->files->exists($filename)) {
69
+        if ($this->files->exists($filename)){
70 70
             $this->files->delete($filename);
71 71
         }
72 72
 
73 73
         $mapFilename = $this->mapFilename($key);
74
-        if ($this->files->exists($mapFilename)) {
74
+        if ($this->files->exists($mapFilename)){
75 75
             $this->files->delete($mapFilename);
76 76
         }
77 77
     }
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     public function load(string $key): void
83 83
     {
84 84
         $filename = $this->filename($key);
85
-        if ($this->files->exists($filename)) {
85
+        if ($this->files->exists($filename)){
86 86
             include_once $filename;
87 87
         }
88 88
     }
Please login to merge, or discard this patch.
src/Bridge/Stempler/tests/EngineTest.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
     {
58 58
         $s = $this->getStempler();
59 59
 
60
-        try {
60
+        try{
61 61
             $s->get('echo', new ViewContext())->render();
62
-        } catch (RenderException $e) {
62
+        }catch (RenderException $e){
63 63
             $t = $e->getUserTrace()[0];
64 64
 
65 65
             $this->assertSame(2, $t['line']);
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
     {
72 72
         $s = $this->getStempler();
73 73
 
74
-        try {
74
+        try{
75 75
             $s->get('other:echo-in', new ViewContext())->render();
76
-        } catch (RenderException $e) {
76
+        }catch (RenderException $e){
77 77
             $t = $e->getUserTrace();
78 78
             $this->assertCount(2, $t);
79 79
 
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
     {
90 90
         $twig = $this->getStempler();
91 91
 
92
-        try {
92
+        try{
93 93
             $twig->get('other:bad', new ViewContext());
94
-        } catch (CompileException $e) {
94
+        }catch (CompileException $e){
95 95
             $this->assertStringContainsString('bad.dark.php', $e->getFile());
96 96
         }
97 97
     }
Please login to merge, or discard this patch.
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -57,9 +57,12 @@  discard block
 block discarded – undo
57 57
     {
58 58
         $s = $this->getStempler();
59 59
 
60
-        try {
60
+        try
61
+        {
61 62
             $s->get('echo', new ViewContext())->render();
62
-        } catch (RenderException $e) {
63
+        }
64
+        catch (RenderException $e)
65
+        {
63 66
             $t = $e->getUserTrace()[0];
64 67
 
65 68
             $this->assertSame(2, $t['line']);
@@ -71,9 +74,12 @@  discard block
 block discarded – undo
71 74
     {
72 75
         $s = $this->getStempler();
73 76
 
74
-        try {
77
+        try
78
+        {
75 79
             $s->get('other:echo-in', new ViewContext())->render();
76
-        } catch (RenderException $e) {
80
+        }
81
+        catch (RenderException $e)
82
+        {
77 83
             $t = $e->getUserTrace();
78 84
             $this->assertCount(2, $t);
79 85
 
@@ -89,9 +95,12 @@  discard block
 block discarded – undo
89 95
     {
90 96
         $twig = $this->getStempler();
91 97
 
92
-        try {
98
+        try
99
+        {
93 100
             $twig->get('other:bad', new ViewContext());
94
-        } catch (CompileException $e) {
101
+        }
102
+        catch (CompileException $e)
103
+        {
95 104
             $this->assertStringContainsString('bad.dark.php', $e->getFile());
96 105
         }
97 106
     }
Please login to merge, or discard this patch.
src/Bridge/Stempler/tests/CacheTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,13 +35,13 @@
 block discarded – undo
35 35
 
36 36
     public function testCache(): void
37 37
     {
38
-        $this->assertCount(0, $this->files->getFiles(__DIR__ . '/cache/', '*.php'));
38
+        $this->assertCount(0, $this->files->getFiles(__DIR__.'/cache/', '*.php'));
39 39
 
40 40
         $s = $this->getStempler();
41 41
         $this->assertSame('test', $s->get('test', new ViewContext())->render([]));
42
-        $this->assertCount(2, $this->files->getFiles(__DIR__ . '/cache/', '*.php'));
42
+        $this->assertCount(2, $this->files->getFiles(__DIR__.'/cache/', '*.php'));
43 43
 
44 44
         $s->reset('test', new ViewContext());
45
-        $this->assertCount(0, $this->files->getFiles(__DIR__ . '/../cache/', '*.php'));
45
+        $this->assertCount(0, $this->files->getFiles(__DIR__.'/../cache/', '*.php'));
46 46
     }
47 47
 }
Please login to merge, or discard this patch.
src/Bridge/Stempler/tests/config/views.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@
 block discarded – undo
3 3
 return [
4 4
     'cache'        => [
5 5
         'enabled'   => false,
6
-        'directory' => __DIR__ . '/../cache'
6
+        'directory' => __DIR__.'/../cache'
7 7
     ],
8 8
     'namespaces'   => [
9
-        'default'    => [__DIR__ . '/../fixtures/default'],
10
-        'other'      => [__DIR__ . '/../fixtures/other'],
11
-        'extensions' => [__DIR__ . '/../fixtures/other/extensions'],
9
+        'default'    => [__DIR__.'/../fixtures/default'],
10
+        'other'      => [__DIR__.'/../fixtures/other'],
11
+        'extensions' => [__DIR__.'/../fixtures/other/extensions'],
12 12
     ],
13 13
     'dependencies' => [],
14 14
     'engines'      => []
Please login to merge, or discard this patch.
src/Framework/Domain/GuardInterceptor.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,8 @@
 block discarded – undo
41 41
     {
42 42
         $permission = $this->permissions->getPermission($controller, $action);
43 43
 
44
-        if ($permission->ok && !$this->guard->allows($permission->permission, $parameters)) {
44
+        if ($permission->ok && !$this->guard->allows($permission->permission, $parameters))
45
+        {
45 46
             throw new ControllerException($permission->message, $permission->code);
46 47
         }
47 48
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@
 block discarded – undo
18 18
     public function __construct(
19 19
         private readonly GuardInterface $guard,
20 20
         private readonly PermissionsProviderInterface $permissions
21
-    ) {
21
+    ){
22 22
     }
23 23
 
24 24
     public function process(string $controller, string $action, array $parameters, CoreInterface $core): mixed
25 25
     {
26 26
         $permission = $this->permissions->getPermission($controller, $action);
27 27
 
28
-        if ($permission->ok && !$this->guard->allows($permission->permission, $parameters)) {
28
+        if ($permission->ok && !$this->guard->allows($permission->permission, $parameters)){
29 29
             throw new ControllerException($permission->message, $permission->code);
30 30
         }
31 31
 
Please login to merge, or discard this patch.
src/SendIt/tests/RenderTest.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,8 @@
 block discarded – undo
33 33
 
34 34
     public function tearDown(): void
35 35
     {
36
-        foreach (glob(__DIR__ . '/App/runtime/cache/views/*.php') as $file) {
36
+        foreach (glob(__DIR__ . '/App/runtime/cache/views/*.php') as $file)
37
+        {
37 38
             @unlink($file);
38 39
         }
39 40
     }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@
 block discarded – undo
19 19
     public function setUp(): void
20 20
     {
21 21
         $this->app = App::create([
22
-            'root' => __DIR__ . '/App',
23
-            'app'  => __DIR__ . '/App'
22
+            'root' => __DIR__.'/App',
23
+            'app'  => __DIR__.'/App'
24 24
         ])->run();
25 25
     }
26 26
 
27 27
     public function tearDown(): void
28 28
     {
29
-        foreach (glob(__DIR__ . '/App/runtime/cache/views/*.php') as $file) {
29
+        foreach (glob(__DIR__.'/App/runtime/cache/views/*.php') as $file){
30 30
             @unlink($file);
31 31
         }
32 32
     }
Please login to merge, or discard this patch.
src/Storage/src/File/UriResolvableTrait.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     {
32 32
         $resolver = $this->getResolver();
33 33
 
34
-        if ($resolver === null) {
34
+        if ($resolver === null){
35 35
             throw new \LogicException('Can not generate public url: File not accessible by HTTP');
36 36
         }
37 37
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@
 block discarded – undo
31 31
     {
32 32
         $resolver = $this->getResolver();
33 33
 
34
-        if ($resolver === null) {
34
+        if ($resolver === null)
35
+        {
35 36
             throw new \LogicException('Can not generate public url: File not accessible by HTTP');
36 37
         }
37 38
 
Please login to merge, or discard this patch.
src/Storage/tests/TestCase.php 2 patches
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,20 +63,26 @@
 block discarded – undo
63 63
         );
64 64
 
65 65
         /** @var \SplFileInfo $file */
66
-        foreach($iterator as $file) {
67
-            if ($file->getFilename() === '.gitignore') {
66
+        foreach($iterator as $file)
67
+        {
68
+            if ($file->getFilename() === '.gitignore')
69
+            {
68 70
                 continue;
69 71
             }
70 72
 
71 73
             \error_clear_last();
72 74
 
73
-            if ($file->isDir()) {
75
+            if ($file->isDir())
76
+            {
74 77
                 @\rmdir($file->getPathname());
75
-            } else {
78
+            }
79
+            else
80
+            {
76 81
                 @\unlink($file->getPathname());
77 82
             }
78 83
 
79
-            if ($error = \error_get_last()) {
84
+            if ($error = \error_get_last())
85
+            {
80 86
                 $prefix = 'An error occurred while clear temporary local storage directory: ';
81 87
                 $this->addWarning($prefix . $error['message']);
82 88
             }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     /**
15 15
      * @var string
16 16
      */
17
-    protected const LOCAL_STORAGE_DIRECTORY = __DIR__ . '/storage';
17
+    protected const LOCAL_STORAGE_DIRECTORY = __DIR__.'/storage';
18 18
 
19 19
     /**
20 20
      * @var BucketInterface
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         );
39 39
 
40 40
         $this->second = Bucket::fromAdapter(
41
-            new LocalFilesystemAdapter(self::LOCAL_STORAGE_DIRECTORY . '/second')
41
+            new LocalFilesystemAdapter(self::LOCAL_STORAGE_DIRECTORY.'/second')
42 42
         );
43 43
     }
44 44
 
@@ -63,22 +63,22 @@  discard block
 block discarded – undo
63 63
         );
64 64
 
65 65
         /** @var \SplFileInfo $file */
66
-        foreach($iterator as $file) {
67
-            if ($file->getFilename() === '.gitignore') {
66
+        foreach ($iterator as $file){
67
+            if ($file->getFilename() === '.gitignore'){
68 68
                 continue;
69 69
             }
70 70
 
71 71
             \error_clear_last();
72 72
 
73
-            if ($file->isDir()) {
73
+            if ($file->isDir()){
74 74
                 @\rmdir($file->getPathname());
75
-            } else {
75
+            }else{
76 76
                 @\unlink($file->getPathname());
77 77
             }
78 78
 
79
-            if ($error = \error_get_last()) {
79
+            if ($error = \error_get_last()){
80 80
                 $prefix = 'An error occurred while clear temporary local storage directory: ';
81
-                $this->addWarning($prefix . $error['message']);
81
+                $this->addWarning($prefix.$error['message']);
82 82
             }
83 83
         }
84 84
     }
Please login to merge, or discard this patch.
src/Storage/tests/StorageTestCase.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -151,7 +151,8 @@
 block discarded – undo
151 151
 
152 152
         $actual = '';
153 153
         $stream = $this->local->getStream('file.txt');
154
-        while (!\feof($stream)) {
154
+        while (!\feof($stream))
155
+        {
155 156
             $actual .= \fread($stream, 256);
156 157
         }
157 158
         \fclose($stream);
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
     public function testVisibility(): void
58 58
     {
59 59
         $this->markTestSkipped(
60
-            'This test [' . __FUNCTION__ . '] returns incorrect visibility ' .
61
-                'of files on Windows OS. ' .
60
+            'This test ['.__FUNCTION__.'] returns incorrect visibility '.
61
+                'of files on Windows OS. '.
62 62
             'It is required to understand the situation'
63 63
         );
64 64
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
         $actual = '';
153 153
         $stream = $this->local->getStream('file.txt');
154
-        while (!\feof($stream)) {
154
+        while (!\feof($stream)){
155 155
             $actual .= \fread($stream, 256);
156 156
         }
157 157
         \fclose($stream);
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
      */
176 176
     public function testLastModified(): void
177 177
     {
178
-        $now = (int) \floor(\microtime(true));
178
+        $now = (int)\floor(\microtime(true));
179 179
 
180 180
         $this->local->create('file.txt');
181 181
         $before = $this->local->getLastModified('file.txt');
Please login to merge, or discard this patch.