Conditions | 3 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
18 | public function handle(): int |
||
19 | { |
||
20 | if ($id = $this->option('id')) { |
||
21 | PropertyCustomRatesPull::dispatch($id) |
||
22 | ->onQueue($this->option('queue')); |
||
23 | } else { |
||
24 | Property::query() |
||
25 | ->chunk(100, function ($properties) { |
||
26 | /** @var Property $property */ |
||
27 | foreach ($properties as $property) { |
||
28 | PropertyCustomRatesPull::dispatch($property->getKey()) |
||
29 | ->onQueue($this->option('queue')); |
||
30 | } |
||
31 | }); |
||
32 | } |
||
33 | |||
34 | return 0; |
||
35 | } |
||
37 |