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

DownloadController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDownload() 0 3 1
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