Passed
Push — master ( 9cc5df...d54eb6 )
by Chris
15:01
created

StartVideoLabelDetection::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Meema\MediaRecognition\Jobs;
4
5
use Illuminate\Bus\Queueable;
6
use Illuminate\Contracts\Queue\ShouldQueue;
7
use Illuminate\Foundation\Bus\Dispatchable;
8
use Illuminate\Queue\InteractsWithQueue;
9
use Illuminate\Queue\SerializesModels;
10
use Meema\MediaRecognition\Facades\Recognize;
11
12
class StartVideoLabelDetection implements ShouldQueue
13
{
14
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by Meema\MediaRecognition\J...tartVideoLabelDetection: $id, $relations, $class, $keyBy
Loading history...
15
16
    private ?int $mediaId;
17
18
    private ?int $minConfidence;
19
20
    private int $maxResults;
21
22
    /**
23
     * Create a new job instance.
24
     *
25
     * @param int|null $mediaId
26
     * @param int|null $minConfidence
27
     * @param int $maxResults
28
     */
29
    public function __construct($mediaId = null, $minConfidence = null, $maxResults = 1000)
30
    {
31
        $this->mediaId = $mediaId;
32
        $this->minConfidence = $minConfidence;
33
        $this->maxResults = $maxResults;
34
    }
35
36
    /**
37
     * Execute the job.
38
     *
39
     * @return void
40
     */
41
    public function handle()
42
    {
43
        Recognize::startLabelDetection($this->mediaId, $this->minConfidence, $this->maxResults);
44
    }
45
}
46