Storage::getDisk()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Yaro\Jarboe\Table\Fields\Traits;
4
5
use Illuminate\Http\Request;
6
use Illuminate\Http\UploadedFile;
7
8
trait Storage
9
{
10
    protected $disk;
11
    protected $path = '';
12
    protected $multiple = false;
13
14
    protected function storeFile(UploadedFile $file, $filename, Request $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

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

14
    protected function storeFile(UploadedFile $file, $filename, /** @scrutinizer ignore-unused */ Request $request)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
15
    {
16
        $path = $file->storeAs($this->getPath(), $filename, [
17
            'disk' => $this->getDisk(),
18
        ]);
19
20
        return $path;
21
    }
22
23
    public function multiple(bool $multiple = true)
24
    {
25
        $this->multiple = $multiple;
26
27
        return $this;
28
    }
29
30 2
    public function isMultiple()
31
    {
32 2
        return $this->multiple;
33
    }
34
35 1
    public function disk(string $disk)
36
    {
37 1
        $this->disk = $disk;
38
39 1
        return $this;
40
    }
41
42 1
    public function getDisk()
43
    {
44 1
        return $this->disk;
45
    }
46
47 1
    public function path(string $path)
48
    {
49 1
        $this->path = $path;
50
51 1
        return $this;
52
    }
53
54 1
    public function getPath()
55
    {
56 1
        return $this->path;
57
    }
58
}
59