Completed
Push — master ( 2b3f4c...5ada1f )
by Raffael
77:32 queued 61:21
created
src/app/Balloon.App.Api/v1/Node.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -284,46 +284,46 @@  discard block
 block discarded – undo
284 284
         }
285 285
 
286 286
         return $response->setOutputFormat(null)
287
-          ->setBody(function () use ($node, $encode, $offset, $length) {
288
-              $mime = $node->getContentType();
289
-              $stream = $node->get();
290
-              $name = $node->getName();
291
-
292
-              if (null === $stream) {
293
-                  return;
294
-              }
295
-
296
-              if (0 !== $offset) {
297
-                  if (fseek($stream, $offset) === -1) {
298
-                      throw new Exception\Conflict('invalid offset requested', Exception\Conflict::INVALID_OFFSET);
299
-                  }
300
-              }
301
-
302
-              $read = 0;
303
-              header('Content-Type: '.$mime.'');
304
-              if ('base64' === $encode) {
305
-                  header('Content-Encoding: base64');
306
-                  while (!feof($stream)) {
307
-                      if (0 !== $length && $read + 8192 > $length) {
308
-                          echo base64_encode(fread($stream, $length - $read));
309
-                          exit();
310
-                      }
311
-
312
-                      echo base64_encode(fread($stream, 8192));
313
-                      $read += 8192;
314
-                  }
315
-              } else {
316
-                  while (!feof($stream)) {
317
-                      if (0 !== $length && $read + 8192 > $length) {
318
-                          echo fread($stream, $length - $read);
319
-                          exit();
320
-                      }
321
-
322
-                      echo fread($stream, 8192);
323
-                      $read += 8192;
324
-                  }
325
-              }
326
-          });
287
+            ->setBody(function () use ($node, $encode, $offset, $length) {
288
+                $mime = $node->getContentType();
289
+                $stream = $node->get();
290
+                $name = $node->getName();
291
+
292
+                if (null === $stream) {
293
+                    return;
294
+                }
295
+
296
+                if (0 !== $offset) {
297
+                    if (fseek($stream, $offset) === -1) {
298
+                        throw new Exception\Conflict('invalid offset requested', Exception\Conflict::INVALID_OFFSET);
299
+                    }
300
+                }
301
+
302
+                $read = 0;
303
+                header('Content-Type: '.$mime.'');
304
+                if ('base64' === $encode) {
305
+                    header('Content-Encoding: base64');
306
+                    while (!feof($stream)) {
307
+                        if (0 !== $length && $read + 8192 > $length) {
308
+                            echo base64_encode(fread($stream, $length - $read));
309
+                            exit();
310
+                        }
311
+
312
+                        echo base64_encode(fread($stream, 8192));
313
+                        $read += 8192;
314
+                    }
315
+                } else {
316
+                    while (!feof($stream)) {
317
+                        if (0 !== $length && $read + 8192 > $length) {
318
+                            echo fread($stream, $length - $read);
319
+                            exit();
320
+                        }
321
+
322
+                        echo fread($stream, 8192);
323
+                        $read += 8192;
324
+                    }
325
+                }
326
+            });
327 327
     }
328 328
 
329 329
     /**
@@ -1318,9 +1318,9 @@  discard block
 block discarded – undo
1318 1318
                 $node->zip($archive);
1319 1319
             } catch (\Exception $e) {
1320 1320
                 $this->logger->debug('failed zip node in multi node request ['.$node->getId().']', [
1321
-                   'category' => get_class($this),
1322
-                   'exception' => $e,
1323
-               ]);
1321
+                    'category' => get_class($this),
1322
+                    'exception' => $e,
1323
+                ]);
1324 1324
             }
1325 1325
         }
1326 1326
 
Please login to merge, or discard this patch.