option('from'); $to = (string) $this->option('to'); $file = trim((string) $this->option('file')); try { $companyId = (int) $this->option('company'); $replace = (bool) $this->option('replace'); $result = $file === '' ? $importer->import($from, $to, $companyId, $replace, 'jst-order-label-import') : $importer->importFromFile($file, $from ?: null, $to ?: null, $companyId, $replace); } catch (Throwable $exception) { $this->error($exception->getMessage()); return self::FAILURE; } $this->info(json_encode($result, JSON_UNESCAPED_UNICODE)); return self::SUCCESS; } }