Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/circles.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2022-04-13 15:30:53 +0300
committerMaxence Lange <maxence@artificial-owl.com>2022-04-13 15:30:53 +0300
commit15daac6c787b66aa04d41d8c9165f143aeb53aba (patch)
treed6192b52ea6ba43e1366076f56682b5dac347559
parentd48eb74655c1bd0878d049198ebf336f7a9ae4d9 (diff)
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r--lib/Command/CirclesCreate.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Command/CirclesCreate.php b/lib/Command/CirclesCreate.php
index bcba99c9..0e2cc2af 100644
--- a/lib/Command/CirclesCreate.php
+++ b/lib/Command/CirclesCreate.php
@@ -36,9 +36,12 @@ use OCA\Circles\Exceptions\FederatedItemException;
use OCA\Circles\Exceptions\InitiatorNotFoundException;
use OCA\Circles\Exceptions\RequestBuilderException;
use OCA\Circles\Exceptions\SingleCircleNotFoundException;
+use OCA\Circles\Model\Circle;
use OCA\Circles\Model\Member;
use OCA\Circles\Service\CircleService;
use OCA\Circles\Service\FederatedUserService;
+use OCA\Circles\Tools\Exceptions\InvalidItemException;
+use OCA\Circles\Tools\Traits\TDeserialize;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -50,7 +53,7 @@ use Symfony\Component\Console\Output\OutputInterface;
* @package OCA\Circles\Command
*/
class CirclesCreate extends Base {
-
+ use TDeserialize;
/** @var FederatedUserService */
private $federatedUserService;
@@ -100,6 +103,7 @@ class CirclesCreate extends Base {
* @throws InitiatorNotFoundException
* @throws SingleCircleNotFoundException
* @throws RequestBuilderException
+ * @throws InvalidItemException
*/
protected function execute(InputInterface $input, OutputInterface $output): int {
$ownerId = $input->getArgument('owner');
@@ -129,6 +133,12 @@ class CirclesCreate extends Base {
if (strtolower($input->getOption('output')) === 'json') {
$output->writeln(json_encode($outcome, JSON_PRETTY_PRINT));
+ } elseif (strtolower($input->getOption('output')) !== 'none') {
+ /** @var Circle $circle */
+ $circle = $this->deserialize($outcome, Circle::class);
+ $output->writeln('Id: <info>' . $circle->getSingleId() . '</info>');
+ $output->writeln('Name: <info>' . $circle->getDisplayName() . '</info>');
+ $output->writeln('Owner: <info>' . $circle->getOwner()->getDisplayName() . '</info>');
}
return 0;