Completed
Pull Request — master (#831)
by
unknown
03:34
created

DownloadController::getDownload()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Xuandung38\LaravelFilemanager\Controllers;
4
5
class DownloadController extends LfmController
6
{
7
    public function getDownload()
8
    {
9
        return response()->download($this->lfm->setName(request('file'))->path('absolute'));
0 ignored issues
show
Bug introduced by
The function response 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

9
        return /** @scrutinizer ignore-call */ response()->download($this->lfm->setName(request('file'))->path('absolute'));
Loading history...
Bug introduced by
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

9
        return response()->download($this->lfm->/** @scrutinizer ignore-call */ setName(request('file'))->path('absolute'));

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...
Bug introduced by
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

9
        return response()->download($this->lfm->setName(/** @scrutinizer ignore-call */ request('file'))->path('absolute'));
Loading history...
Bug Best Practice introduced by
The property lfm does not exist on Xuandung38\LaravelFilema...lers\DownloadController. Since you implemented __get, consider adding a @property annotation.
Loading history...
10
    }
11
}
12