getBatchSizeFromInput example

$this->generateSynchronous($mediaIterator$context);
        } else {
            $this->generateAsynchronous($mediaIterator$context);
        }

        return self::SUCCESS;
    }

    private function initializeCommand(InputInterface $input, Context $context): void
    {
        $this->folderFilter = $this->getFolderFilterFromInput($input$context);
        $this->batchSize = $this->getBatchSizeFromInput($input);
        $this->isAsync = $input->getOption('async');
        $this->isStrict = $input->getOption('strict');
    }

    private function getBatchSizeFromInput(InputInterface $input): int
    {
        $rawInput = $input->getOption('batch-size');

        if (!is_numeric($rawInput)) {
            throw MediaException::invalidBatchSize();
        }

        
Home | Imprint | This part of the site doesn't use cookies.