Passed
Push — master ( 6a3267...5596bf )
by Curtis
12:56 queued 05:56
created

ImportGedcom::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\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 Illuminate\Http\Request;
11
use ModularSoftware\LaravelGedcom\Utils\GedcomParser;
12
use Illuminate\Support\Facades\Storage;
13
use Illuminate\Support\Facades\File;
14
15
class ImportGedcom implements ShouldQueue
16
{
17
    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\ImportGedcom: $id, $relations, $class, $keyBy
Loading history...
18
    protected $filename;
19
    /**
20
     * Create a new job instance.
21
     *
22
     * @return void
23
     */
24
    public function __construct($filename)
25
    {
26
        //
27
        $this->filename = $filename;
28
    }
29
30
    /**
31
     * Execute the job.
32
     *
33
     * @return void
34
     */
35
    public function handle()
36
    {
37
        $parser = new GedcomParser();
38
        $parser->parse(storage_path($this->filename), '', true);
39
        File::delete(storage_path($this->filename));
40
        return 0;
0 ignored issues
show
Bug Best Practice introduced by
The expression return 0 returns the type integer which is incompatible with the documented return type void.
Loading history...
41
    }
42
}
43