Passed
Branch master (b550bb)
by Ankit
02:58
created
src/File.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
         try {
276 276
             $this->seek($output, $bytesWritten);
277 277
 
278
-            while (! feof($input)) {
278
+            while (!feof($input)) {
279 279
                 if (CONNECTION_NORMAL !== connection_status()) {
280 280
                     throw new ConnectionException('Connection aborted by user.');
281 281
                 }
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
     {
323 323
         if (self::INPUT_STREAM !== $filePath &&
324 324
             self::READ_BINARY === $mode &&
325
-            ! file_exists($filePath)
325
+            !file_exists($filePath)
326 326
         ) {
327 327
             throw new FileException("File not found.");
328 328
         }
Please login to merge, or discard this patch.
src/Tus/Client.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     {
62 62
         $this->filePath = $file;
63 63
 
64
-        if (! file_exists($file) || ! is_readable($file)) {
64
+        if (!file_exists($file) || !is_readable($file)) {
65 65
             throw new FileException('Cannot read file: ' . $file);
66 66
         }
67 67
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         $checksum   = $data['data']['checksum'] ?? null;
220 220
         $statusCode = $response->getStatusCode();
221 221
 
222
-        if (HttpResponse::HTTP_CREATED !== $statusCode || ! $checksum) {
222
+        if (HttpResponse::HTTP_CREATED !== $statusCode || !$checksum) {
223 223
             throw new FileException('Unable to create resource.');
224 224
         }
225 225
 
Please login to merge, or discard this patch.
src/Cache/RedisStore.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     {
27 27
         $contents = $this->redis->get($key);
28 28
 
29
-        if (! empty($contents)) {
29
+        if (!empty($contents)) {
30 30
             return json_decode($contents, true);
31 31
         }
32 32
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     {
49 49
         $contents = json_decode($this->redis->get($key), true) ?? [];
50 50
 
51
-        if (! empty($contents) && is_array($contents)) {
51
+        if (!empty($contents) && is_array($contents)) {
52 52
             $contents = $value + $contents;
53 53
         } else {
54 54
             $contents = $value;
Please login to merge, or discard this patch.
src/Cache/FileStore.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     protected function createCacheDir()
78 78
     {
79
-        if (! file_exists($this->cacheDir)) {
79
+        if (!file_exists($this->cacheDir)) {
80 80
             mkdir($this->cacheDir);
81 81
         }
82 82
     }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
         $cacheFilePath = $this->getCacheFile();
94 94
 
95
-        if (! file_exists($cacheFilePath)) {
95
+        if (!file_exists($cacheFilePath)) {
96 96
             touch($cacheFilePath);
97 97
         }
98 98
     }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     {
105 105
         $contents = $this->getCacheContents();
106 106
 
107
-        if (! empty($contents[$key]) && $this->isValid($key)) {
107
+        if (!empty($contents[$key]) && $this->isValid($key)) {
108 108
             return $contents[$key];
109 109
         }
110 110
 
@@ -134,13 +134,13 @@  discard block
 block discarded – undo
134 134
     {
135 135
         $cacheFile = $this->getCacheFile();
136 136
 
137
-        if (! file_exists($cacheFile) || ! $this->isValid($key)) {
137
+        if (!file_exists($cacheFile) || !$this->isValid($key)) {
138 138
             $this->createCacheFile();
139 139
         }
140 140
 
141 141
         $contents = json_decode(file_get_contents($cacheFile), true) ?? [];
142 142
 
143
-        if (! empty($contents[$key]) && is_array($value)) {
143
+        if (!empty($contents[$key]) && is_array($value)) {
144 144
             $contents[$key] = $value + $contents[$key];
145 145
         } else {
146 146
             $contents[$key] = $value;
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     {
177 177
         $cacheFile = $this->getCacheFile();
178 178
 
179
-        if (! file_exists($cacheFile)) {
179
+        if (!file_exists($cacheFile)) {
180 180
             return false;
181 181
         }
182 182
 
Please login to merge, or discard this patch.
example/verify.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
 
10 10
 $client = new \TusPhp\Tus\Client('http://tus.local', 'redis');
11 11
 
12
-if (! empty($_FILES)) {
12
+if (!empty($_FILES)) {
13 13
     $status   = 'new';
14 14
     $fileMeta = $_FILES['tus_file'];
15 15
 
Please login to merge, or discard this patch.
example/upload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
 $client = new \TusPhp\Tus\Client('http://tus.local', 'redis');
10 10
 
11
-if (! empty($_FILES)) {
11
+if (!empty($_FILES)) {
12 12
     $fileMeta = $_FILES['tus_file'];
13 13
 
14 14
     try {
Please login to merge, or discard this patch.
src/Tus/Server.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     {
93 93
         $method = $this->getRequest()->method();
94 94
 
95
-        if (! in_array($method, $this->request->allowedHttpVerbs())) {
95
+        if (!in_array($method, $this->request->allowedHttpVerbs())) {
96 96
             return $this->response->send(null, HttpResponse::HTTP_METHOD_NOT_ALLOWED);
97 97
         }
98 98
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     {
141 141
         $checksum = $this->request->checksum();
142 142
 
143
-        if (! $this->cache->get($checksum)) {
143
+        if (!$this->cache->get($checksum)) {
144 144
             return $this->response->send(null, HttpResponse::HTTP_NOT_FOUND);
145 145
         }
146 146
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     {
204 204
         $checksum = $this->request->checksum();
205 205
 
206
-        if (! $this->cache->get($checksum)) {
206
+        if (!$this->cache->get($checksum)) {
207 207
             return $this->response->send(null, HttpResponse::HTTP_GONE);
208 208
         }
209 209
 
@@ -235,14 +235,14 @@  discard block
 block discarded – undo
235 235
         $checksum = $this->request->checksum();
236 236
         $fileMeta = $this->cache->get($checksum);
237 237
 
238
-        if (! $fileMeta) {
238
+        if (!$fileMeta) {
239 239
             return $this->response->send('404 upload not found.', HttpResponse::HTTP_NOT_FOUND);
240 240
         }
241 241
 
242 242
         $resource = $fileMeta['file_path'] ?? null;
243 243
         $fileName = $fileMeta['name'] ?? null;
244 244
 
245
-        if (! $resource || ! file_exists($resource)) {
245
+        if (!$resource || !file_exists($resource)) {
246 246
             return $this->response->send('404 upload not found.', HttpResponse::HTTP_NOT_FOUND);
247 247
         }
248 248
 
@@ -260,13 +260,13 @@  discard block
 block discarded – undo
260 260
         $fileMeta = $this->cache->get($checksum);
261 261
         $resource = $fileMeta['file_path'] ?? null;
262 262
 
263
-        if (! $resource) {
263
+        if (!$resource) {
264 264
             return $this->response->send(null, HttpResponse::HTTP_NOT_FOUND);
265 265
         }
266 266
 
267 267
         $isDeleted = $this->cache->delete($checksum);
268 268
 
269
-        if (! $isDeleted || ! file_exists($resource)) {
269
+        if (!$isDeleted || !file_exists($resource)) {
270 270
             return $this->response->send(null, HttpResponse::HTTP_GONE);
271 271
         }
272 272
 
Please login to merge, or discard this patch.
src/Response.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
         $response = new BinaryFileResponse($file, HttpResponse::HTTP_OK, $headers, true, $disposition);
83 83
         $response->prepare(HttpRequest::createFromGlobals());
84 84
 
85
-        if (! is_null($name)) {
85
+        if (!is_null($name)) {
86 86
             $response = $response->setContentDisposition(
87 87
                 $disposition,
88 88
                 $name,
Please login to merge, or discard this patch.