</dependencies>
<commands>
- <command>OCA\Webhooks\Command\Index</command>
+ <command>OCA\Webhooks\Command\ListWebhooks</command>
</commands>
<settings>
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'OCA\\Webhooks\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
'OCA\\Webhooks\\BackgroundJobs\\WebhookCall' => $baseDir . '/../lib/BackgroundJobs/WebhookCall.php',
- 'OCA\\Webhooks\\Command\\Index' => $baseDir . '/../lib/Command/Index.php',
+ 'OCA\\Webhooks\\Command\\ListWebhooks' => $baseDir . '/../lib/Command/ListWebhooks.php',
'OCA\\Webhooks\\Controller\\WebhooksController' => $baseDir . '/../lib/Controller/WebhooksController.php',
'OCA\\Webhooks\\Db\\AuthMethod' => $baseDir . '/../lib/Db/AuthMethod.php',
'OCA\\Webhooks\\Db\\WebhookListener' => $baseDir . '/../lib/Db/WebhookListener.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'OCA\\Webhooks\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
'OCA\\Webhooks\\BackgroundJobs\\WebhookCall' => __DIR__ . '/..' . '/../lib/BackgroundJobs/WebhookCall.php',
- 'OCA\\Webhooks\\Command\\Index' => __DIR__ . '/..' . '/../lib/Command/Index.php',
+ 'OCA\\Webhooks\\Command\\ListWebhooks' => __DIR__ . '/..' . '/../lib/Command/ListWebhooks.php',
'OCA\\Webhooks\\Controller\\WebhooksController' => __DIR__ . '/..' . '/../lib/Controller/WebhooksController.php',
'OCA\\Webhooks\\Db\\AuthMethod' => __DIR__ . '/..' . '/../lib/Db/AuthMethod.php',
'OCA\\Webhooks\\Db\\WebhookListener' => __DIR__ . '/..' . '/../lib/Db/WebhookListener.php',
+++ /dev/null
-<?php
-
-declare(strict_types=1);
-
-/**
- * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
- * SPDX-License-Identifier: AGPL-3.0-or-later
- */
-
-namespace OCA\Webhooks\Command;
-
-use OC\Core\Command\Base;
-use OCA\Webhooks\Db\WebhookListener;
-use OCA\Webhooks\Db\WebhookListenerMapper;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Output\OutputInterface;
-
-class Index extends Base {
- public function __construct(
- private WebhookListenerMapper $mapper,
- ) {
- parent::__construct();
- }
-
- protected function configure(): void {
- parent::configure();
- $this
- ->setName('webhooks:list')
- ->setDescription('Lists configured webhooks');
- }
-
- protected function execute(InputInterface $input, OutputInterface $output): int {
- $webhookListeners = array_map(
- fn (WebhookListener $listener): array => array_map(
- fn (string|array|null $value): ?string => (is_array($value) ? json_encode($value) : $value),
- $listener->jsonSerialize()
- ),
- $this->mapper->getAll()
- );
- $this->writeTableInOutputFormat($input, $output, $webhookListeners);
- return static::SUCCESS;
- }
-}
--- /dev/null
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCA\Webhooks\Command;
+
+use OC\Core\Command\Base;
+use OCA\Webhooks\Db\WebhookListener;
+use OCA\Webhooks\Db\WebhookListenerMapper;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class ListWebhooks extends Base {
+ public function __construct(
+ private WebhookListenerMapper $mapper,
+ ) {
+ parent::__construct();
+ }
+
+ protected function configure(): void {
+ parent::configure();
+ $this
+ ->setName('webhooks:list')
+ ->setDescription('Lists configured webhooks');
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output): int {
+ $webhookListeners = array_map(
+ fn (WebhookListener $listener): array => array_map(
+ fn (string|array|null $value): ?string => (is_array($value) ? json_encode($value) : $value),
+ $listener->jsonSerialize()
+ ),
+ $this->mapper->getAll()
+ );
+ $this->writeTableInOutputFormat($input, $output, $webhookListeners);
+ return static::SUCCESS;
+ }
+}