Passed
Push — master ( e1e86f...c6853e )
by Curtis
05:23 queued 11s
created

ClearStrg   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 28
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A handle() 0 5 1
1
<?php
2
3
namespace App\Jobs\Tenant;
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\Support\Facades\Storage;
11
use LaravelEnso\Companies\App\Models\Company;
12
use LaravelEnso\Multitenancy\App\Services\Tenant;
13
use LaravelEnso\Multitenancy\App\Traits\ConnectionStoragePath;
14
15
class ClearStrg implements ShouldQueue
16
{
17
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, ConnectionStoragePath;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Jobs\Tenant\ClearStrg: $id, $relations, $class, $keyBy
Loading history...
18
19
    private $tenant;
20
21
    /**
22
     * Create a new job instance.
23
     *
24
     * @return void
25
     */
26
    public function __construct(Company $tenant)
27
    {
28
        $this->tenant = $tenant;
29
30
        // $this->queue = 'light';
31
    }
32
33
    /**
34
     * Execute the job.
35
     *
36
     * @return void
37
     */
38
    public function handle()
39
    {
40
        Tenant::set($this->tenant);
41
42
        Storage::deleteDirectory($this->tenantPath());
43
    }
44
}
45