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

CreateThumbnails::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
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