Skip to content

Commit 0a932c6

Browse files
fix: remove unreachable code
1 parent 3613e4f commit 0a932c6

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/Support/Chunky.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,14 @@ public function put(ChunkyUploadDto $dto, ?Closure $onCompleted = null): JsonRes
5959

6060
$completeFile = $this->mergeChunksIntoFile($dto->path, $dto->filename, $dto->totalChunks);
6161

62-
if ($completeFile) {
63-
if ($onCompleted) {
64-
$onCompleted($completeFile);
65-
}
66-
67-
return response()->json(
68-
['message' => 'File successfully uploaded', 'file' => $completeFile],
69-
Response::HTTP_CREATED,
70-
);
62+
if ($onCompleted) {
63+
$onCompleted($completeFile);
7164
}
7265

73-
return response()->json(['message' => 'Error restoring file'], Response::HTTP_INTERNAL_SERVER_ERROR);
66+
return response()->json(
67+
['message' => 'File successfully uploaded', 'file' => $completeFile],
68+
Response::HTTP_CREATED,
69+
);
7470
}
7571

7672
/**
@@ -88,8 +84,8 @@ public function mergeChunksIntoFile(string $path, string $filename, int $totalCh
8884

8985
for ($i = 1; $i <= $totalChunks; $i++) {
9086
fwrite($file, file_get_contents($fullPath . '.part' . $i));
91-
info('writing chunk ' . $i);
9287
}
88+
9389
fclose($file);
9490

9591
$targetPath = join_paths('backups', $filename);

0 commit comments

Comments
 (0)