Issues (196)

src/Controllers/DownloadController.php (6 issues)

1
<?php
2
3
namespace UniSharp\LaravelFilemanager\Controllers;
4
5
use Illuminate\Support\Facades\Storage;
6
7
class DownloadController extends LfmController
8
{
9
    public function getDownload()
10
    {
11
        $file = $this->lfm->setName(request('file'));
0 ignored issues
show
The function request was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

11
        $file = $this->lfm->setName(/** @scrutinizer ignore-call */ request('file'));
Loading history...
Bug Best Practice introduced by
The property lfm does not exist on UniSharp\LaravelFilemana...lers\DownloadController. Since you implemented __get, consider adding a @property annotation.
Loading history...
The method setName() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

11
        /** @scrutinizer ignore-call */ 
12
        $file = $this->lfm->setName(request('file'));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
12
13
        if (!Storage::disk($this->helper->config('disk'))->exists($file->path('storage'))) {
0 ignored issues
show
Bug Best Practice introduced by
The property helper does not exist on UniSharp\LaravelFilemana...lers\DownloadController. Since you implemented __get, consider adding a @property annotation.
Loading history...
The method config() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

13
        if (!Storage::disk($this->helper->/** @scrutinizer ignore-call */ config('disk'))->exists($file->path('storage'))) {

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
14
            abort(404);
0 ignored issues
show
The function abort was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

14
            /** @scrutinizer ignore-call */ 
15
            abort(404);
Loading history...
15
        }
16
17
        return Storage::disk($this->helper->config('disk'))->download($file->path('storage'));
18
    }
19
}
20