Completed
Pull Request — 2.0 (#47)
by
unknown
03:15 queued 21s
created

RebuildThumbnails   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 24
rs 10
1
<?php
2
3
namespace Modules\Media\Jobs;
4
5
use App\Jobs\Job;
6
use Illuminate\Contracts\Queue\ShouldQueue;
7
use Illuminate\Support\Collection
8
use Illuminate\Queue\InteractsWithQueue;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_USE, expecting ',' or ';'
Loading history...
9
use Illuminate\Queue\SerializesModels;
10
11
class RebuildThumbnails extends Job implements ShouldQueue
12
{
13
    use InteractsWithQueue, SerializesModels;
14
15
    /**
16
     * @var Collection
17
     */
18
    private $paths;
19
20
    public function __construct(Collection $paths)
21
    {
22
        $this->paths = $paths;
23
    }
24
25
    public function handle()
26
    {
27
        $imagy = app('imagy');
28
29
        foreach ($this->paths as $path) {
30
            app('log')->info('Generating thumbnails for path: ' . $path);
31
            $imagy->createAll($path);
32
        }
33
    }
34
}
35