Skip to content

Commit d2d8426

Browse files
committed
driver: remove unused method
1 parent aca8881 commit d2d8426

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

src/Driver/BaseHandler.php

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77
use CodingSocks\UploadHandler\Exception\InternalServerErrorHttpException;
88
use CodingSocks\UploadHandler\StorageConfig;
99
use Illuminate\Http\Request;
10-
use Illuminate\Http\UploadedFile;
11-
use Illuminate\Support\Facades\Storage;
12-
use Symfony\Component\HttpFoundation\BinaryFileResponse;
1310
use Symfony\Component\HttpFoundation\Response;
14-
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
1511
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
16-
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1712

1813
abstract class BaseHandler
1914
{
@@ -28,27 +23,6 @@ abstract class BaseHandler
2823
*/
2924
abstract public function handle(Request $request, StorageConfig $config, Closure $fileUploaded = null): Response;
3025

31-
/**
32-
* @param string $filename
33-
* @param \CodingSocks\UploadHandler\StorageConfig $storageConfig
34-
*
35-
* @return \Symfony\Component\HttpFoundation\Response
36-
*/
37-
public function fileResponse(string $filename, StorageConfig $storageConfig): Response
38-
{
39-
/** @var \Illuminate\Filesystem\FilesystemAdapter $disk */
40-
$disk = Storage::disk($storageConfig->getDisk());
41-
$prefix = $storageConfig->getMergedDirectory() . '/';
42-
43-
if (! $disk->exists($prefix . $filename)) {
44-
throw new NotFoundHttpException($filename . ' file not found on server');
45-
}
46-
47-
$path = $disk->path($prefix . $filename);
48-
49-
return new BinaryFileResponse($path, 200, [], true, ResponseHeaderBag::DISPOSITION_ATTACHMENT);
50-
}
51-
5226
/**
5327
* Check if the request type of the given request is in the specified list.
5428
*

0 commit comments

Comments
 (0)