Passed
Push — master ( b8999c...a2f941 )
by Curtis
09:12 queued 03:15
created

Store::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 5
rs 10
1
<?php
2
3
namespace App\Http\Controllers\enso\HowTo\Video;
4
5
use Illuminate\Routing\Controller;
6
use LaravelEnso\HowTo\Http\Requests\ValidateVideoRequest;
7
use LaravelEnso\HowTo\Models\Video;
8
9
class Store extends Controller
10
{
11
    public function __invoke(ValidateVideoRequest $request, Video $video)
12
    {
13
        return $video->store(
14
            $request->file('video'),
0 ignored issues
show
Bug introduced by
It seems like $request->file('video') can also be of type Illuminate\Http\UploadedFile[] and array and null; however, parameter $file of LaravelEnso\HowTo\Models\Video::store() does only seem to accept Illuminate\Http\UploadedFile, maybe add an additional type check? ( Ignorable by Annotation )

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

14
            /** @scrutinizer ignore-type */ $request->file('video'),
Loading history...
15
            $request->validatedExcept('video')
16
        );
17
    }
18
}
19