Completed
Pull Request — master (#692)
by
unknown
16s
created
src/Gaufrette/Util/Checksum.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,6 +22,6 @@
 block discarded – undo
22 22
      */
23 23
     public static function fromFile(string $filename): string
24 24
     {
25
-        return md5_file($filename)?: '';
25
+        return md5_file($filename) ?: '';
26 26
     }
27 27
 }
Please login to merge, or discard this patch.
src/Gaufrette/Util/Size.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
      */
27 27
     public static function fromFile(string $filename): int
28 28
     {
29
-        return filesize($filename)?: 0;
29
+        return filesize($filename) ?: 0;
30 30
     }
31 31
 
32 32
     /**
Please login to merge, or discard this patch.
src/Gaufrette/Adapter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,14 +15,14 @@  discard block
 block discarded – undo
15 15
      *
16 16
      * @return string|false Returns FALSE in content is not readable
17 17
      */
18
-    public function read(string $key): string|bool;
18
+    public function read(string $key): string | bool;
19 19
 
20 20
     /**
21 21
      * Writes the given content into the file.
22 22
      *
23 23
      * @return int|bool The number of bytes that were written into the file
24 24
      */
25
-    public function write(string $key, mixed $content): int|bool;
25
+    public function write(string $key, mixed $content): int | bool;
26 26
 
27 27
     /**
28 28
      * Indicates whether the file exists.
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      *
42 42
      * @return int|bool An UNIX like timestamp or false
43 43
      */
44
-    public function mtime(string $key): int|bool;
44
+    public function mtime(string $key): int | bool;
45 45
 
46 46
     /**
47 47
      * Deletes the file.
Please login to merge, or discard this patch.
src/Gaufrette/Stream/Local.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         return true;
51 51
     }
52 52
 
53
-    public function read(int $count): string|bool
53
+    public function read(int $count): string | bool
54 54
     {
55 55
         if (!$this->fileHandle) {
56 56
             return false;
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             throw new \LogicException('The stream does not allow write.');
74 74
         }
75 75
 
76
-        return fwrite($this->fileHandle, $data)?: 0;
76
+        return fwrite($this->fileHandle, $data) ?: 0;
77 77
     }
78 78
 
79 79
     public function close(): void
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     /**
130 130
      * @return array<string, mixed>|false
131 131
      */
132
-    public function stat(): array|bool
132
+    public function stat(): array | bool
133 133
     {
134 134
         if ($this->fileHandle) {
135 135
             return fstat($this->fileHandle);
Please login to merge, or discard this patch.
src/Gaufrette/Stream/InMemoryBuffer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         return true;
55 55
     }
56 56
 
57
-    public function read(int $count): string|bool
57
+    public function read(int $count): string | bool
58 58
     {
59 59
         if (false === $this->mode->allowsRead()) {
60 60
             throw new \LogicException('The stream does not allow read.');
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         } else {
87 87
             $before = substr($this->content, 0, $this->position);
88 88
             $after = $newNumBytes > $newPosition ? substr($this->content, $newPosition) : '';
89
-            $this->content = $before . $data . $after;
89
+            $this->content = $before.$data.$after;
90 90
         }
91 91
 
92 92
         $this->position = $newPosition;
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     /**
154 154
      * @return array<string, mixed>|false
155 155
      */
156
-    public function stat(): array|bool
156
+    public function stat(): array | bool
157 157
     {
158 158
         if ($this->filesystem->has($this->key)) {
159 159
             $isDirectory = $this->filesystem->isDirectory($this->key);
Please login to merge, or discard this patch.
src/Gaufrette/StreamWrapper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     /**
95 95
      * @return string|false
96 96
      */
97
-    public function stream_read(int $count): string|bool
97
+    public function stream_read(int $count): string | bool
98 98
     {
99 99
         if (isset($this->stream)) {
100 100
             return $this->stream->read($count);
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
     /**
165 165
      * @return array<string, mixed>|false
166 166
      */
167
-    public function stream_stat(): array|bool
167
+    public function stream_stat(): array | bool
168 168
     {
169 169
         if (isset($this->stream)) {
170 170
             return $this->stream->stat();
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
      *
179 179
      * @TODO handle $flags parameter
180 180
      */
181
-    public function url_stat(string $path, int $flags): array|bool
181
+    public function url_stat(string $path, int $flags): array | bool
182 182
     {
183 183
         $stream = $this->createStream($path);
184 184
 
@@ -233,11 +233,11 @@  discard block
 block discarded – undo
233 233
         $key = !empty($parts['path']) ? substr($parts['path'], 1) : '';
234 234
 
235 235
         if (null !== $parts['query']) {
236
-            $key .= '?' . $parts['query'];
236
+            $key .= '?'.$parts['query'];
237 237
         }
238 238
 
239 239
         if (null !== $parts['fragment']) {
240
-            $key .= '#' . $parts['fragment'];
240
+            $key .= '#'.$parts['fragment'];
241 241
         }
242 242
 
243 243
         if (empty($domain) || empty($key)) {
Please login to merge, or discard this patch.
src/Gaufrette/Adapter/Zip.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     /**
29 29
      * {@inheritdoc}
30 30
      */
31
-    public function read(string $key): string|bool
31
+    public function read(string $key): string | bool
32 32
     {
33 33
         if (false === ($content = $this->zipArchive->getFromName($key, 0))) {
34 34
             return false;
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     /**
41 41
      * {@inheritdoc}
42 42
      */
43
-    public function write(string $key, mixed $content): int|bool
43
+    public function write(string $key, mixed $content): int | bool
44 44
     {
45 45
         if (!$this->zipArchive->addFromString($key, $content)) {
46 46
             return false;
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     /**
89 89
      * {@inheritdoc}
90 90
      */
91
-    public function mtime(string $key): int|bool
91
+    public function mtime(string $key): int | bool
92 92
     {
93 93
         $stat = $this->getStat($key);
94 94
 
Please login to merge, or discard this patch.
src/Gaufrette/Adapter/DoctrineDbal.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     /**
77 77
      * {@inheritdoc}
78 78
      */
79
-    public function mtime(string $key): int|bool
79
+    public function mtime(string $key): int | bool
80 80
     {
81 81
         return $this->getColumnValue($key, 'mtime');
82 82
     }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     /**
85 85
      * {@inheritdoc}
86 86
      */
87
-    public function checksum(string $key): string|bool
87
+    public function checksum(string $key): string | bool
88 88
     {
89 89
         return $this->getColumnValue($key, 'checksum');
90 90
     }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     /**
114 114
      * {@inheritdoc}
115 115
      */
116
-    public function read(string $key): string|bool
116
+    public function read(string $key): string | bool
117 117
     {
118 118
         return $this->getColumnValue($key, 'content');
119 119
     }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     /**
133 133
      * {@inheritdoc}
134 134
      */
135
-    public function write(string $key, mixed $content): int|bool
135
+    public function write(string $key, mixed $content): int | bool
136 136
     {
137 137
         $values = [
138 138
             $this->getQuotedColumn('content') => $content,
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
         return [
211 211
             'dirs' => [],
212 212
             'keys' => array_map(
213
-                function ($value) {
213
+                function($value) {
214 214
                     return $value['_key'];
215 215
                 },
216 216
                 $keys
Please login to merge, or discard this patch.
src/Gaufrette/Adapter/Local.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      * @throws \InvalidArgumentException if the directory already exists
47 47
      * @throws \RuntimeException         if the directory could not be created
48 48
      */
49
-    public function read(string $key): string|bool
49
+    public function read(string $key): string | bool
50 50
     {
51 51
         if ($this->isDirectory($key)) {
52 52
             return false;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      * @throws \InvalidArgumentException if the directory already exists
61 61
      * @throws \RuntimeException         if the directory could not be created
62 62
      */
63
-    public function write(string $key, mixed $content): int|bool
63
+    public function write(string $key, mixed $content): int | bool
64 64
     {
65 65
         $path = $this->computePath($key);
66 66
         $this->ensureDirectoryExists(\Gaufrette\Util\Path::dirname($path), true);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      * @throws \InvalidArgumentException if the directory already exists
123 123
      * @throws \RuntimeException         if the directory could not be created
124 124
      */
125
-    public function mtime(string $key): int|bool
125
+    public function mtime(string $key): int | bool
126 126
     {
127 127
         return filemtime($this->computePath($key));
128 128
     }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
      * @throws \InvalidArgumentException if the directory already exists
168 168
      * @throws \RuntimeException         if the directory could not be created
169 169
      */
170
-    public function checksum(string $key): string|bool
170
+    public function checksum(string $key): string | bool
171 171
     {
172 172
         return Util\Checksum::fromFile($this->computePath($key));
173 173
     }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
      * @throws \InvalidArgumentException if the directory already exists
189 189
      * @throws \RuntimeException         if the directory could not be created
190 190
      */
191
-    public function mimeType(string $key): bool|string
191
+    public function mimeType(string $key): bool | string
192 192
     {
193 193
         $fileInfo = new \finfo(FILEINFO_MIME_TYPE);
194 194
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     {
228 228
         $this->ensureDirectoryExists($this->directory, $this->create);
229 229
 
230
-        return $this->normalizePath($this->directory . '/' . $key);
230
+        return $this->normalizePath($this->directory.'/'.$key);
231 231
     }
232 232
 
233 233
     /**
Please login to merge, or discard this patch.