setName('sharing:update-share-property') ->setDescription('Update a property of a share.') ->addArgument('id', InputArgument::REQUIRED, 'Share ID') ->addArgument('class', InputArgument::REQUIRED, 'Property class') ->addArgument('value', InputArgument::OPTIONAL, 'Property value. Omitting it will remove the value.'); } #[\Override] public function execute(InputInterface $input, OutputInterface $output): int { /** @var string $id */ $id = $input->getArgument('id'); /** @var class-string $class */ $class = $input->getArgument('class'); /** @var ?string $value */ $value = $input->getArgument('value'); return $this->wrapExecution($output, function () use ($id, $class, $value): Share { $share = $this->manager->getShare($this->accessContext, $id); return $this->manager->updateShareProperty($this->accessContext, $share, new ShareProperty($class, $value)); }); } }