Passed
Push — master ( 9f2c4f...e942df )
by Aleksei
17:57 queued 05:15
created
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.
src/Storage/tests/ManagerTestCase.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     {
93 93
         $this->expectException(InvalidArgumentException::class);
94 94
         $this->expectExceptionMessage(
95
-            'URI argument must be a valid URI in ' .
95
+            'URI argument must be a valid URI in '.
96 96
             '"[STORAGE]://[PATH_TO_FILE]" format, but `test://` given'
97 97
         );
98 98
 
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
     public function testVisibility(): void
158 158
     {
159 159
         $this->markTestSkipped(
160
-            'This test [' . __FUNCTION__ . '] returns incorrect visibility ' .
161
-                'of files on Windows OS. ' .
160
+            'This test ['.__FUNCTION__.'] returns incorrect visibility '.
161
+                'of files on Windows OS. '.
162 162
             'It is required to understand the situation'
163 163
         );
164 164
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 
258 258
         $actual = '';
259 259
         $stream = $this->manager->getStream('file.txt');
260
-        while (!\feof($stream)) {
260
+        while (!\feof($stream)){
261 261
             $actual .= \fread($stream, 256);
262 262
         }
263 263
         \fclose($stream);
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -257,7 +257,8 @@
 block discarded – undo
257 257
 
258 258
         $actual = '';
259 259
         $stream = $this->manager->getStream('file.txt');
260
-        while (!\feof($stream)) {
260
+        while (!\feof($stream))
261
+        {
261 262
             $actual .= \fread($stream, 256);
262 263
         }
263 264
         \fclose($stream);
Please login to merge, or discard this patch.
src/Storage/tests/FileTestCase.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -190,7 +190,8 @@
 block discarded – undo
190 190
 
191 191
         $actual = '';
192 192
         $stream = $source->getStream();
193
-        while (!\feof($stream)) {
193
+        while (!\feof($stream))
194
+        {
194 195
             $actual .= \fread($stream, 256);
195 196
         }
196 197
         \fclose($stream);
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
     public function testVisibility(): void
82 82
     {
83 83
         $this->markTestSkipped(
84
-            'This test [' . __FUNCTION__ . '] returns incorrect visibility ' .
85
-                'of files on Windows OS. ' .
84
+            'This test ['.__FUNCTION__.'] returns incorrect visibility '.
85
+                'of files on Windows OS. '.
86 86
             'It is required to understand the situation'
87 87
         );
88 88
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
         $actual = '';
192 192
         $stream = $source->getStream();
193
-        while (!\feof($stream)) {
193
+        while (!\feof($stream)){
194 194
             $actual .= \fread($stream, 256);
195 195
         }
196 196
         \fclose($stream);
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
      */
217 217
     public function testLastModified(): void
218 218
     {
219
-        $now = (int) \floor(\microtime(true));
219
+        $now = (int)\floor(\microtime(true));
220 220
 
221 221
         $file = $this->local->file('file.txt')
222 222
             ->create()
Please login to merge, or discard this patch.
src/Prototype/src/ClassNode/ConstructorParam.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,13 +56,13 @@
 block discarded – undo
56 56
         $stmt->name = $parameter->getName();
57 57
 
58 58
         $type = $parameter->getType();
59
-        if ($type instanceof \ReflectionNamedType) {
59
+        if ($type instanceof \ReflectionNamedType){
60 60
             $stmt->type = Type::create($type->getName());
61 61
             $stmt->builtIn = $type->isBuiltin();
62 62
             $stmt->nullable = $type->allowsNull();
63 63
         }
64 64
 
65
-        if ($parameter->isDefaultValueAvailable()) {
65
+        if ($parameter->isDefaultValueAvailable()){
66 66
             $stmt->hasDefault = true;
67 67
             $stmt->default = $parameter->getDefaultValue();
68 68
         }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,13 +56,15 @@
 block discarded – undo
56 56
         $stmt->name = $parameter->getName();
57 57
 
58 58
         $type = $parameter->getType();
59
-        if ($type instanceof \ReflectionNamedType) {
59
+        if ($type instanceof \ReflectionNamedType)
60
+        {
60 61
             $stmt->type = Type::create($type->getName());
61 62
             $stmt->builtIn = $type->isBuiltin();
62 63
             $stmt->nullable = $type->allowsNull();
63 64
         }
64 65
 
65
-        if ($parameter->isDefaultValueAvailable()) {
66
+        if ($parameter->isDefaultValueAvailable())
67
+        {
66 68
             $stmt->hasDefault = true;
67 69
             $stmt->default = $parameter->getDefaultValue();
68 70
         }
Please login to merge, or discard this patch.
src/Storage/src/File.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,8 @@
 block discarded – undo
64 64
     {
65 65
         $name = $this->storage->getName();
66 66
 
67
-        if ($name === null) {
67
+        if ($name === null)
68
+        {
68 69
             return $this->getPathname();
69 70
         }
70 71
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         private readonly BucketInterface $storage,
20 20
         private readonly string $pathname,
21 21
         private readonly ?UriResolverInterface $resolver = null
22
-    ) {
22
+    ){
23 23
     }
24 24
 
25 25
     public function __toString(): string
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     {
32 32
         $name = $this->storage->getName();
33 33
 
34
-        if ($name === null) {
34
+        if ($name === null){
35 35
             return $this->getPathname();
36 36
         }
37 37
 
Please login to merge, or discard this patch.
src/Storage/src/Bucket/ReadableTrait.php 3 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
         #[ExpectedValues(valuesFromClass: \League\Flysystem\Visibility::class)]
137 137
         string $visibility
138 138
     ): string {
139
-        return $visibility === \League\Flysystem\Visibility::PUBLIC
139
+        return $visibility === \League\Flysystem\Visibility::public
140 140
             ? Visibility::VISIBILITY_PUBLIC
141 141
             : Visibility::VISIBILITY_PRIVATE;
142 142
     }
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
     {
30 30
         $fs = $this->getOperator();
31 31
 
32
-        try {
32
+        try{
33 33
             return $fs->fileExists($pathname);
34
-        } catch (FilesystemException $e) {
34
+        }catch (FilesystemException $e){
35 35
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
36 36
         }
37 37
     }
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
     {
44 44
         $fs = $this->getOperator();
45 45
 
46
-        try {
46
+        try{
47 47
             return $fs->read($pathname);
48
-        } catch (FilesystemException $e) {
48
+        }catch (FilesystemException $e){
49 49
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
50 50
         }
51 51
     }
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
     {
58 58
         $fs = $this->getOperator();
59 59
 
60
-        try {
60
+        try{
61 61
             return $fs->readStream($pathname);
62
-        } catch (FilesystemException $e) {
62
+        }catch (FilesystemException $e){
63 63
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
64 64
         }
65 65
     }
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
     {
72 72
         $fs = $this->getOperator();
73 73
 
74
-        try {
74
+        try{
75 75
             return $fs->lastModified($pathname);
76
-        } catch (FilesystemException $e) {
76
+        }catch (FilesystemException $e){
77 77
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
78 78
         }
79 79
     }
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
     {
86 86
         $fs = $this->getOperator();
87 87
 
88
-        try {
88
+        try{
89 89
             return $fs->fileSize($pathname);
90
-        } catch (FilesystemException $e) {
90
+        }catch (FilesystemException $e){
91 91
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
92 92
         }
93 93
     }
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
     {
100 100
         $fs = $this->getOperator();
101 101
 
102
-        try {
102
+        try{
103 103
             return $fs->mimeType($pathname);
104
-        } catch (FilesystemException $e) {
104
+        }catch (FilesystemException $e){
105 105
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
106 106
         }
107 107
     }
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
     {
115 115
         $fs = $this->getOperator();
116 116
 
117
-        try {
117
+        try{
118 118
             return $this->fromFlysystemVisibility(
119 119
                 $fs->visibility($pathname)
120 120
             );
121
-        } catch (FilesystemException $e) {
121
+        }catch (FilesystemException $e){
122 122
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
123 123
         }
124 124
     }
Please login to merge, or discard this patch.
Braces   +35 added lines, -14 removed lines patch added patch discarded remove patch
@@ -29,9 +29,12 @@  discard block
 block discarded – undo
29 29
     {
30 30
         $fs = $this->getOperator();
31 31
 
32
-        try {
32
+        try
33
+        {
33 34
             return $fs->fileExists($pathname);
34
-        } catch (FilesystemException $e) {
35
+        }
36
+        catch (FilesystemException $e)
37
+        {
35 38
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
36 39
         }
37 40
     }
@@ -43,9 +46,12 @@  discard block
 block discarded – undo
43 46
     {
44 47
         $fs = $this->getOperator();
45 48
 
46
-        try {
49
+        try
50
+        {
47 51
             return $fs->read($pathname);
48
-        } catch (FilesystemException $e) {
52
+        }
53
+        catch (FilesystemException $e)
54
+        {
49 55
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
50 56
         }
51 57
     }
@@ -57,9 +63,12 @@  discard block
 block discarded – undo
57 63
     {
58 64
         $fs = $this->getOperator();
59 65
 
60
-        try {
66
+        try
67
+        {
61 68
             return $fs->readStream($pathname);
62
-        } catch (FilesystemException $e) {
69
+        }
70
+        catch (FilesystemException $e)
71
+        {
63 72
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
64 73
         }
65 74
     }
@@ -71,9 +80,12 @@  discard block
 block discarded – undo
71 80
     {
72 81
         $fs = $this->getOperator();
73 82
 
74
-        try {
83
+        try
84
+        {
75 85
             return $fs->lastModified($pathname);
76
-        } catch (FilesystemException $e) {
86
+        }
87
+        catch (FilesystemException $e)
88
+        {
77 89
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
78 90
         }
79 91
     }
@@ -85,9 +97,12 @@  discard block
 block discarded – undo
85 97
     {
86 98
         $fs = $this->getOperator();
87 99
 
88
-        try {
100
+        try
101
+        {
89 102
             return $fs->fileSize($pathname);
90
-        } catch (FilesystemException $e) {
103
+        }
104
+        catch (FilesystemException $e)
105
+        {
91 106
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
92 107
         }
93 108
     }
@@ -99,9 +114,12 @@  discard block
 block discarded – undo
99 114
     {
100 115
         $fs = $this->getOperator();
101 116
 
102
-        try {
117
+        try
118
+        {
103 119
             return $fs->mimeType($pathname);
104
-        } catch (FilesystemException $e) {
120
+        }
121
+        catch (FilesystemException $e)
122
+        {
105 123
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
106 124
         }
107 125
     }
@@ -114,11 +132,14 @@  discard block
 block discarded – undo
114 132
     {
115 133
         $fs = $this->getOperator();
116 134
 
117
-        try {
135
+        try
136
+        {
118 137
             return $this->fromFlysystemVisibility(
119 138
                 $fs->visibility($pathname)
120 139
             );
121
-        } catch (FilesystemException $e) {
140
+        }
141
+        catch (FilesystemException $e)
142
+        {
122 143
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
123 144
         }
124 145
     }
Please login to merge, or discard this patch.
src/Storage/src/Bucket/WritableTrait.php 3 patches
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -166,8 +166,8 @@
 block discarded – undo
166 166
         string $visibility
167 167
     ): string {
168 168
         return ($visibility === Visibility::VISIBILITY_PUBLIC)
169
-            ? \League\Flysystem\Visibility::PUBLIC
170
-            : \League\Flysystem\Visibility::PRIVATE;
169
+            ? \League\Flysystem\Visibility::public
170
+            : \League\Flysystem\Visibility::private;
171 171
     }
172 172
 
173 173
     /**
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 {
20 20
     public function create(string $pathname, array $config = []): FileInterface
21 21
     {
22
-        if ($this instanceof ReadableInterface && !$this->exists($pathname)) {
22
+        if ($this instanceof ReadableInterface && !$this->exists($pathname)){
23 23
             return $this->write($pathname, '', $config);
24 24
         }
25 25
 
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 
33 33
         $fs = $this->getOperator();
34 34
 
35
-        try {
36
-            switch (true) {
35
+        try{
36
+            switch (true){
37 37
                 case \is_object($content):
38 38
                 case \is_string($content):
39 39
                     $fs->write($pathname, (string)$content, $config);
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
                     $message = 'Content must be a resource stream or stringable type, but %s passed';
48 48
                     throw new \InvalidArgumentException(\sprintf($message, \get_debug_type($content)));
49 49
             }
50
-        } catch (FilesystemException $e) {
50
+        }catch (FilesystemException $e){
51 51
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
52 52
         }
53 53
 
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
     ): FileInterface {
62 62
         $fs = $this->getOperator();
63 63
 
64
-        try {
64
+        try{
65 65
             $fs->setVisibility($pathname, $this->toFlysystemVisibility($visibility));
66
-        } catch (FilesystemException $e) {
66
+        }catch (FilesystemException $e){
67 67
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
68 68
         }
69 69
 
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
     ): FileInterface {
79 79
         $fs = $this->getOperator();
80 80
 
81
-        if ($storage === null || $storage === $this) {
82
-            try {
81
+        if ($storage === null || $storage === $this){
82
+            try{
83 83
                 $fs->copy($source, $destination, $config);
84
-            } catch (FilesystemException $e) {
84
+            }catch (FilesystemException $e){
85 85
                 throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
86 86
             }
87 87
 
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
     ): FileInterface {
100 100
         $fs = $this->getOperator();
101 101
 
102
-        if ($storage === null || $storage === $this) {
103
-            try {
102
+        if ($storage === null || $storage === $this){
103
+            try{
104 104
                 $fs->move($source, $destination, $config);
105
-            } catch (FilesystemException $e) {
105
+            }catch (FilesystemException $e){
106 106
                 throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
107 107
             }
108 108
 
@@ -120,14 +120,14 @@  discard block
 block discarded – undo
120 120
     {
121 121
         $fs = $this->getOperator();
122 122
 
123
-        try {
123
+        try{
124 124
             $fs->delete($pathname);
125 125
 
126
-            if ($clean) {
126
+            if ($clean){
127 127
                 /** @psalm-suppress InternalMethod */
128 128
                 $this->deleteEmptyDirectories($this->getParentDirectory($pathname));
129 129
             }
130
-        } catch (FilesystemException $e) {
130
+        }catch (FilesystemException $e){
131 131
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
132 132
         }
133 133
     }
@@ -182,18 +182,18 @@  discard block
 block discarded – undo
182 182
      */
183 183
     private function deleteEmptyDirectories(string $directory): void
184 184
     {
185
-        if (!$this->hasParentDirectory($directory)) {
185
+        if (!$this->hasParentDirectory($directory)){
186 186
             return;
187 187
         }
188 188
 
189 189
         $fs = $this->getOperator();
190 190
 
191
-        try {
192
-            if (!$this->hasFiles($directory)) {
191
+        try{
192
+            if (!$this->hasFiles($directory)){
193 193
                 $fs->deleteDirectory($directory);
194 194
                 $this->deleteEmptyDirectories($this->getParentDirectory($directory));
195 195
             }
196
-        } catch (FilesystemException $e) {
196
+        }catch (FilesystemException $e){
197 197
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
198 198
         }
199 199
     }
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
     {
216 216
         $fs = $this->getOperator();
217 217
 
218
-        foreach ($fs->listContents($directory) as $_) {
218
+        foreach ($fs->listContents($directory) as $_){
219 219
             return true;
220 220
         }
221 221
 
Please login to merge, or discard this patch.
Braces   +46 added lines, -20 removed lines patch added patch discarded remove patch
@@ -19,7 +19,8 @@  discard block
 block discarded – undo
19 19
 {
20 20
     public function create(string $pathname, array $config = []): FileInterface
21 21
     {
22
-        if ($this instanceof ReadableInterface && !$this->exists($pathname)) {
22
+        if ($this instanceof ReadableInterface && !$this->exists($pathname))
23
+        {
23 24
             return $this->write($pathname, '', $config);
24 25
         }
25 26
 
@@ -32,8 +33,10 @@  discard block
 block discarded – undo
32 33
 
33 34
         $fs = $this->getOperator();
34 35
 
35
-        try {
36
-            switch (true) {
36
+        try
37
+        {
38
+            switch (true)
39
+            {
37 40
                 case \is_object($content):
38 41
                 case \is_string($content):
39 42
                     $fs->write($pathname, (string)$content, $config);
@@ -47,7 +50,9 @@  discard block
 block discarded – undo
47 50
                     $message = 'Content must be a resource stream or stringable type, but %s passed';
48 51
                     throw new \InvalidArgumentException(\sprintf($message, \get_debug_type($content)));
49 52
             }
50
-        } catch (FilesystemException $e) {
53
+        }
54
+        catch (FilesystemException $e)
55
+        {
51 56
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
52 57
         }
53 58
 
@@ -61,9 +66,12 @@  discard block
 block discarded – undo
61 66
     ): FileInterface {
62 67
         $fs = $this->getOperator();
63 68
 
64
-        try {
69
+        try
70
+        {
65 71
             $fs->setVisibility($pathname, $this->toFlysystemVisibility($visibility));
66
-        } catch (FilesystemException $e) {
72
+        }
73
+        catch (FilesystemException $e)
74
+        {
67 75
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
68 76
         }
69 77
 
@@ -78,10 +86,14 @@  discard block
 block discarded – undo
78 86
     ): FileInterface {
79 87
         $fs = $this->getOperator();
80 88
 
81
-        if ($storage === null || $storage === $this) {
82
-            try {
89
+        if ($storage === null || $storage === $this)
90
+        {
91
+            try
92
+            {
83 93
                 $fs->copy($source, $destination, $config);
84
-            } catch (FilesystemException $e) {
94
+            }
95
+            catch (FilesystemException $e)
96
+            {
85 97
                 throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
86 98
             }
87 99
 
@@ -99,10 +111,14 @@  discard block
 block discarded – undo
99 111
     ): FileInterface {
100 112
         $fs = $this->getOperator();
101 113
 
102
-        if ($storage === null || $storage === $this) {
103
-            try {
114
+        if ($storage === null || $storage === $this)
115
+        {
116
+            try
117
+            {
104 118
                 $fs->move($source, $destination, $config);
105
-            } catch (FilesystemException $e) {
119
+            }
120
+            catch (FilesystemException $e)
121
+            {
106 122
                 throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
107 123
             }
108 124
 
@@ -120,14 +136,18 @@  discard block
 block discarded – undo
120 136
     {
121 137
         $fs = $this->getOperator();
122 138
 
123
-        try {
139
+        try
140
+        {
124 141
             $fs->delete($pathname);
125 142
 
126
-            if ($clean) {
143
+            if ($clean)
144
+            {
127 145
                 /** @psalm-suppress InternalMethod */
128 146
                 $this->deleteEmptyDirectories($this->getParentDirectory($pathname));
129 147
             }
130
-        } catch (FilesystemException $e) {
148
+        }
149
+        catch (FilesystemException $e)
150
+        {
131 151
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
132 152
         }
133 153
     }
@@ -182,18 +202,23 @@  discard block
 block discarded – undo
182 202
      */
183 203
     private function deleteEmptyDirectories(string $directory): void
184 204
     {
185
-        if (!$this->hasParentDirectory($directory)) {
205
+        if (!$this->hasParentDirectory($directory))
206
+        {
186 207
             return;
187 208
         }
188 209
 
189 210
         $fs = $this->getOperator();
190 211
 
191
-        try {
192
-            if (!$this->hasFiles($directory)) {
212
+        try
213
+        {
214
+            if (!$this->hasFiles($directory))
215
+            {
193 216
                 $fs->deleteDirectory($directory);
194 217
                 $this->deleteEmptyDirectories($this->getParentDirectory($directory));
195 218
             }
196
-        } catch (FilesystemException $e) {
219
+        }
220
+        catch (FilesystemException $e)
221
+        {
197 222
             throw new FileOperationException($e->getMessage(), $e->getCode(), $e);
198 223
         }
199 224
     }
@@ -215,7 +240,8 @@  discard block
 block discarded – undo
215 240
     {
216 241
         $fs = $this->getOperator();
217 242
 
218
-        foreach ($fs->listContents($directory) as $_) {
243
+        foreach ($fs->listContents($directory) as $_)
244
+        {
219 245
             return true;
220 246
         }
221 247
 
Please login to merge, or discard this patch.