ProcessSubmission   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A handle() 0 4 1
A failed() 0 4 1
1
<?php
2
3
namespace App\Jobs;
4
5
use Illuminate\Bus\Queueable;
6
use Illuminate\Queue\SerializesModels;
7
use Illuminate\Queue\InteractsWithQueue;
8
use Illuminate\Contracts\Queue\ShouldQueue;
9
use Illuminate\Foundation\Bus\Dispatchable;
10
use App\Models\Submission\SubmissionModel;
11
use App\Babel\Babel;
12
13
class ProcessSubmission implements ShouldQueue
14
{
15
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Jobs\ProcessSubmission: $id, $relations, $class, $keyBy
Loading history...
16
17
    public $tries=5;
18
    protected $all_data=[];
19
20
    /**
21
     * Create a new job instance.
22
     *
23
     * @return void
24
     */
25
26
    public function __construct($all_data)
27
    {
28
        $this->all_data=$all_data;
29
    }
30
31
    /**
32
     * Execute the job.
33
     *
34
     * @return void
35
     */
36
    public function handle()
37
    {
38
        $babel=new Babel();
39
        $babel->submit($this->all_data);
40
    }
41
42
    public function failed()
43
    {
44
        $submissionModel=new SubmissionModel();
45
        $submissionModel->updateSubmission($this->all_data["sid"], ["verdict"=>"Submission Error"]);
46
    }
47
}
48