Completed
Pull Request — master (#41)
by
unknown
02:46
created

CreateThumbnails   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 8 1
1
<?php namespace Modules\Media\Jobs;
2
3
use App\Jobs\Job;
4
use Illuminate\Contracts\Bus\SelfHandling;
5
use Illuminate\Contracts\Queue\ShouldQueue;
6
use Illuminate\Queue\InteractsWithQueue;
7
use Illuminate\Queue\SerializesModels;
8
use Modules\Media\ValueObjects\MediaPath;
9
10
class CreateThumbnails extends Job implements SelfHandling, ShouldQueue
11
{
12
    use InteractsWithQueue, SerializesModels;
13
14
    /**
15
     * @var MediaPath
16
     */
17
    private $path;
18
19
    public function __construct(MediaPath $path)
20
    {
21
        $this->path = $path;
22
    }
23
24
    public function handle()
25
    {
26
        $imagy = app('imagy');
27
28
        app('log')->info('Generating thumbnails for path: ' . $this->path);
29
30
        $imagy->createAll($this->path);
31
    }
32
}
33