Export   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 11
dl 0
loc 35
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 2 1
A __construct() 0 14 3
1
<?php
2
3
namespace App\Jobs;
4
5
use App\Models\Export as ExportHistory;
6
use Illuminate\Bus\Queueable;
7
use Illuminate\Container\Container;
8
use Illuminate\Contracts\Queue\ShouldQueue;
9
use Illuminate\Queue\InteractsWithQueue;
10
use Illuminate\Queue\SerializesModels;
11
12
class Export implements ShouldQueue
13
{
14
    use InteractsWithQueue, Queueable, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Jobs\Export: $id, $class
Loading history...
15
16
    /**
17
     * Create a new job instance.
18
     *
19
     * @param \ExportHistory $export
20
     *
21
     * @throws \PropelException
22
     */
23
    public function __construct(ExportHistory $export)
24
    {
25
        //new up a laravel container
26
        Container::setInstance(new Container);
27
28
        $addLanguage     = $export->getSelectedLanguage();
29
        $schema          = $export->getSchema();
30
        $vocabulary      = $export->getVocabulary();
31
        $defaultLanguage = $schema ? $schema->getLanguage() : $vocabulary->getLanguage();
32
33
        if ($addLanguage) {
34
            $languages = [$defaultLanguage, $addLanguage];
0 ignored issues
show
Unused Code introduced by
The assignment to $languages is dead and can be removed.
Loading history...
35
        } else {
36
            $languages = [$defaultLanguage];
37
        }
38
    }
39
40
    /**
41
     * Execute the job.
42
     *
43
     * @return void
44
     */
45
    public function handle()
46
    {
47
        //
48
    }
49
}
50