| Total Complexity | 3 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class ImportProductReviewsAttachments extends AbstractCommand |
||
| 11 | { |
||
| 12 | protected int $limit; |
||
| 13 | protected int $offset; |
||
| 14 | protected array $importResult; |
||
| 15 | |||
| 16 | public function __construct(Request $request) |
||
| 17 | { |
||
| 18 | $this->limit = max(1, $request->cast('per_page', 'int')); |
||
| 19 | $this->offset = $this->limit * (max(1, $request->cast('page', 'int')) - 1); |
||
| 20 | $this->importResult = glsr(ImportResultDefaults::class)->defaults(); |
||
| 21 | } |
||
| 22 | |||
| 23 | public function handle(): void |
||
| 24 | { |
||
| 25 | $this->importResult = glsr(ImportManager::class)->importAttachments($this->limit, $this->offset); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function response(): array |
||
| 32 | ]); |
||
| 33 | } |
||
| 34 | } |
||
| 35 |