Merge pull request #57731 from hmt/patch-1

Calendar: Fix typos in import/export
This commit is contained in:
Andy Scherzinger 2026-01-27 10:35:26 +01:00 committed by GitHub
commit 93c254f451
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 9 deletions

View file

@ -43,9 +43,9 @@ class ExportCalendar extends Command {
$this->setName('calendar:export')
->setDescription('Export calendar data from supported calendars to disk or stdout')
->addArgument('uid', InputArgument::REQUIRED, 'Id of system user')
->addArgument('uri', InputArgument::REQUIRED, 'Uri of calendar')
->addArgument('uri', InputArgument::REQUIRED, 'URI of calendar')
->addOption('format', null, InputOption::VALUE_REQUIRED, 'Format of output (ical, jcal, xcal) defaults to ical', 'ical')
->addOption('location', null, InputOption::VALUE_REQUIRED, 'Location of where to write the output. defaults to stdout');
->addOption('location', null, InputOption::VALUE_REQUIRED, 'Location of where to write the output. Defaults to stdout');
}
protected function execute(InputInterface $input, OutputInterface $output): int {
@ -73,11 +73,11 @@ class ExportCalendar extends Command {
throw new InvalidArgumentException("Format <$format> is not valid.");
}
$options->setFormat($format);
// evaluate is a valid location was given and is usable otherwise output to stdout
// evaluate if a valid location was given and is usable otherwise output to stdout
if ($location !== null) {
$handle = fopen($location, 'wb');
if ($handle === false) {
throw new InvalidArgumentException("Location <$location> is not valid. Can not open location for write operation.");
throw new InvalidArgumentException("Location <$location> is not valid. Cannot open location for write operation.");
}
foreach ($this->exportService->export($calendar, $options) as $chunk) {

View file

@ -45,11 +45,11 @@ class ImportCalendar extends Command {
$this->setName('calendar:import')
->setDescription('Import calendar data to supported calendars from disk or stdin')
->addArgument('uid', InputArgument::REQUIRED, 'Id of system user')
->addArgument('uri', InputArgument::REQUIRED, 'Uri of calendar')
->addArgument('uri', InputArgument::REQUIRED, 'URI of calendar')
->addArgument('location', InputArgument::OPTIONAL, 'Location to read the input from, defaults to stdin.')
->addOption('format', null, InputOption::VALUE_REQUIRED, 'Format of input (ical, jcal, xcal) defaults to ical', 'ical')
->addOption('errors', null, InputOption::VALUE_REQUIRED, 'how to handel item errors (0 - continue, 1 - fail)')
->addOption('validation', null, InputOption::VALUE_REQUIRED, 'how to handel item validation (0 - no validation, 1 - validate and skip on issue, 2 - validate and fail on issue)')
->addOption('errors', null, InputOption::VALUE_REQUIRED, 'how to handle item errors (0 - continue, 1 - fail)')
->addOption('validation', null, InputOption::VALUE_REQUIRED, 'how to handle item validation (0 - no validation, 1 - validate and skip on issue, 2 - validate and fail on issue)')
->addOption('supersede', null, InputOption::VALUE_NONE, 'override/replace existing items')
->addOption('show-created', null, InputOption::VALUE_NONE, 'show all created items after processing')
->addOption('show-updated', null, InputOption::VALUE_NONE, 'show all updated items after processing')
@ -103,7 +103,7 @@ class ImportCalendar extends Command {
if ($location !== null) {
$input = fopen($location, 'r');
if ($input === false) {
throw new InvalidArgumentException("Location <$location> is not valid. Can not open location for read operation.");
throw new InvalidArgumentException("Location <$location> is not valid. Cannot open location for read operation.");
}
try {
$outcome = $this->importService->import($input, $calendar, $options);
@ -113,7 +113,7 @@ class ImportCalendar extends Command {
} else {
$input = fopen('php://stdin', 'r');
if ($input === false) {
throw new InvalidArgumentException('Can not open stdin for read operation.');
throw new InvalidArgumentException('Cannot open stdin for read operation.');
}
try {
$tempPath = $this->tempManager->getTemporaryFile();