From e364f44954590868eaa5a2075fba5ce0a1ceaed0 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Mon, 27 Nov 2023 14:45:35 -0800 Subject: [PATCH 01/12] MakeCommandLazyRector --- src/Command/Archive/ArchiveExportCommand.php | 3 ++- src/Command/Self/ListCommand.php | 6 ++++-- tests/phpunit/src/Application/KernelTest.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Command/Archive/ArchiveExportCommand.php b/src/Command/Archive/ArchiveExportCommand.php index 22fdb093b..ea9aa74c0 100644 --- a/src/Command/Archive/ArchiveExportCommand.php +++ b/src/Command/Archive/ArchiveExportCommand.php @@ -9,6 +9,7 @@ use Acquia\Cli\Output\Checklist; use Acquia\DrupalEnvironmentDetector\AcquiaDrupalEnvironmentDetector; use Closure; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -17,6 +18,7 @@ use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Path; +#[AsCommand(name: 'archive:export')] class ArchiveExportCommand extends CommandBase { protected Checklist $checklist; @@ -35,7 +37,6 @@ protected function commandRequiresDatabase(): bool { } protected function configure(): void { - $this->setName('archive:export'); $this->setDescription('Export an archive of the Drupal application including code, files, and database') ->addArgument('destination-dir', InputArgument::REQUIRED, 'The destination directory for the archive file') ->addOption('source-dir', 'dir', InputOption::VALUE_REQUIRED, 'The directory containing the Drupal project to be pushed') diff --git a/src/Command/Self/ListCommand.php b/src/Command/Self/ListCommand.php index 98f7481ac..d04b99358 100644 --- a/src/Command/Self/ListCommand.php +++ b/src/Command/Self/ListCommand.php @@ -6,17 +6,19 @@ use Acquia\Cli\Command\Acsf\AcsfListCommandBase; use Acquia\Cli\Command\Api\ApiListCommandBase; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\DescriptorHelper; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'list')] class ListCommand extends \Symfony\Component\Console\Command\ListCommand { protected function configure(): void { parent::configure(); - $this->setName('self:list') - ->setAliases(['list']); + $this + ->setAliases(['self:list']); } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/tests/phpunit/src/Application/KernelTest.php b/tests/phpunit/src/Application/KernelTest.php index 7bd3b929c..fc858a044 100644 --- a/tests/phpunit/src/Application/KernelTest.php +++ b/tests/phpunit/src/Application/KernelTest.php @@ -39,6 +39,7 @@ private function getStart(): string { completion Dump the shell completion script docs Open Acquia product documentation in a web browser help Display help for a command + list [self:list] List commands acsf acsf:list [acsf] List all Acquia Cloud Site Factory commands api @@ -99,7 +100,6 @@ private function getEnd(): string { remote:ssh [ssh] Use SSH to open a shell or run a command in a Cloud Platform environment self self:clear-caches [cc|cr] Clears local Acquia CLI caches - self:list [list] List commands self:telemetry:disable [telemetry:disable] Disable anonymous sharing of usage and performance data self:telemetry:enable [telemetry:enable] Enable anonymous sharing of usage and performance data self:telemetry:toggle [telemetry] Toggle anonymous sharing of usage and performance data From db295965ccddd7970ed80dd8b0eea53eb8d1ca6e Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 28 Nov 2023 07:23:40 -0800 Subject: [PATCH 02/12] envrc --- .envrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .envrc diff --git a/.envrc b/.envrc new file mode 100644 index 000000000..6444c8560 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +export PATH="$PATH:${PWD}/vendor/bin" From 0c1310ca35baf33f7824a8d88310d6cc7d6db17f Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 28 Nov 2023 07:23:58 -0800 Subject: [PATCH 03/12] CommandPropertyToAttributeRector (broken) --- src/Command/Acsf/AcsfListCommand.php | 7 ++++++- src/Command/Api/ApiListCommand.php | 7 ++++++- src/Command/App/AppOpenCommand.php | 8 +++++++- src/Command/App/AppVcsInfo.php | 8 +++++++- src/Command/App/LinkCommand.php | 8 +++++++- src/Command/App/LogTailCommand.php | 8 +++++++- src/Command/App/NewCommand.php | 8 +++++++- src/Command/App/NewFromDrupal7Command.php | 7 ++++++- src/Command/App/TaskWaitCommand.php | 8 +++++++- src/Command/App/UnlinkCommand.php | 8 +++++++- src/Command/Archive/ArchiveExportCommand.php | 7 ++++++- src/Command/Auth/AuthAcsfLoginCommand.php | 8 +++++++- src/Command/Auth/AuthAcsfLogoutCommand.php | 7 ++++++- src/Command/Auth/AuthLoginCommand.php | 8 +++++++- src/Command/Auth/AuthLogoutCommand.php | 8 +++++++- src/Command/CodeStudio/CodeStudioPhpVersionCommand.php | 7 ++++++- .../CodeStudio/CodeStudioPipelinesMigrateCommand.php | 7 ++++++- src/Command/CodeStudio/CodeStudioWizardCommand.php | 7 ++++++- src/Command/DocsCommand.php | 8 +++++++- src/Command/Email/ConfigurePlatformEmailCommand.php | 8 +++++++- src/Command/Email/EmailInfoForSubscriptionCommand.php | 8 +++++++- src/Command/Env/EnvCertCreateCommand.php | 8 +++++++- src/Command/Env/EnvCopyCronCommand.php | 8 +++++++- src/Command/Env/EnvCreateCommand.php | 6 +++++- src/Command/Env/EnvDeleteCommand.php | 7 ++++++- src/Command/Env/EnvMirrorCommand.php | 6 +++++- src/Command/HelloWorldCommand.php | 8 +++++++- src/Command/Ide/IdeCreateCommand.php | 6 +++++- src/Command/Ide/IdeDeleteCommand.php | 6 +++++- src/Command/Ide/IdeInfoCommand.php | 7 ++++++- src/Command/Ide/IdeListCommand.php | 7 ++++++- src/Command/Ide/IdeListMineCommand.php | 7 ++++++- src/Command/Ide/IdeOpenCommand.php | 8 +++++++- src/Command/Ide/IdePhpVersionCommand.php | 7 ++++++- src/Command/Ide/IdeServiceRestartCommand.php | 8 +++++++- src/Command/Ide/IdeServiceStartCommand.php | 8 +++++++- src/Command/Ide/IdeServiceStopCommand.php | 8 +++++++- src/Command/Ide/IdeShareCommand.php | 7 ++++++- src/Command/Ide/IdeXdebugToggleCommand.php | 7 ++++++- src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php | 8 +++++++- src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php | 7 ++++++- src/Command/Pull/PullCodeCommand.php | 8 +++++++- src/Command/Pull/PullCommand.php | 7 ++++++- src/Command/Pull/PullDatabaseCommand.php | 8 +++++++- src/Command/Pull/PullFilesCommand.php | 8 +++++++- src/Command/Pull/PullScriptsCommand.php | 8 +++++++- src/Command/Push/PushArtifactCommand.php | 7 ++++++- src/Command/Push/PushCodeCommand.php | 8 +++++++- src/Command/Push/PushDatabaseCommand.php | 8 +++++++- src/Command/Push/PushFilesCommand.php | 8 +++++++- src/Command/Remote/AliasListCommand.php | 8 +++++++- src/Command/Remote/AliasesDownloadCommand.php | 7 ++++++- src/Command/Remote/DrushCommand.php | 7 ++++++- src/Command/Remote/SshCommand.php | 8 +++++++- src/Command/Self/ClearCacheCommand.php | 8 +++++++- src/Command/Self/MakeDocsCommand.php | 8 +++++++- src/Command/Self/TelemetryCommand.php | 8 +++++++- src/Command/Self/TelemetryDisableCommand.php | 8 +++++++- src/Command/Self/TelemetryEnableCommand.php | 8 +++++++- src/Command/Ssh/SshKeyCreateCommand.php | 8 +++++++- src/Command/Ssh/SshKeyCreateUploadCommand.php | 8 +++++++- src/Command/Ssh/SshKeyDeleteCommand.php | 7 ++++++- src/Command/Ssh/SshKeyInfoCommand.php | 8 +++++++- src/Command/Ssh/SshKeyListCommand.php | 7 ++++++- src/Command/Ssh/SshKeyUploadCommand.php | 8 +++++++- 65 files changed, 425 insertions(+), 65 deletions(-) diff --git a/src/Command/Acsf/AcsfListCommand.php b/src/Command/Acsf/AcsfListCommand.php index a8ab2816b..5f3b7c0d4 100644 --- a/src/Command/Acsf/AcsfListCommand.php +++ b/src/Command/Acsf/AcsfListCommand.php @@ -9,10 +9,15 @@ #[AsCommand(name: 'acsf:list')] class AcsfListCommand extends AcsfListCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = "List all Acquia Cloud Site Factory commands"; protected string $namespace = 'acsf'; protected function configure(): void { - $this->setDescription("List all Acquia Cloud Site Factory commands") + $this ->setAliases(['acsf']); } diff --git a/src/Command/Api/ApiListCommand.php b/src/Command/Api/ApiListCommand.php index 3d5eabc91..78d21eb9c 100644 --- a/src/Command/Api/ApiListCommand.php +++ b/src/Command/Api/ApiListCommand.php @@ -9,10 +9,15 @@ #[AsCommand(name: 'api:list')] class ApiListCommand extends ApiListCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = "List all API commands"; protected string $namespace = 'api'; protected function configure(): void { - $this->setDescription("List all API commands") + $this ->setAliases(['api']); } diff --git a/src/Command/App/AppOpenCommand.php b/src/Command/App/AppOpenCommand.php index 9a51ba0e2..933a44db7 100644 --- a/src/Command/App/AppOpenCommand.php +++ b/src/Command/App/AppOpenCommand.php @@ -14,8 +14,14 @@ #[AsCommand(name: 'app:open')] class AppOpenCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Opens your browser to view a given Cloud application'; + protected function configure(): void { - $this->setDescription('Opens your browser to view a given Cloud application') + $this ->acceptApplicationUuid() ->setAliases(['open', 'o']); } diff --git a/src/Command/App/AppVcsInfo.php b/src/Command/App/AppVcsInfo.php index 8be360d62..c9001593d 100644 --- a/src/Command/App/AppVcsInfo.php +++ b/src/Command/App/AppVcsInfo.php @@ -17,8 +17,14 @@ #[AsCommand(name: 'app:vcs:info')] class AppVcsInfo extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Get all branches and tags of the application with the deployment status'; + protected function configure(): void { - $this->setDescription('Get all branches and tags of the application with the deployment status') + $this ->addOption('deployed', NULL, InputOption::VALUE_OPTIONAL, 'Show only deployed branches and tags') ->addUsage('[] --deployed'); $this->acceptApplicationUuid(); diff --git a/src/Command/App/LinkCommand.php b/src/Command/App/LinkCommand.php index 2d6108f01..184f75994 100644 --- a/src/Command/App/LinkCommand.php +++ b/src/Command/App/LinkCommand.php @@ -13,8 +13,14 @@ #[AsCommand(name: 'app:link')] class LinkCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Associate your project with a Cloud Platform application'; + protected function configure(): void { - $this->setDescription('Associate your project with a Cloud Platform application') + $this ->setAliases(['link']); $this->acceptApplicationUuid(); } diff --git a/src/Command/App/LogTailCommand.php b/src/Command/App/LogTailCommand.php index 8e66908e3..9e869b441 100644 --- a/src/Command/App/LogTailCommand.php +++ b/src/Command/App/LogTailCommand.php @@ -14,8 +14,14 @@ #[AsCommand(name: 'app:log:tail')] class LogTailCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Tail the logs from your environments'; + protected function configure(): void { - $this->setDescription('Tail the logs from your environments') + $this ->acceptEnvironmentId() ->setAliases(['tail', 'log:tail']); } diff --git a/src/Command/App/NewCommand.php b/src/Command/App/NewCommand.php index 83f5f5bee..084300538 100644 --- a/src/Command/App/NewCommand.php +++ b/src/Command/App/NewCommand.php @@ -17,8 +17,14 @@ #[AsCommand(name: 'app:new:local')] class NewCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Create a new Drupal or Next.js project'; + protected function configure(): void { - $this->setDescription('Create a new Drupal or Next.js project') + $this ->addArgument('directory', InputArgument::OPTIONAL, 'The destination directory') ->setAliases(['new']); } diff --git a/src/Command/App/NewFromDrupal7Command.php b/src/Command/App/NewFromDrupal7Command.php index 7cf30ec2d..8389080b1 100644 --- a/src/Command/App/NewFromDrupal7Command.php +++ b/src/Command/App/NewFromDrupal7Command.php @@ -25,6 +25,11 @@ #[AsCommand(name: 'app:new:from:drupal7')] class NewFromDrupal7Command extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Generate a new Drupal 9+ project from a Drupal 7 application using the default Acquia Migrate Accelerate recommendations.'; /** * Exit code raised when the URI flag does not correspond to configuration. * @@ -42,7 +47,7 @@ class NewFromDrupal7Command extends CommandBase { public const ERR_INDETERMINATE_SITE = 4; protected function configure(): void { - $this->setDescription('Generate a new Drupal 9+ project from a Drupal 7 application using the default Acquia Migrate Accelerate recommendations.') + $this ->addOption('drupal7-directory', 'source', InputOption::VALUE_OPTIONAL, 'The root of the Drupal 7 application') ->addOption('drupal7-uri', 'uri', InputOption::VALUE_OPTIONAL, 'Only necessary in case of a multisite. If a single site, this will be computed automatically.') ->addOption('stored-analysis', 'analysis', InputOption::VALUE_OPTIONAL, 'As an alternative to drupal7-directory, it is possible to pass a stored analysis.') diff --git a/src/Command/App/TaskWaitCommand.php b/src/Command/App/TaskWaitCommand.php index e9ac1c9d0..f5b77e633 100644 --- a/src/Command/App/TaskWaitCommand.php +++ b/src/Command/App/TaskWaitCommand.php @@ -14,8 +14,14 @@ #[AsCommand(name: 'app:task-wait')] class TaskWaitCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Wait for a task to complete'; + protected function configure(): void { - $this->setDescription('Wait for a task to complete') + $this ->addArgument('notification-uuid', InputArgument::REQUIRED, 'The task notification UUID or Cloud Platform API response containing a linked notification') ->setHelp('Accepts either a notification UUID or Cloud Platform API response as JSON string. The JSON string must contain the _links->notification->href property.') ->addUsage('"$(acli api:environments:domain-clear-caches [environmentId] [domain])"'); diff --git a/src/Command/App/UnlinkCommand.php b/src/Command/App/UnlinkCommand.php index dad0de513..60b3bca6e 100644 --- a/src/Command/App/UnlinkCommand.php +++ b/src/Command/App/UnlinkCommand.php @@ -14,8 +14,14 @@ #[AsCommand(name: 'app:unlink')] class UnlinkCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Remove local association between your project and a Cloud Platform application'; + protected function configure(): void { - $this->setDescription('Remove local association between your project and a Cloud Platform application') + $this ->setAliases(['unlink']); } diff --git a/src/Command/Archive/ArchiveExportCommand.php b/src/Command/Archive/ArchiveExportCommand.php index ea9aa74c0..a552c08ae 100644 --- a/src/Command/Archive/ArchiveExportCommand.php +++ b/src/Command/Archive/ArchiveExportCommand.php @@ -21,6 +21,11 @@ #[AsCommand(name: 'archive:export')] class ArchiveExportCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Export an archive of the Drupal application including code, files, and database'; protected Checklist $checklist; private Filesystem $fs; @@ -37,7 +42,7 @@ protected function commandRequiresDatabase(): bool { } protected function configure(): void { - $this->setDescription('Export an archive of the Drupal application including code, files, and database') + $this ->addArgument('destination-dir', InputArgument::REQUIRED, 'The destination directory for the archive file') ->addOption('source-dir', 'dir', InputOption::VALUE_REQUIRED, 'The directory containing the Drupal project to be pushed') ->addOption('no-files', NULL, InputOption::VALUE_NONE, 'Exclude public files directory from archive') diff --git a/src/Command/Auth/AuthAcsfLoginCommand.php b/src/Command/Auth/AuthAcsfLoginCommand.php index 7678e50b7..bdacdbaf9 100644 --- a/src/Command/Auth/AuthAcsfLoginCommand.php +++ b/src/Command/Auth/AuthAcsfLoginCommand.php @@ -14,8 +14,14 @@ #[AsCommand(name: 'auth:acsf-login')] class AuthAcsfLoginCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Register your Site Factory API key and secret to use API functionality'; + protected function configure(): void { - $this->setDescription('Register your Site Factory API key and secret to use API functionality') + $this ->addOption('username', 'u', InputOption::VALUE_REQUIRED, "Your Site Factory username") ->addOption('key', 'k', InputOption::VALUE_REQUIRED, "Your Site Factory key") ->addOption('factory-url', 'f', InputOption::VALUE_REQUIRED, "Your Site Factory URL"); diff --git a/src/Command/Auth/AuthAcsfLogoutCommand.php b/src/Command/Auth/AuthAcsfLogoutCommand.php index b979871fa..0850b641d 100644 --- a/src/Command/Auth/AuthAcsfLogoutCommand.php +++ b/src/Command/Auth/AuthAcsfLogoutCommand.php @@ -13,8 +13,13 @@ #[AsCommand(name: 'auth:acsf-logout')] class AuthAcsfLogoutCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Remove your Site Factory key and secret from your local machine.'; + protected function configure(): void { - $this->setDescription('Remove your Site Factory key and secret from your local machine.'); } protected function commandRequiresAuthentication(): bool { diff --git a/src/Command/Auth/AuthLoginCommand.php b/src/Command/Auth/AuthLoginCommand.php index 48b4748f4..53434f52e 100644 --- a/src/Command/Auth/AuthLoginCommand.php +++ b/src/Command/Auth/AuthLoginCommand.php @@ -14,8 +14,14 @@ #[AsCommand(name: 'auth:login')] class AuthLoginCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Register your Cloud API key and secret to use API functionality'; + protected function configure(): void { - $this->setDescription('Register your Cloud API key and secret to use API functionality') + $this ->setAliases(['login']) ->addOption('key', 'k', InputOption::VALUE_REQUIRED, 'Your Cloud API key') ->addOption('secret', 's', InputOption::VALUE_REQUIRED, 'Your Cloud API secret'); diff --git a/src/Command/Auth/AuthLogoutCommand.php b/src/Command/Auth/AuthLogoutCommand.php index b9eab222e..4af365e99 100644 --- a/src/Command/Auth/AuthLogoutCommand.php +++ b/src/Command/Auth/AuthLogoutCommand.php @@ -13,8 +13,14 @@ #[AsCommand(name: 'auth:logout')] class AuthLogoutCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Remove Cloud API key and secret from local machine.'; + protected function configure(): void { - $this->setDescription('Remove Cloud API key and secret from local machine.') + $this ->setAliases(['logout']); } diff --git a/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php b/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php index 47582765d..5b90452ca 100644 --- a/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php +++ b/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php @@ -14,10 +14,15 @@ #[AsCommand(name: 'codestudio:php-version')] class CodeStudioPhpVersionCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Change the PHP version in Code Studio'; use CodeStudioCommandTrait; protected function configure(): void { - $this->setDescription('Change the PHP version in Code Studio') + $this ->addArgument('php-version', InputArgument::REQUIRED, 'The PHP version that needs to configured or updated') ->addUsage('8.1 myapp') ->addUsage('8.1 abcd1234-1111-2222-3333-0e02b2c3d470'); diff --git a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php index 869d13342..ca867adef 100644 --- a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php +++ b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php @@ -19,10 +19,15 @@ #[AsCommand(name: 'codestudio:pipelines-migrate')] class CodeStudioPipelinesMigrateCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Migrate .acquia-pipeline.yml file to .gitlab-ci.yml file for a given Acquia Cloud application'; use CodeStudioCommandTrait; protected function configure(): void { - $this->setDescription('Migrate .acquia-pipeline.yml file to .gitlab-ci.yml file for a given Acquia Cloud application') + $this ->addOption('key', NULL, InputOption::VALUE_REQUIRED, 'The Cloud Platform API token that Code Studio will use') ->addOption('secret', NULL, InputOption::VALUE_REQUIRED, 'The Cloud Platform API secret that Code Studio will use') ->addOption('gitlab-token', NULL, InputOption::VALUE_REQUIRED, 'The GitLab personal access token that will be used to communicate with the GitLab instance') diff --git a/src/Command/CodeStudio/CodeStudioWizardCommand.php b/src/Command/CodeStudio/CodeStudioWizardCommand.php index b47e14bdb..490a45085 100644 --- a/src/Command/CodeStudio/CodeStudioWizardCommand.php +++ b/src/Command/CodeStudio/CodeStudioWizardCommand.php @@ -18,12 +18,17 @@ #[AsCommand(name: 'codestudio:wizard')] class CodeStudioWizardCommand extends WizardCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Create and/or configure a new Code Studio project for a given Acquia Cloud application'; use CodeStudioCommandTrait; private Checklist $checklist; protected function configure(): void { - $this->setDescription('Create and/or configure a new Code Studio project for a given Acquia Cloud application') + $this ->addOption('key', NULL, InputOption::VALUE_REQUIRED, 'The Cloud Platform API token that Code Studio will use') ->addOption('secret', NULL, InputOption::VALUE_REQUIRED, 'The Cloud Platform API secret that Code Studio will use') ->addOption('gitlab-token', NULL, InputOption::VALUE_REQUIRED, 'The GitLab personal access token that will be used to communicate with the GitLab instance') diff --git a/src/Command/DocsCommand.php b/src/Command/DocsCommand.php index 310aab66e..76ff0538b 100644 --- a/src/Command/DocsCommand.php +++ b/src/Command/DocsCommand.php @@ -14,8 +14,14 @@ #[AsCommand(name: 'docs')] class DocsCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Open Acquia product documentation in a web browser'; + protected function configure(): void { - $this->setDescription('Open Acquia product documentation in a web browser') + $this ->addArgument('product', InputArgument::OPTIONAL, 'Acquia Product Name') ->addUsage('acli'); } diff --git a/src/Command/Email/ConfigurePlatformEmailCommand.php b/src/Command/Email/ConfigurePlatformEmailCommand.php index 3c1917cb8..6b4dfeda1 100644 --- a/src/Command/Email/ConfigurePlatformEmailCommand.php +++ b/src/Command/Email/ConfigurePlatformEmailCommand.php @@ -28,8 +28,14 @@ #[AsCommand(name: 'email:configure')] class ConfigurePlatformEmailCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Configure Platform email for one or more applications'; + protected function configure(): void { - $this->setDescription('Configure Platform email for one or more applications') + $this ->addArgument('subscriptionUuid', InputArgument::OPTIONAL, 'The subscription UUID to register the domain with.') ->setHelp('This command configures Platform Email for a domain in a subscription. It registers the domain with the subscription, associates the domain with an application or set of applications, and enables Platform Email for selected environments of these applications.') ->setAliases(['ec']); diff --git a/src/Command/Email/EmailInfoForSubscriptionCommand.php b/src/Command/Email/EmailInfoForSubscriptionCommand.php index 239ee919b..a64655a7a 100644 --- a/src/Command/Email/EmailInfoForSubscriptionCommand.php +++ b/src/Command/Email/EmailInfoForSubscriptionCommand.php @@ -21,8 +21,14 @@ #[AsCommand(name: 'email:info')] class EmailInfoForSubscriptionCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Print information related to Platform Email set up in a subscription.'; + protected function configure(): void { - $this->setDescription('Print information related to Platform Email set up in a subscription.') + $this ->addArgument('subscriptionUuid', InputArgument::OPTIONAL, 'The subscription UUID whose Platform Email configuration is to be checked.') ->setHelp('This command lists information related to Platform Email for a subscription, including which domains have been validated, which have not, and which applications have Platform Email domains associated.'); } diff --git a/src/Command/Env/EnvCertCreateCommand.php b/src/Command/Env/EnvCertCreateCommand.php index 2f8e4f8cb..70019570f 100644 --- a/src/Command/Env/EnvCertCreateCommand.php +++ b/src/Command/Env/EnvCertCreateCommand.php @@ -16,8 +16,14 @@ #[AsCommand(name: 'env:certificate-create')] class EnvCertCreateCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Install an SSL certificate.'; + protected function configure(): void { - $this->setDescription('Install an SSL certificate.') + $this ->addArgument('certificate', InputArgument::REQUIRED, 'Filename of the SSL certificate being installed') ->addArgument('private-key', InputArgument::REQUIRED, 'Filename of the SSL private key') ->addOption('legacy', '', InputOption::VALUE_OPTIONAL, 'True for legacy certificates', FALSE) diff --git a/src/Command/Env/EnvCopyCronCommand.php b/src/Command/Env/EnvCopyCronCommand.php index d63f5ce65..d979c1e5a 100644 --- a/src/Command/Env/EnvCopyCronCommand.php +++ b/src/Command/Env/EnvCopyCronCommand.php @@ -16,8 +16,14 @@ #[AsCommand(name: 'env:cron-copy')] class EnvCopyCronCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Copy all cron tasks from one Acquia Cloud Platform environment to another'; + protected function configure(): void { - $this->setDescription('Copy all cron tasks from one Acquia Cloud Platform environment to another') + $this ->addArgument('source_env', InputArgument::REQUIRED, 'Alias of the source environment in the format `app-name.env` or the environment uuid') ->addArgument('dest_env', InputArgument::REQUIRED, 'Alias of the destination environment in the format `app-name.env` or the environment uuid') ->addUsage(' ') diff --git a/src/Command/Env/EnvCreateCommand.php b/src/Command/Env/EnvCreateCommand.php index 8903e7abf..186adeee5 100644 --- a/src/Command/Env/EnvCreateCommand.php +++ b/src/Command/Env/EnvCreateCommand.php @@ -19,10 +19,14 @@ #[AsCommand(name: 'env:create')] class EnvCreateCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Create a new Continuous Delivery Environment (CDE)'; private Checklist $checklist; protected function configure(): void { - $this->setDescription('Create a new Continuous Delivery Environment (CDE)'); $this->addArgument('label', InputArgument::REQUIRED, 'The label of the new environment'); $this->addArgument('branch', InputArgument::OPTIONAL, 'The vcs path (git branch name) to deploy to the new environment'); $this->acceptApplicationUuid(); diff --git a/src/Command/Env/EnvDeleteCommand.php b/src/Command/Env/EnvDeleteCommand.php index 68175b54e..78b09ec92 100644 --- a/src/Command/Env/EnvDeleteCommand.php +++ b/src/Command/Env/EnvDeleteCommand.php @@ -16,8 +16,13 @@ #[AsCommand(name: 'env:delete')] class EnvDeleteCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Delete a Continuous Delivery Environment (CDE)'; + protected function configure(): void { - $this->setDescription('Delete a Continuous Delivery Environment (CDE)'); $this->acceptEnvironmentId(); } diff --git a/src/Command/Env/EnvMirrorCommand.php b/src/Command/Env/EnvMirrorCommand.php index f8d016c41..445067368 100644 --- a/src/Command/Env/EnvMirrorCommand.php +++ b/src/Command/Env/EnvMirrorCommand.php @@ -20,10 +20,14 @@ #[AsCommand(name: 'env:mirror')] class EnvMirrorCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Makes one environment identical to another in terms of code, database, files, and configuration.'; private Checklist $checklist; protected function configure(): void { - $this->setDescription('Makes one environment identical to another in terms of code, database, files, and configuration.'); $this->addArgument('source-environment', InputArgument::REQUIRED, 'The Cloud Platform source environment ID or alias') ->addUsage('[]') ->addUsage('myapp.dev') diff --git a/src/Command/HelloWorldCommand.php b/src/Command/HelloWorldCommand.php index 89a56642f..729805db6 100644 --- a/src/Command/HelloWorldCommand.php +++ b/src/Command/HelloWorldCommand.php @@ -12,8 +12,14 @@ #[AsCommand(name: 'hello-world')] class HelloWorldCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Test command used for asserting core functionality'; + protected function configure(): void { - $this->setDescription('Test command used for asserting core functionality') + $this ->setHidden(); } diff --git a/src/Command/Ide/IdeCreateCommand.php b/src/Command/Ide/IdeCreateCommand.php index 3b46a7c71..a8fa9f48f 100644 --- a/src/Command/Ide/IdeCreateCommand.php +++ b/src/Command/Ide/IdeCreateCommand.php @@ -23,12 +23,16 @@ #[AsCommand(name: 'ide:create')] class IdeCreateCommand extends IdeCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Create a Cloud IDE'; private IdeResponse $ide; private Client $client; protected function configure(): void { - $this->setDescription('Create a Cloud IDE'); $this->acceptApplicationUuid(); $this->addOption('label', NULL, InputOption::VALUE_REQUIRED, 'The label for the IDE'); } diff --git a/src/Command/Ide/IdeDeleteCommand.php b/src/Command/Ide/IdeDeleteCommand.php index edbf0e4a5..5cc34f324 100644 --- a/src/Command/Ide/IdeDeleteCommand.php +++ b/src/Command/Ide/IdeDeleteCommand.php @@ -14,10 +14,14 @@ #[AsCommand(name: 'ide:delete')] class IdeDeleteCommand extends IdeCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Delete a Cloud IDE'; use SshCommandTrait; protected function configure(): void { - $this->setDescription('Delete a Cloud IDE'); $this->acceptApplicationUuid(); // @todo Add option to accept an ide UUID. } diff --git a/src/Command/Ide/IdeInfoCommand.php b/src/Command/Ide/IdeInfoCommand.php index d2a530a92..6c6769ebf 100644 --- a/src/Command/Ide/IdeInfoCommand.php +++ b/src/Command/Ide/IdeInfoCommand.php @@ -14,8 +14,13 @@ #[AsCommand(name: 'ide:info')] class IdeInfoCommand extends IdeCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Print information about a Cloud IDE'; + protected function configure(): void { - $this->setDescription('Print information about a Cloud IDE'); $this->acceptApplicationUuid(); } diff --git a/src/Command/Ide/IdeListCommand.php b/src/Command/Ide/IdeListCommand.php index 8d255ec44..63dbe5a1b 100644 --- a/src/Command/Ide/IdeListCommand.php +++ b/src/Command/Ide/IdeListCommand.php @@ -15,8 +15,13 @@ #[AsCommand(name: 'ide:list:app')] class IdeListCommand extends IdeCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'List available Cloud IDEs belonging to a given application'; + protected function configure(): void { - $this->setDescription('List available Cloud IDEs belonging to a given application'); $this->setAliases(['ide:list']); $this->acceptApplicationUuid(); } diff --git a/src/Command/Ide/IdeListMineCommand.php b/src/Command/Ide/IdeListMineCommand.php index 53ceca4d4..099de5a83 100644 --- a/src/Command/Ide/IdeListMineCommand.php +++ b/src/Command/Ide/IdeListMineCommand.php @@ -16,8 +16,13 @@ #[AsCommand(name: 'ide:list:mine')] class IdeListMineCommand extends IdeCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'List Cloud IDEs belonging to you'; + protected function configure(): void { - $this->setDescription('List Cloud IDEs belonging to you'); } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Command/Ide/IdeOpenCommand.php b/src/Command/Ide/IdeOpenCommand.php index 5c30d90a6..29f55e15c 100644 --- a/src/Command/Ide/IdeOpenCommand.php +++ b/src/Command/Ide/IdeOpenCommand.php @@ -14,8 +14,14 @@ #[AsCommand(name: 'ide:open')] class IdeOpenCommand extends IdeCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Open a Cloud IDE in your browser'; + protected function configure(): void { - $this->setDescription('Open a Cloud IDE in your browser') + $this ->setHidden(AcquiaDrupalEnvironmentDetector::isAhIdeEnv()); $this->acceptApplicationUuid(); // @todo Add option to accept an ide UUID. diff --git a/src/Command/Ide/IdePhpVersionCommand.php b/src/Command/Ide/IdePhpVersionCommand.php index 7ca48edef..339864e7b 100644 --- a/src/Command/Ide/IdePhpVersionCommand.php +++ b/src/Command/Ide/IdePhpVersionCommand.php @@ -15,6 +15,11 @@ #[AsCommand(name: 'ide:php-version')] class IdePhpVersionCommand extends IdeCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Change the PHP version in the current IDE'; private string $idePhpFilePathPrefix; /* @@ -27,7 +32,7 @@ protected function commandRequiresAuthentication(): bool { } protected function configure(): void { - $this->setDescription('Change the PHP version in the current IDE') + $this ->addArgument('version', InputArgument::REQUIRED, 'The PHP version') ->setHidden(!AcquiaDrupalEnvironmentDetector::isAhIdeEnv()); } diff --git a/src/Command/Ide/IdeServiceRestartCommand.php b/src/Command/Ide/IdeServiceRestartCommand.php index 9d3517c45..4955b64de 100644 --- a/src/Command/Ide/IdeServiceRestartCommand.php +++ b/src/Command/Ide/IdeServiceRestartCommand.php @@ -17,12 +17,18 @@ #[AsCommand(name: 'ide:service-restart')] class IdeServiceRestartCommand extends IdeCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Restart a service in the Cloud IDE'; + protected function commandRequiresAuthentication(): bool { return FALSE; } protected function configure(): void { - $this->setDescription('Restart a service in the Cloud IDE') + $this ->addArgument('service', InputArgument::REQUIRED, 'The name of the service to restart') ->addUsage('php') ->addUsage('apache') diff --git a/src/Command/Ide/IdeServiceStartCommand.php b/src/Command/Ide/IdeServiceStartCommand.php index 8bb63bc8f..0bb4d6c99 100644 --- a/src/Command/Ide/IdeServiceStartCommand.php +++ b/src/Command/Ide/IdeServiceStartCommand.php @@ -17,12 +17,18 @@ #[AsCommand(name: 'ide:service-start')] class IdeServiceStartCommand extends IdeCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Start a service in the Cloud IDE'; + protected function commandRequiresAuthentication(): bool { return FALSE; } protected function configure(): void { - $this->setDescription('Start a service in the Cloud IDE') + $this ->addArgument('service', InputArgument::REQUIRED, 'The name of the service to start') ->addUsage('php') ->addUsage('apache') diff --git a/src/Command/Ide/IdeServiceStopCommand.php b/src/Command/Ide/IdeServiceStopCommand.php index fc0c1c26d..a0766197d 100644 --- a/src/Command/Ide/IdeServiceStopCommand.php +++ b/src/Command/Ide/IdeServiceStopCommand.php @@ -17,12 +17,18 @@ #[AsCommand(name: 'ide:service-stop')] class IdeServiceStopCommand extends IdeCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Stop a service in the Cloud IDE'; + protected function commandRequiresAuthentication(): bool { return FALSE; } protected function configure(): void { - $this->setDescription('Stop a service in the Cloud IDE') + $this ->addArgument('service', InputArgument::REQUIRED, 'The name of the service to stop') ->addUsage('php') ->addUsage('apache') diff --git a/src/Command/Ide/IdeShareCommand.php b/src/Command/Ide/IdeShareCommand.php index 2ae12137e..feb6c0395 100644 --- a/src/Command/Ide/IdeShareCommand.php +++ b/src/Command/Ide/IdeShareCommand.php @@ -17,6 +17,11 @@ #[AsCommand(name: 'ide:share')] class IdeShareCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Get the share URL for a Cloud IDE'; /** * @var array */ @@ -27,7 +32,7 @@ protected function commandRequiresAuthentication(): bool { } protected function configure(): void { - $this->setDescription('Get the share URL for a Cloud IDE') + $this ->addOption('regenerate', '', InputOption::VALUE_NONE, 'regenerate the share code') ->setHidden(!AcquiaDrupalEnvironmentDetector::isAhIdeEnv()); } diff --git a/src/Command/Ide/IdeXdebugToggleCommand.php b/src/Command/Ide/IdeXdebugToggleCommand.php index 51412bc9f..5f5758162 100644 --- a/src/Command/Ide/IdeXdebugToggleCommand.php +++ b/src/Command/Ide/IdeXdebugToggleCommand.php @@ -14,6 +14,11 @@ #[AsCommand(name: 'ide:xdebug-toggle')] class IdeXdebugToggleCommand extends IdeCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Toggle Xdebug on or off in the current IDE'; private ?bool $xDebugEnabled; protected function commandRequiresAuthentication(): bool { @@ -21,7 +26,7 @@ protected function commandRequiresAuthentication(): bool { } protected function configure(): void { - $this->setDescription('Toggle Xdebug on or off in the current IDE') + $this ->setAliases(['xdebug']) ->setHidden(!AcquiaDrupalEnvironmentDetector::isAhIdeEnv()); } diff --git a/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php b/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php index a04c8992f..325ed417d 100644 --- a/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php +++ b/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php @@ -15,8 +15,14 @@ #[AsCommand(name: 'ide:wizard:ssh-key:create-upload')] class IdeWizardCreateSshKeyCommand extends IdeWizardCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Wizard to perform first time setup tasks within an IDE'; + protected function configure(): void { - $this->setDescription('Wizard to perform first time setup tasks within an IDE') + $this ->setAliases(['ide:wizard']) ->setHidden(!CommandBase::isAcquiaCloudIde()); } diff --git a/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php b/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php index 78acc380c..b09c11902 100644 --- a/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php +++ b/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php @@ -15,10 +15,15 @@ #[AsCommand(name: 'ide:wizard:ssh-key:delete')] class IdeWizardDeleteSshKeyCommand extends IdeWizardCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Wizard to delete SSH key for IDE from Cloud'; use SshCommandTrait; protected function configure(): void { - $this->setDescription('Wizard to delete SSH key for IDE from Cloud') + $this ->setHidden(!CommandBase::isAcquiaCloudIde()); } diff --git a/src/Command/Pull/PullCodeCommand.php b/src/Command/Pull/PullCodeCommand.php index 72226c866..21f227baf 100644 --- a/src/Command/Pull/PullCodeCommand.php +++ b/src/Command/Pull/PullCodeCommand.php @@ -14,12 +14,18 @@ #[AsCommand(name: 'pull:code')] class PullCodeCommand extends PullCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Copy code from a Cloud Platform environment'; + protected function commandRequiresDatabase(): bool { return TRUE; } protected function configure(): void { - $this->setDescription('Copy code from a Cloud Platform environment') + $this ->acceptEnvironmentId() ->addOption('dir', NULL, InputArgument::OPTIONAL, 'The directory containing the Drupal project to be refreshed') ->addOption('no-scripts', NULL, InputOption::VALUE_NONE, diff --git a/src/Command/Pull/PullCommand.php b/src/Command/Pull/PullCommand.php index 36f9f824e..27349c476 100644 --- a/src/Command/Pull/PullCommand.php +++ b/src/Command/Pull/PullCommand.php @@ -14,13 +14,18 @@ #[AsCommand(name: 'pull:all')] class PullCommand extends PullCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Copy code, database, and files from a Cloud Platform environment'; + protected function commandRequiresDatabase(): bool { return TRUE; } protected function configure(): void { $this->setAliases(['refresh', 'pull']) - ->setDescription('Copy code, database, and files from a Cloud Platform environment') ->acceptEnvironmentId() ->acceptSite() ->addOption('dir', NULL, InputArgument::OPTIONAL, 'The directory containing the Drupal project to be refreshed') diff --git a/src/Command/Pull/PullDatabaseCommand.php b/src/Command/Pull/PullDatabaseCommand.php index 5d5dd3268..cba50c24a 100644 --- a/src/Command/Pull/PullDatabaseCommand.php +++ b/src/Command/Pull/PullDatabaseCommand.php @@ -13,12 +13,18 @@ #[AsCommand(name: 'pull:database')] class PullDatabaseCommand extends PullCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Import database backup from a Cloud Platform environment'; + protected function commandRequiresDatabase(): bool { return TRUE; } protected function configure(): void { - $this->setDescription('Import database backup from a Cloud Platform environment') + $this ->setHelp('This uses the latest available database backup, which may be up to 24 hours old. If no backup exists, one will be created.') ->setAliases(['pull:db']) ->acceptEnvironmentId() diff --git a/src/Command/Pull/PullFilesCommand.php b/src/Command/Pull/PullFilesCommand.php index cc2190145..a8f06dfa3 100644 --- a/src/Command/Pull/PullFilesCommand.php +++ b/src/Command/Pull/PullFilesCommand.php @@ -12,8 +12,14 @@ #[AsCommand(name: 'pull:files')] class PullFilesCommand extends PullCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Copy Drupal public files from a Cloud Platform environment to your local environment'; + protected function configure(): void { - $this->setDescription('Copy Drupal public files from a Cloud Platform environment to your local environment') + $this ->acceptEnvironmentId() ->acceptSite(); } diff --git a/src/Command/Pull/PullScriptsCommand.php b/src/Command/Pull/PullScriptsCommand.php index ffd174fbc..3f261837b 100644 --- a/src/Command/Pull/PullScriptsCommand.php +++ b/src/Command/Pull/PullScriptsCommand.php @@ -13,8 +13,14 @@ #[AsCommand(name: 'pull:run-scripts')] class PullScriptsCommand extends PullCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Execute post pull scripts'; + protected function configure(): void { - $this->setDescription('Execute post pull scripts') + $this ->acceptEnvironmentId() ->addOption('dir', NULL, InputArgument::OPTIONAL, 'The directory containing the Drupal project to be refreshed'); } diff --git a/src/Command/Push/PushArtifactCommand.php b/src/Command/Push/PushArtifactCommand.php index 544ed196f..29cf08c0a 100644 --- a/src/Command/Push/PushArtifactCommand.php +++ b/src/Command/Push/PushArtifactCommand.php @@ -19,6 +19,11 @@ #[AsCommand(name: 'push:artifact')] class PushArtifactCommand extends PullCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Build and push a code artifact to a Cloud Platform environment'; /** * Composer vendor directories. * @@ -40,7 +45,7 @@ class PushArtifactCommand extends PullCommandBase { private string $destinationGitRef; protected function configure(): void { - $this->setDescription('Build and push a code artifact to a Cloud Platform environment') + $this ->addOption('dir', NULL, InputArgument::OPTIONAL, 'The directory containing the Drupal project to be pushed') ->addOption('no-sanitize', NULL, InputOption::VALUE_NONE, 'Do not sanitize the build artifact') ->addOption('dry-run', NULL, InputOption::VALUE_NONE, 'Deprecated: Use no-push instead') diff --git a/src/Command/Push/PushCodeCommand.php b/src/Command/Push/PushCodeCommand.php index 7cbab38ef..eb0e17d77 100644 --- a/src/Command/Push/PushCodeCommand.php +++ b/src/Command/Push/PushCodeCommand.php @@ -14,8 +14,14 @@ #[AsCommand(name: 'push:code')] class PushCodeCommand extends PullCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Push code from your IDE to a Cloud Platform environment'; + protected function configure(): void { - $this->setDescription('Push code from your IDE to a Cloud Platform environment') + $this ->setHidden(!AcquiaDrupalEnvironmentDetector::isAhIdeEnv() && !self::isLandoEnv()); } diff --git a/src/Command/Push/PushDatabaseCommand.php b/src/Command/Push/PushDatabaseCommand.php index db941c5eb..0bf451ff0 100644 --- a/src/Command/Push/PushDatabaseCommand.php +++ b/src/Command/Push/PushDatabaseCommand.php @@ -17,12 +17,18 @@ #[AsCommand(name: 'push:database')] class PushDatabaseCommand extends PullCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Push a database from your local environment to a Cloud Platform environment'; + protected function commandRequiresDatabase(): bool { return TRUE; } protected function configure(): void { - $this->setDescription('Push a database from your local environment to a Cloud Platform environment') + $this ->setAliases(['push:db']) ->acceptEnvironmentId() ->acceptSite(); diff --git a/src/Command/Push/PushFilesCommand.php b/src/Command/Push/PushFilesCommand.php index 9b5ca49cd..31144abac 100644 --- a/src/Command/Push/PushFilesCommand.php +++ b/src/Command/Push/PushFilesCommand.php @@ -15,8 +15,14 @@ #[AsCommand(name: 'push:files')] class PushFilesCommand extends PullCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Copy Drupal public files from your local environment to a Cloud Platform environment'; + protected function configure(): void { - $this->setDescription('Copy Drupal public files from your local environment to a Cloud Platform environment') + $this ->acceptEnvironmentId() ->acceptSite(); } diff --git a/src/Command/Remote/AliasListCommand.php b/src/Command/Remote/AliasListCommand.php index ea9595b5f..446deb305 100644 --- a/src/Command/Remote/AliasListCommand.php +++ b/src/Command/Remote/AliasListCommand.php @@ -16,8 +16,14 @@ #[AsCommand(name: 'remote:aliases:list')] class AliasListCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'List all aliases for the Cloud Platform environments'; + protected function configure(): void { - $this->setDescription('List all aliases for the Cloud Platform environments') + $this ->setAliases(['aliases', 'sa']); $this->acceptApplicationUuid(); } diff --git a/src/Command/Remote/AliasesDownloadCommand.php b/src/Command/Remote/AliasesDownloadCommand.php index e74f448d5..05b94e7ec 100644 --- a/src/Command/Remote/AliasesDownloadCommand.php +++ b/src/Command/Remote/AliasesDownloadCommand.php @@ -23,10 +23,15 @@ #[AsCommand(name: 'remote:aliases:download')] class AliasesDownloadCommand extends SshCommand { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Download Drush aliases for the Cloud Platform'; private string $drushArchiveFilepath; protected function configure(): void { - $this->setDescription('Download Drush aliases for the Cloud Platform') + $this ->addOption('destination-dir', NULL, InputOption::VALUE_REQUIRED, 'The directory to which aliases will be downloaded') ->addOption('all', NULL, InputOption::VALUE_NONE, 'Download the aliases for all applications that you have access to, not just the current one.'); $this->acceptApplicationUuid(); diff --git a/src/Command/Remote/DrushCommand.php b/src/Command/Remote/DrushCommand.php index 441818ff7..91314839a 100644 --- a/src/Command/Remote/DrushCommand.php +++ b/src/Command/Remote/DrushCommand.php @@ -15,9 +15,14 @@ #[AsCommand(name: 'remote:drush')] class DrushCommand extends SshBaseCommand { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Run a Drush command remotely on a application\'s environment'; + protected function configure(): void { $this->setAliases(['drush', 'dr']) - ->setDescription('Run a Drush command remotely on a application\'s environment') ->setHelp('Pay close attention to the argument syntax! Note the usage of -- to separate the drush command arguments and options.') ->addArgument('alias', InputArgument::REQUIRED, 'Alias for application & environment in the format `app-name.env`') ->addArgument('drush_command', InputArgument::IS_ARRAY, 'Drush command') diff --git a/src/Command/Remote/SshCommand.php b/src/Command/Remote/SshCommand.php index c868af4f6..492f17535 100644 --- a/src/Command/Remote/SshCommand.php +++ b/src/Command/Remote/SshCommand.php @@ -16,8 +16,14 @@ #[AsCommand(name: 'remote:ssh')] class SshCommand extends SshBaseCommand { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Use SSH to open a shell or run a command in a Cloud Platform environment'; + protected function configure(): void { - $this->setDescription('Use SSH to open a shell or run a command in a Cloud Platform environment') + $this ->setAliases(['ssh']) ->addArgument('alias', InputArgument::REQUIRED, 'Alias for application & environment in the format `app-name.env`') ->addArgument('ssh_command', InputArgument::IS_ARRAY, 'Command to run via SSH (if not provided, opens a shell in the site directory)') diff --git a/src/Command/Self/ClearCacheCommand.php b/src/Command/Self/ClearCacheCommand.php index b973f9131..ab54c5d1a 100644 --- a/src/Command/Self/ClearCacheCommand.php +++ b/src/Command/Self/ClearCacheCommand.php @@ -15,8 +15,14 @@ #[AsCommand(name: 'self:clear-caches')] class ClearCacheCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Clears local Acquia CLI caches'; + protected function configure(): void { - $this->setDescription('Clears local Acquia CLI caches') + $this ->setAliases(['cc', 'cr']); } diff --git a/src/Command/Self/MakeDocsCommand.php b/src/Command/Self/MakeDocsCommand.php index 743c26f85..9076a8c47 100644 --- a/src/Command/Self/MakeDocsCommand.php +++ b/src/Command/Self/MakeDocsCommand.php @@ -14,8 +14,14 @@ #[AsCommand(name: 'self:make-docs')] class MakeDocsCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Generate documentation for all ACLI commands'; + protected function configure(): void { - $this->setDescription('Generate documentation for all ACLI commands') + $this ->setHidden(); } diff --git a/src/Command/Self/TelemetryCommand.php b/src/Command/Self/TelemetryCommand.php index 97c1f27ae..97ae0091e 100644 --- a/src/Command/Self/TelemetryCommand.php +++ b/src/Command/Self/TelemetryCommand.php @@ -14,12 +14,18 @@ #[AsCommand(name: 'self:telemetry:toggle')] class TelemetryCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Toggle anonymous sharing of usage and performance data'; + protected function commandRequiresAuthentication(): bool { return FALSE; } protected function configure(): void { - $this->setDescription('Toggle anonymous sharing of usage and performance data') + $this ->setAliases(['telemetry']); } diff --git a/src/Command/Self/TelemetryDisableCommand.php b/src/Command/Self/TelemetryDisableCommand.php index 8efc5ceb1..f3041946e 100644 --- a/src/Command/Self/TelemetryDisableCommand.php +++ b/src/Command/Self/TelemetryDisableCommand.php @@ -14,12 +14,18 @@ #[AsCommand(name: 'self:telemetry:disable')] class TelemetryDisableCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Disable anonymous sharing of usage and performance data'; + protected function commandRequiresAuthentication(): bool { return FALSE; } protected function configure(): void { - $this->setDescription('Disable anonymous sharing of usage and performance data') + $this ->setAliases(['telemetry:disable']); } diff --git a/src/Command/Self/TelemetryEnableCommand.php b/src/Command/Self/TelemetryEnableCommand.php index 4b2763fc5..cca8cb725 100644 --- a/src/Command/Self/TelemetryEnableCommand.php +++ b/src/Command/Self/TelemetryEnableCommand.php @@ -14,12 +14,18 @@ #[AsCommand(name: 'self:telemetry:enable')] class TelemetryEnableCommand extends CommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Enable anonymous sharing of usage and performance data'; + protected function commandRequiresAuthentication(): bool { return FALSE; } protected function configure(): void { - $this->setDescription('Enable anonymous sharing of usage and performance data') + $this ->setAliases(['telemetry:enable']); } diff --git a/src/Command/Ssh/SshKeyCreateCommand.php b/src/Command/Ssh/SshKeyCreateCommand.php index 19ad6d63e..cf2d98816 100644 --- a/src/Command/Ssh/SshKeyCreateCommand.php +++ b/src/Command/Ssh/SshKeyCreateCommand.php @@ -13,8 +13,14 @@ #[AsCommand(name: 'ssh-key:create')] class SshKeyCreateCommand extends SshKeyCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Create an SSH key on your local machine'; + protected function configure(): void { - $this->setDescription('Create an SSH key on your local machine') + $this ->addOption('filename', NULL, InputOption::VALUE_REQUIRED, 'The filename of the SSH key') ->addOption('password', NULL, InputOption::VALUE_REQUIRED, 'The password for the SSH key'); } diff --git a/src/Command/Ssh/SshKeyCreateUploadCommand.php b/src/Command/Ssh/SshKeyCreateUploadCommand.php index 94e2ede4b..2c2c1ae3e 100644 --- a/src/Command/Ssh/SshKeyCreateUploadCommand.php +++ b/src/Command/Ssh/SshKeyCreateUploadCommand.php @@ -13,8 +13,14 @@ #[AsCommand(name: 'ssh-key:create-upload')] class SshKeyCreateUploadCommand extends SshKeyCreateCommand { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Create an SSH key on your local machine and upload it to the Cloud Platform'; + protected function configure(): void { - $this->setDescription('Create an SSH key on your local machine and upload it to the Cloud Platform') + $this ->addOption('filename', NULL, InputOption::VALUE_REQUIRED, 'The filename of the SSH key') ->addOption('password', NULL, InputOption::VALUE_REQUIRED, 'The password for the SSH key') ->addOption('label', NULL, InputOption::VALUE_REQUIRED, 'The SSH key label to be used with the Cloud Platform') diff --git a/src/Command/Ssh/SshKeyDeleteCommand.php b/src/Command/Ssh/SshKeyDeleteCommand.php index 9dd917475..cf8b61a4e 100644 --- a/src/Command/Ssh/SshKeyDeleteCommand.php +++ b/src/Command/Ssh/SshKeyDeleteCommand.php @@ -13,10 +13,15 @@ #[AsCommand(name: 'ssh-key:delete')] class SshKeyDeleteCommand extends SshKeyCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Delete an SSH key'; use SshCommandTrait; protected function configure(): void { - $this->setDescription('Delete an SSH key') + $this ->addOption('cloud-key-uuid', 'uuid', InputOption::VALUE_REQUIRED); } diff --git a/src/Command/Ssh/SshKeyInfoCommand.php b/src/Command/Ssh/SshKeyInfoCommand.php index 5ee1325a4..af8358c74 100644 --- a/src/Command/Ssh/SshKeyInfoCommand.php +++ b/src/Command/Ssh/SshKeyInfoCommand.php @@ -16,8 +16,14 @@ #[AsCommand(name: 'ssh-key:info')] class SshKeyInfoCommand extends SshKeyCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Print information about an SSH key'; + protected function configure(): void { - $this->setDescription('Print information about an SSH key') + $this ->addOption('fingerprint', NULL, InputOption::VALUE_REQUIRED, 'sha256 fingerprint') ->addUsage('--fingerprint=pyarUa1mt2ln4fmrp7alWKpv1IPneqFwE+ErTC71IvY='); } diff --git a/src/Command/Ssh/SshKeyListCommand.php b/src/Command/Ssh/SshKeyListCommand.php index 3ae0f1225..d7f5cbc9c 100644 --- a/src/Command/Ssh/SshKeyListCommand.php +++ b/src/Command/Ssh/SshKeyListCommand.php @@ -14,8 +14,13 @@ #[AsCommand(name: 'ssh-key:list')] class SshKeyListCommand extends SshKeyCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'List your local and remote SSH keys'; + protected function configure(): void { - $this->setDescription('List your local and remote SSH keys'); } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Command/Ssh/SshKeyUploadCommand.php b/src/Command/Ssh/SshKeyUploadCommand.php index d51fcf3d7..a98da1aa7 100644 --- a/src/Command/Ssh/SshKeyUploadCommand.php +++ b/src/Command/Ssh/SshKeyUploadCommand.php @@ -13,8 +13,14 @@ #[AsCommand(name: 'ssh-key:upload')] class SshKeyUploadCommand extends SshKeyCommandBase { + /** + * @var string + */ + // phpcs:ignore + protected static $defaultDescription = 'Upload a local SSH key to the Cloud Platform'; + protected function configure(): void { - $this->setDescription('Upload a local SSH key to the Cloud Platform') + $this ->addOption('filepath', NULL, InputOption::VALUE_REQUIRED, 'The filepath of the public SSH key to upload') ->addOption('label', NULL, InputOption::VALUE_REQUIRED, 'The SSH key label to be used with the Cloud Platform') ->addOption('no-wait', NULL, InputOption::VALUE_NONE, "Don't wait for the SSH key to be uploaded to the Cloud Platform"); From b52df80a367fe42450f083ebfd781b56c4597273 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 28 Nov 2023 07:30:38 -0800 Subject: [PATCH 04/12] aliasfirst --- src/Command/App/AppOpenCommand.php | 4 ++-- src/Command/App/LogTailCommand.php | 4 ++-- src/Command/App/NewCommand.php | 4 ++-- src/Command/App/NewFromDrupal7Command.php | 12 ++++++------ .../CodeStudio/CodeStudioPipelinesMigrateCommand.php | 4 ++-- src/Command/CodeStudio/CodeStudioWizardCommand.php | 4 ++-- src/Command/Email/ConfigurePlatformEmailCommand.php | 4 ++-- src/Command/Pull/PullDatabaseCommand.php | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Command/App/AppOpenCommand.php b/src/Command/App/AppOpenCommand.php index 933a44db7..3e00808e3 100644 --- a/src/Command/App/AppOpenCommand.php +++ b/src/Command/App/AppOpenCommand.php @@ -22,8 +22,8 @@ class AppOpenCommand extends CommandBase { protected function configure(): void { $this - ->acceptApplicationUuid() - ->setAliases(['open', 'o']); + ->setAliases(['open', 'o']) + ->acceptApplicationUuid(); } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Command/App/LogTailCommand.php b/src/Command/App/LogTailCommand.php index 9e869b441..4d08f9b9f 100644 --- a/src/Command/App/LogTailCommand.php +++ b/src/Command/App/LogTailCommand.php @@ -22,8 +22,8 @@ class LogTailCommand extends CommandBase { protected function configure(): void { $this - ->acceptEnvironmentId() - ->setAliases(['tail', 'log:tail']); + ->setAliases(['tail', 'log:tail']) + ->acceptEnvironmentId(); } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Command/App/NewCommand.php b/src/Command/App/NewCommand.php index 084300538..a371fda46 100644 --- a/src/Command/App/NewCommand.php +++ b/src/Command/App/NewCommand.php @@ -25,8 +25,8 @@ class NewCommand extends CommandBase { protected function configure(): void { $this - ->addArgument('directory', InputArgument::OPTIONAL, 'The destination directory') - ->setAliases(['new']); + ->setAliases(['new']) + ->addArgument('directory', InputArgument::OPTIONAL, 'The destination directory'); } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Command/App/NewFromDrupal7Command.php b/src/Command/App/NewFromDrupal7Command.php index 8389080b1..b6c8d9f2c 100644 --- a/src/Command/App/NewFromDrupal7Command.php +++ b/src/Command/App/NewFromDrupal7Command.php @@ -48,17 +48,17 @@ class NewFromDrupal7Command extends CommandBase { protected function configure(): void { $this - ->addOption('drupal7-directory', 'source', InputOption::VALUE_OPTIONAL, 'The root of the Drupal 7 application') - ->addOption('drupal7-uri', 'uri', InputOption::VALUE_OPTIONAL, 'Only necessary in case of a multisite. If a single site, this will be computed automatically.') - ->addOption('stored-analysis', 'analysis', InputOption::VALUE_OPTIONAL, 'As an alternative to drupal7-directory, it is possible to pass a stored analysis.') - ->addOption('recommendations', 'recommendations', InputOption::VALUE_OPTIONAL, 'Overrides the default recommendations.') - ->addOption('directory', 'destination', InputOption::VALUE_OPTIONAL, 'The directory where to generate the new application.') ->setAliases([ // Currently only "from Drupal 7", more to potentially follow. 'from:d7', // A nod to its roots. 'ama', - ]); + ]) + ->addOption('drupal7-directory', 'source', InputOption::VALUE_OPTIONAL, 'The root of the Drupal 7 application') + ->addOption('drupal7-uri', 'uri', InputOption::VALUE_OPTIONAL, 'Only necessary in case of a multisite. If a single site, this will be computed automatically.') + ->addOption('stored-analysis', 'analysis', InputOption::VALUE_OPTIONAL, 'As an alternative to drupal7-directory, it is possible to pass a stored analysis.') + ->addOption('recommendations', 'recommendations', InputOption::VALUE_OPTIONAL, 'Overrides the default recommendations.') + ->addOption('directory', 'destination', InputOption::VALUE_OPTIONAL, 'The directory where to generate the new application.'); } private function getInspector(InputInterface $input): SiteInspectorInterface { diff --git a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php index ca867adef..fee7a3560 100644 --- a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php +++ b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php @@ -28,11 +28,11 @@ class CodeStudioPipelinesMigrateCommand extends CommandBase { protected function configure(): void { $this + ->setAliases(['cs:pipelines-migrate']) ->addOption('key', NULL, InputOption::VALUE_REQUIRED, 'The Cloud Platform API token that Code Studio will use') ->addOption('secret', NULL, InputOption::VALUE_REQUIRED, 'The Cloud Platform API secret that Code Studio will use') ->addOption('gitlab-token', NULL, InputOption::VALUE_REQUIRED, 'The GitLab personal access token that will be used to communicate with the GitLab instance') - ->addOption('gitlab-project-id', NULL, InputOption::VALUE_REQUIRED, 'The project ID (an integer) of the GitLab project to configure.') - ->setAliases(['cs:pipelines-migrate']); + ->addOption('gitlab-project-id', NULL, InputOption::VALUE_REQUIRED, 'The project ID (an integer) of the GitLab project to configure.'); $this->acceptApplicationUuid(); $this->setHidden(!AcquiaDrupalEnvironmentDetector::isAhIdeEnv()); } diff --git a/src/Command/CodeStudio/CodeStudioWizardCommand.php b/src/Command/CodeStudio/CodeStudioWizardCommand.php index 490a45085..8deabd0a1 100644 --- a/src/Command/CodeStudio/CodeStudioWizardCommand.php +++ b/src/Command/CodeStudio/CodeStudioWizardCommand.php @@ -29,12 +29,12 @@ class CodeStudioWizardCommand extends WizardCommandBase { protected function configure(): void { $this + ->setAliases(['cs:wizard']) ->addOption('key', NULL, InputOption::VALUE_REQUIRED, 'The Cloud Platform API token that Code Studio will use') ->addOption('secret', NULL, InputOption::VALUE_REQUIRED, 'The Cloud Platform API secret that Code Studio will use') ->addOption('gitlab-token', NULL, InputOption::VALUE_REQUIRED, 'The GitLab personal access token that will be used to communicate with the GitLab instance') ->addOption('gitlab-project-id', NULL, InputOption::VALUE_REQUIRED, 'The project ID (an integer) of the GitLab project to configure.') - ->addOption('gitlab-host-name', NULL, InputOption::VALUE_REQUIRED, 'The GitLab hostname.') - ->setAliases(['cs:wizard']); + ->addOption('gitlab-host-name', NULL, InputOption::VALUE_REQUIRED, 'The GitLab hostname.'); $this->acceptApplicationUuid(); } diff --git a/src/Command/Email/ConfigurePlatformEmailCommand.php b/src/Command/Email/ConfigurePlatformEmailCommand.php index 6b4dfeda1..be9b2288b 100644 --- a/src/Command/Email/ConfigurePlatformEmailCommand.php +++ b/src/Command/Email/ConfigurePlatformEmailCommand.php @@ -36,9 +36,9 @@ class ConfigurePlatformEmailCommand extends CommandBase { protected function configure(): void { $this + ->setAliases(['ec']) ->addArgument('subscriptionUuid', InputArgument::OPTIONAL, 'The subscription UUID to register the domain with.') - ->setHelp('This command configures Platform Email for a domain in a subscription. It registers the domain with the subscription, associates the domain with an application or set of applications, and enables Platform Email for selected environments of these applications.') - ->setAliases(['ec']); + ->setHelp('This command configures Platform Email for a domain in a subscription. It registers the domain with the subscription, associates the domain with an application or set of applications, and enables Platform Email for selected environments of these applications.'); } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Command/Pull/PullDatabaseCommand.php b/src/Command/Pull/PullDatabaseCommand.php index cba50c24a..02010e4e4 100644 --- a/src/Command/Pull/PullDatabaseCommand.php +++ b/src/Command/Pull/PullDatabaseCommand.php @@ -25,8 +25,8 @@ protected function commandRequiresDatabase(): bool { protected function configure(): void { $this - ->setHelp('This uses the latest available database backup, which may be up to 24 hours old. If no backup exists, one will be created.') ->setAliases(['pull:db']) + ->setHelp('This uses the latest available database backup, which may be up to 24 hours old. If no backup exists, one will be created.') ->acceptEnvironmentId() ->acceptSite() ->addOption('no-scripts', NULL, InputOption::VALUE_NONE, From 6e2322e7fbd4d0416222b262a1edf33c4e3a97d0 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 28 Nov 2023 07:32:45 -0800 Subject: [PATCH 05/12] rector --- src/Command/Acsf/AcsfListCommand.php | 12 +++--------- src/Command/Api/ApiListCommand.php | 12 +++--------- src/Command/App/AppOpenCommand.php | 9 +-------- src/Command/App/AppVcsInfo.php | 8 +------- src/Command/App/LinkCommand.php | 10 +--------- src/Command/App/LogTailCommand.php | 9 +-------- src/Command/App/NewCommand.php | 9 +-------- src/Command/App/NewFromDrupal7Command.php | 18 ++++++------------ src/Command/App/TaskWaitCommand.php | 8 +------- src/Command/App/UnlinkCommand.php | 13 +++---------- src/Command/Archive/ArchiveExportCommand.php | 7 +------ src/Command/Auth/AuthAcsfLoginCommand.php | 8 +------- src/Command/Auth/AuthAcsfLogoutCommand.php | 8 +------- src/Command/Auth/AuthLoginCommand.php | 9 +-------- src/Command/Auth/AuthLogoutCommand.php | 13 +++---------- .../CodeStudio/CodeStudioPhpVersionCommand.php | 7 +------ .../CodeStudioPipelinesMigrateCommand.php | 8 +------- .../CodeStudio/CodeStudioWizardCommand.php | 8 +------- src/Command/DocsCommand.php | 8 +------- .../Email/ConfigurePlatformEmailCommand.php | 9 +-------- .../Email/EmailInfoForSubscriptionCommand.php | 8 +------- src/Command/Env/EnvCertCreateCommand.php | 8 +------- src/Command/Env/EnvCopyCronCommand.php | 8 +------- src/Command/Env/EnvCreateCommand.php | 7 +------ src/Command/Env/EnvDeleteCommand.php | 8 +------- src/Command/Env/EnvMirrorCommand.php | 7 +------ src/Command/HelloWorldCommand.php | 8 +------- src/Command/Ide/IdeCreateCommand.php | 7 +------ src/Command/Ide/IdeDeleteCommand.php | 7 +------ src/Command/Ide/IdeInfoCommand.php | 8 +------- src/Command/Ide/IdeListCommand.php | 9 +-------- src/Command/Ide/IdeListMineCommand.php | 8 +------- src/Command/Ide/IdeOpenCommand.php | 8 +------- src/Command/Ide/IdePhpVersionCommand.php | 7 +------ src/Command/Ide/IdeServiceRestartCommand.php | 8 +------- src/Command/Ide/IdeServiceStartCommand.php | 8 +------- src/Command/Ide/IdeServiceStopCommand.php | 8 +------- src/Command/Ide/IdeShareCommand.php | 7 +------ src/Command/Ide/IdeXdebugToggleCommand.php | 8 +------- .../Wizard/IdeWizardCreateSshKeyCommand.php | 9 +-------- .../Wizard/IdeWizardDeleteSshKeyCommand.php | 7 +------ src/Command/Pull/PullCodeCommand.php | 8 +------- src/Command/Pull/PullCommand.php | 10 ++-------- src/Command/Pull/PullDatabaseCommand.php | 9 +-------- src/Command/Pull/PullFilesCommand.php | 8 +------- src/Command/Pull/PullScriptsCommand.php | 8 +------- src/Command/Push/PushArtifactCommand.php | 7 +------ src/Command/Push/PushCodeCommand.php | 8 +------- src/Command/Push/PushDatabaseCommand.php | 9 +-------- src/Command/Push/PushFilesCommand.php | 8 +------- src/Command/Remote/AliasListCommand.php | 10 +--------- src/Command/Remote/AliasesDownloadCommand.php | 7 +------ src/Command/Remote/DrushCommand.php | 10 ++-------- src/Command/Remote/SshCommand.php | 9 +-------- src/Command/Self/ClearCacheCommand.php | 13 +++---------- src/Command/Self/ListCommand.php | 4 +--- src/Command/Self/MakeDocsCommand.php | 8 +------- src/Command/Self/TelemetryCommand.php | 13 +++---------- src/Command/Self/TelemetryDisableCommand.php | 13 +++---------- src/Command/Self/TelemetryEnableCommand.php | 13 +++---------- src/Command/Ssh/SshKeyCreateCommand.php | 8 +------- src/Command/Ssh/SshKeyCreateUploadCommand.php | 8 +------- src/Command/Ssh/SshKeyDeleteCommand.php | 7 +------ src/Command/Ssh/SshKeyInfoCommand.php | 8 +------- src/Command/Ssh/SshKeyListCommand.php | 8 +------- src/Command/Ssh/SshKeyUploadCommand.php | 8 +------- 66 files changed, 89 insertions(+), 489 deletions(-) diff --git a/src/Command/Acsf/AcsfListCommand.php b/src/Command/Acsf/AcsfListCommand.php index 5f3b7c0d4..cd0933179 100644 --- a/src/Command/Acsf/AcsfListCommand.php +++ b/src/Command/Acsf/AcsfListCommand.php @@ -6,19 +6,13 @@ use Symfony\Component\Console\Attribute\AsCommand; -#[AsCommand(name: 'acsf:list')] +#[AsCommand(name: 'acsf:list', 'List all Acquia Cloud Site Factory commands', ['acsf'])] class AcsfListCommand extends AcsfListCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = "List all Acquia Cloud Site Factory commands"; protected string $namespace = 'acsf'; - protected function configure(): void { - $this - ->setAliases(['acsf']); + protected function configure(): void + { } } diff --git a/src/Command/Api/ApiListCommand.php b/src/Command/Api/ApiListCommand.php index 78d21eb9c..8f0a16b04 100644 --- a/src/Command/Api/ApiListCommand.php +++ b/src/Command/Api/ApiListCommand.php @@ -6,19 +6,13 @@ use Symfony\Component\Console\Attribute\AsCommand; -#[AsCommand(name: 'api:list')] +#[AsCommand(name: 'api:list', 'List all API commands', ['api'])] class ApiListCommand extends ApiListCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = "List all API commands"; protected string $namespace = 'api'; - protected function configure(): void { - $this - ->setAliases(['api']); + protected function configure(): void + { } } diff --git a/src/Command/App/AppOpenCommand.php b/src/Command/App/AppOpenCommand.php index 3e00808e3..8e27f1a56 100644 --- a/src/Command/App/AppOpenCommand.php +++ b/src/Command/App/AppOpenCommand.php @@ -11,18 +11,11 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'app:open')] +#[AsCommand(name: 'app:open', 'Opens your browser to view a given Cloud application', ['open', 'o'])] class AppOpenCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Opens your browser to view a given Cloud application'; - protected function configure(): void { $this - ->setAliases(['open', 'o']) ->acceptApplicationUuid(); } diff --git a/src/Command/App/AppVcsInfo.php b/src/Command/App/AppVcsInfo.php index c9001593d..923636113 100644 --- a/src/Command/App/AppVcsInfo.php +++ b/src/Command/App/AppVcsInfo.php @@ -14,15 +14,9 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'app:vcs:info')] +#[AsCommand(name: 'app:vcs:info', 'Get all branches and tags of the application with the deployment status')] class AppVcsInfo extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Get all branches and tags of the application with the deployment status'; - protected function configure(): void { $this ->addOption('deployed', NULL, InputOption::VALUE_OPTIONAL, 'Show only deployed branches and tags') diff --git a/src/Command/App/LinkCommand.php b/src/Command/App/LinkCommand.php index 184f75994..539b1fe53 100644 --- a/src/Command/App/LinkCommand.php +++ b/src/Command/App/LinkCommand.php @@ -10,18 +10,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'app:link')] +#[AsCommand(name: 'app:link', 'Associate your project with a Cloud Platform application', ['link'])] class LinkCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Associate your project with a Cloud Platform application'; - protected function configure(): void { - $this - ->setAliases(['link']); $this->acceptApplicationUuid(); } diff --git a/src/Command/App/LogTailCommand.php b/src/Command/App/LogTailCommand.php index 4d08f9b9f..e2c8c8a46 100644 --- a/src/Command/App/LogTailCommand.php +++ b/src/Command/App/LogTailCommand.php @@ -11,18 +11,11 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'app:log:tail')] +#[AsCommand(name: 'app:log:tail', 'Tail the logs from your environments', ['tail', 'log:tail'])] class LogTailCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Tail the logs from your environments'; - protected function configure(): void { $this - ->setAliases(['tail', 'log:tail']) ->acceptEnvironmentId(); } diff --git a/src/Command/App/NewCommand.php b/src/Command/App/NewCommand.php index a371fda46..9b5d68362 100644 --- a/src/Command/App/NewCommand.php +++ b/src/Command/App/NewCommand.php @@ -14,18 +14,11 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Filesystem\Path; -#[AsCommand(name: 'app:new:local')] +#[AsCommand(name: 'app:new:local', 'Create a new Drupal or Next.js project', ['new'])] class NewCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Create a new Drupal or Next.js project'; - protected function configure(): void { $this - ->setAliases(['new']) ->addArgument('directory', InputArgument::OPTIONAL, 'The destination directory'); } diff --git a/src/Command/App/NewFromDrupal7Command.php b/src/Command/App/NewFromDrupal7Command.php index b6c8d9f2c..e61d97384 100644 --- a/src/Command/App/NewFromDrupal7Command.php +++ b/src/Command/App/NewFromDrupal7Command.php @@ -22,14 +22,14 @@ use Symfony\Component\Filesystem\Path; use Symfony\Component\Validator\Exception\ValidatorException; -#[AsCommand(name: 'app:new:from:drupal7')] +#[AsCommand(name: 'app:new:from:drupal7', 'Generate a new Drupal 9+ project from a Drupal 7 application using the default Acquia Migrate Accelerate recommendations.', [ + // Currently only "from Drupal 7", more to potentially follow. + 'from:d7', + // A nod to its roots. + 'ama', +])] class NewFromDrupal7Command extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Generate a new Drupal 9+ project from a Drupal 7 application using the default Acquia Migrate Accelerate recommendations.'; /** * Exit code raised when the URI flag does not correspond to configuration. * @@ -48,12 +48,6 @@ class NewFromDrupal7Command extends CommandBase { protected function configure(): void { $this - ->setAliases([ - // Currently only "from Drupal 7", more to potentially follow. - 'from:d7', - // A nod to its roots. - 'ama', - ]) ->addOption('drupal7-directory', 'source', InputOption::VALUE_OPTIONAL, 'The root of the Drupal 7 application') ->addOption('drupal7-uri', 'uri', InputOption::VALUE_OPTIONAL, 'Only necessary in case of a multisite. If a single site, this will be computed automatically.') ->addOption('stored-analysis', 'analysis', InputOption::VALUE_OPTIONAL, 'As an alternative to drupal7-directory, it is possible to pass a stored analysis.') diff --git a/src/Command/App/TaskWaitCommand.php b/src/Command/App/TaskWaitCommand.php index f5b77e633..fc3fe67a6 100644 --- a/src/Command/App/TaskWaitCommand.php +++ b/src/Command/App/TaskWaitCommand.php @@ -11,15 +11,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'app:task-wait')] +#[AsCommand(name: 'app:task-wait', 'Wait for a task to complete')] class TaskWaitCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Wait for a task to complete'; - protected function configure(): void { $this ->addArgument('notification-uuid', InputArgument::REQUIRED, 'The task notification UUID or Cloud Platform API response containing a linked notification') diff --git a/src/Command/App/UnlinkCommand.php b/src/Command/App/UnlinkCommand.php index 60b3bca6e..1a021792a 100644 --- a/src/Command/App/UnlinkCommand.php +++ b/src/Command/App/UnlinkCommand.php @@ -11,18 +11,11 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'app:unlink')] +#[AsCommand(name: 'app:unlink', 'Remove local association between your project and a Cloud Platform application', ['unlink'])] class UnlinkCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Remove local association between your project and a Cloud Platform application'; - - protected function configure(): void { - $this - ->setAliases(['unlink']); + protected function configure(): void + { } protected function commandRequiresAuthentication(): bool { diff --git a/src/Command/Archive/ArchiveExportCommand.php b/src/Command/Archive/ArchiveExportCommand.php index a552c08ae..560da77a4 100644 --- a/src/Command/Archive/ArchiveExportCommand.php +++ b/src/Command/Archive/ArchiveExportCommand.php @@ -18,14 +18,9 @@ use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Path; -#[AsCommand(name: 'archive:export')] +#[AsCommand(name: 'archive:export', 'Export an archive of the Drupal application including code, files, and database')] class ArchiveExportCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Export an archive of the Drupal application including code, files, and database'; protected Checklist $checklist; private Filesystem $fs; diff --git a/src/Command/Auth/AuthAcsfLoginCommand.php b/src/Command/Auth/AuthAcsfLoginCommand.php index bdacdbaf9..6af23ab5c 100644 --- a/src/Command/Auth/AuthAcsfLoginCommand.php +++ b/src/Command/Auth/AuthAcsfLoginCommand.php @@ -11,15 +11,9 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'auth:acsf-login')] +#[AsCommand(name: 'auth:acsf-login', 'Register your Site Factory API key and secret to use API functionality')] class AuthAcsfLoginCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Register your Site Factory API key and secret to use API functionality'; - protected function configure(): void { $this ->addOption('username', 'u', InputOption::VALUE_REQUIRED, "Your Site Factory username") diff --git a/src/Command/Auth/AuthAcsfLogoutCommand.php b/src/Command/Auth/AuthAcsfLogoutCommand.php index 0850b641d..1e8b75748 100644 --- a/src/Command/Auth/AuthAcsfLogoutCommand.php +++ b/src/Command/Auth/AuthAcsfLogoutCommand.php @@ -10,15 +10,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'auth:acsf-logout')] +#[AsCommand(name: 'auth:acsf-logout', 'Remove your Site Factory key and secret from your local machine.')] class AuthAcsfLogoutCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Remove your Site Factory key and secret from your local machine.'; - protected function configure(): void { } diff --git a/src/Command/Auth/AuthLoginCommand.php b/src/Command/Auth/AuthLoginCommand.php index 53434f52e..59e78be9f 100644 --- a/src/Command/Auth/AuthLoginCommand.php +++ b/src/Command/Auth/AuthLoginCommand.php @@ -11,18 +11,11 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'auth:login')] +#[AsCommand(name: 'auth:login', 'Register your Cloud API key and secret to use API functionality', ['login'])] class AuthLoginCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Register your Cloud API key and secret to use API functionality'; - protected function configure(): void { $this - ->setAliases(['login']) ->addOption('key', 'k', InputOption::VALUE_REQUIRED, 'Your Cloud API key') ->addOption('secret', 's', InputOption::VALUE_REQUIRED, 'Your Cloud API secret'); } diff --git a/src/Command/Auth/AuthLogoutCommand.php b/src/Command/Auth/AuthLogoutCommand.php index 4af365e99..a06324746 100644 --- a/src/Command/Auth/AuthLogoutCommand.php +++ b/src/Command/Auth/AuthLogoutCommand.php @@ -10,18 +10,11 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'auth:logout')] +#[AsCommand(name: 'auth:logout', 'Remove Cloud API key and secret from local machine.', ['logout'])] class AuthLogoutCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Remove Cloud API key and secret from local machine.'; - - protected function configure(): void { - $this - ->setAliases(['logout']); + protected function configure(): void + { } protected function commandRequiresAuthentication(): bool { diff --git a/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php b/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php index 5b90452ca..9f997159e 100644 --- a/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php +++ b/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php @@ -11,14 +11,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'codestudio:php-version')] +#[AsCommand(name: 'codestudio:php-version', 'Change the PHP version in Code Studio')] class CodeStudioPhpVersionCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Change the PHP version in Code Studio'; use CodeStudioCommandTrait; protected function configure(): void { diff --git a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php index fee7a3560..ce72d0e38 100644 --- a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php +++ b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php @@ -16,19 +16,13 @@ use Symfony\Component\Filesystem\Path; use Symfony\Component\Yaml\Yaml; -#[AsCommand(name: 'codestudio:pipelines-migrate')] +#[AsCommand(name: 'codestudio:pipelines-migrate', 'Migrate .acquia-pipeline.yml file to .gitlab-ci.yml file for a given Acquia Cloud application', ['cs:pipelines-migrate'])] class CodeStudioPipelinesMigrateCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Migrate .acquia-pipeline.yml file to .gitlab-ci.yml file for a given Acquia Cloud application'; use CodeStudioCommandTrait; protected function configure(): void { $this - ->setAliases(['cs:pipelines-migrate']) ->addOption('key', NULL, InputOption::VALUE_REQUIRED, 'The Cloud Platform API token that Code Studio will use') ->addOption('secret', NULL, InputOption::VALUE_REQUIRED, 'The Cloud Platform API secret that Code Studio will use') ->addOption('gitlab-token', NULL, InputOption::VALUE_REQUIRED, 'The GitLab personal access token that will be used to communicate with the GitLab instance') diff --git a/src/Command/CodeStudio/CodeStudioWizardCommand.php b/src/Command/CodeStudio/CodeStudioWizardCommand.php index 8deabd0a1..3464a148c 100644 --- a/src/Command/CodeStudio/CodeStudioWizardCommand.php +++ b/src/Command/CodeStudio/CodeStudioWizardCommand.php @@ -15,21 +15,15 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'codestudio:wizard')] +#[AsCommand(name: 'codestudio:wizard', 'Create and/or configure a new Code Studio project for a given Acquia Cloud application', ['cs:wizard'])] class CodeStudioWizardCommand extends WizardCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Create and/or configure a new Code Studio project for a given Acquia Cloud application'; use CodeStudioCommandTrait; private Checklist $checklist; protected function configure(): void { $this - ->setAliases(['cs:wizard']) ->addOption('key', NULL, InputOption::VALUE_REQUIRED, 'The Cloud Platform API token that Code Studio will use') ->addOption('secret', NULL, InputOption::VALUE_REQUIRED, 'The Cloud Platform API secret that Code Studio will use') ->addOption('gitlab-token', NULL, InputOption::VALUE_REQUIRED, 'The GitLab personal access token that will be used to communicate with the GitLab instance') diff --git a/src/Command/DocsCommand.php b/src/Command/DocsCommand.php index 76ff0538b..9ceb7eab0 100644 --- a/src/Command/DocsCommand.php +++ b/src/Command/DocsCommand.php @@ -11,15 +11,9 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ChoiceQuestion; -#[AsCommand(name: 'docs')] +#[AsCommand(name: 'docs', 'Open Acquia product documentation in a web browser')] class DocsCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Open Acquia product documentation in a web browser'; - protected function configure(): void { $this ->addArgument('product', InputArgument::OPTIONAL, 'Acquia Product Name') diff --git a/src/Command/Email/ConfigurePlatformEmailCommand.php b/src/Command/Email/ConfigurePlatformEmailCommand.php index be9b2288b..67e9b262e 100644 --- a/src/Command/Email/ConfigurePlatformEmailCommand.php +++ b/src/Command/Email/ConfigurePlatformEmailCommand.php @@ -25,18 +25,11 @@ use Symfony\Component\Validator\Validation; use Symfony\Component\Yaml\Yaml; -#[AsCommand(name: 'email:configure')] +#[AsCommand(name: 'email:configure', 'Configure Platform email for one or more applications', ['ec'])] class ConfigurePlatformEmailCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Configure Platform email for one or more applications'; - protected function configure(): void { $this - ->setAliases(['ec']) ->addArgument('subscriptionUuid', InputArgument::OPTIONAL, 'The subscription UUID to register the domain with.') ->setHelp('This command configures Platform Email for a domain in a subscription. It registers the domain with the subscription, associates the domain with an application or set of applications, and enables Platform Email for selected environments of these applications.'); } diff --git a/src/Command/Email/EmailInfoForSubscriptionCommand.php b/src/Command/Email/EmailInfoForSubscriptionCommand.php index a64655a7a..e497aff32 100644 --- a/src/Command/Email/EmailInfoForSubscriptionCommand.php +++ b/src/Command/Email/EmailInfoForSubscriptionCommand.php @@ -18,15 +18,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'email:info')] +#[AsCommand(name: 'email:info', 'Print information related to Platform Email set up in a subscription.')] class EmailInfoForSubscriptionCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Print information related to Platform Email set up in a subscription.'; - protected function configure(): void { $this ->addArgument('subscriptionUuid', InputArgument::OPTIONAL, 'The subscription UUID whose Platform Email configuration is to be checked.') diff --git a/src/Command/Env/EnvCertCreateCommand.php b/src/Command/Env/EnvCertCreateCommand.php index 70019570f..8dadec3b2 100644 --- a/src/Command/Env/EnvCertCreateCommand.php +++ b/src/Command/Env/EnvCertCreateCommand.php @@ -13,15 +13,9 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'env:certificate-create')] +#[AsCommand(name: 'env:certificate-create', 'Install an SSL certificate.')] class EnvCertCreateCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Install an SSL certificate.'; - protected function configure(): void { $this ->addArgument('certificate', InputArgument::REQUIRED, 'Filename of the SSL certificate being installed') diff --git a/src/Command/Env/EnvCopyCronCommand.php b/src/Command/Env/EnvCopyCronCommand.php index d979c1e5a..7e59233ec 100644 --- a/src/Command/Env/EnvCopyCronCommand.php +++ b/src/Command/Env/EnvCopyCronCommand.php @@ -13,15 +13,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'env:cron-copy')] +#[AsCommand(name: 'env:cron-copy', 'Copy all cron tasks from one Acquia Cloud Platform environment to another')] class EnvCopyCronCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Copy all cron tasks from one Acquia Cloud Platform environment to another'; - protected function configure(): void { $this ->addArgument('source_env', InputArgument::REQUIRED, 'Alias of the source environment in the format `app-name.env` or the environment uuid') diff --git a/src/Command/Env/EnvCreateCommand.php b/src/Command/Env/EnvCreateCommand.php index 186adeee5..ef3113c32 100644 --- a/src/Command/Env/EnvCreateCommand.php +++ b/src/Command/Env/EnvCreateCommand.php @@ -16,14 +16,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'env:create')] +#[AsCommand(name: 'env:create', 'Create a new Continuous Delivery Environment (CDE)')] class EnvCreateCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Create a new Continuous Delivery Environment (CDE)'; private Checklist $checklist; protected function configure(): void { diff --git a/src/Command/Env/EnvDeleteCommand.php b/src/Command/Env/EnvDeleteCommand.php index 78b09ec92..808bad7aa 100644 --- a/src/Command/Env/EnvDeleteCommand.php +++ b/src/Command/Env/EnvDeleteCommand.php @@ -13,15 +13,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'env:delete')] +#[AsCommand(name: 'env:delete', 'Delete a Continuous Delivery Environment (CDE)')] class EnvDeleteCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Delete a Continuous Delivery Environment (CDE)'; - protected function configure(): void { $this->acceptEnvironmentId(); } diff --git a/src/Command/Env/EnvMirrorCommand.php b/src/Command/Env/EnvMirrorCommand.php index 445067368..049e075ad 100644 --- a/src/Command/Env/EnvMirrorCommand.php +++ b/src/Command/Env/EnvMirrorCommand.php @@ -17,14 +17,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'env:mirror')] +#[AsCommand(name: 'env:mirror', 'Makes one environment identical to another in terms of code, database, files, and configuration.')] class EnvMirrorCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Makes one environment identical to another in terms of code, database, files, and configuration.'; private Checklist $checklist; protected function configure(): void { diff --git a/src/Command/HelloWorldCommand.php b/src/Command/HelloWorldCommand.php index 729805db6..53f12ba51 100644 --- a/src/Command/HelloWorldCommand.php +++ b/src/Command/HelloWorldCommand.php @@ -9,15 +9,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'hello-world')] +#[AsCommand(name: 'hello-world', 'Test command used for asserting core functionality')] class HelloWorldCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Test command used for asserting core functionality'; - protected function configure(): void { $this ->setHidden(); diff --git a/src/Command/Ide/IdeCreateCommand.php b/src/Command/Ide/IdeCreateCommand.php index a8fa9f48f..ffead5e28 100644 --- a/src/Command/Ide/IdeCreateCommand.php +++ b/src/Command/Ide/IdeCreateCommand.php @@ -20,14 +20,9 @@ use Symfony\Component\Validator\Exception\ValidatorException; use Symfony\Component\Validator\Validation; -#[AsCommand(name: 'ide:create')] +#[AsCommand(name: 'ide:create', 'Create a Cloud IDE')] class IdeCreateCommand extends IdeCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Create a Cloud IDE'; private IdeResponse $ide; private Client $client; diff --git a/src/Command/Ide/IdeDeleteCommand.php b/src/Command/Ide/IdeDeleteCommand.php index 5cc34f324..99d30ce38 100644 --- a/src/Command/Ide/IdeDeleteCommand.php +++ b/src/Command/Ide/IdeDeleteCommand.php @@ -11,14 +11,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:delete')] +#[AsCommand(name: 'ide:delete', 'Delete a Cloud IDE')] class IdeDeleteCommand extends IdeCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Delete a Cloud IDE'; use SshCommandTrait; protected function configure(): void { diff --git a/src/Command/Ide/IdeInfoCommand.php b/src/Command/Ide/IdeInfoCommand.php index 6c6769ebf..9221558fe 100644 --- a/src/Command/Ide/IdeInfoCommand.php +++ b/src/Command/Ide/IdeInfoCommand.php @@ -11,15 +11,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:info')] +#[AsCommand(name: 'ide:info', 'Print information about a Cloud IDE')] class IdeInfoCommand extends IdeCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Print information about a Cloud IDE'; - protected function configure(): void { $this->acceptApplicationUuid(); } diff --git a/src/Command/Ide/IdeListCommand.php b/src/Command/Ide/IdeListCommand.php index 63dbe5a1b..09f6dc49b 100644 --- a/src/Command/Ide/IdeListCommand.php +++ b/src/Command/Ide/IdeListCommand.php @@ -12,17 +12,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:list:app')] +#[AsCommand(name: 'ide:list:app', 'List available Cloud IDEs belonging to a given application', ['ide:list'])] class IdeListCommand extends IdeCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'List available Cloud IDEs belonging to a given application'; - protected function configure(): void { - $this->setAliases(['ide:list']); $this->acceptApplicationUuid(); } diff --git a/src/Command/Ide/IdeListMineCommand.php b/src/Command/Ide/IdeListMineCommand.php index 099de5a83..35228b065 100644 --- a/src/Command/Ide/IdeListMineCommand.php +++ b/src/Command/Ide/IdeListMineCommand.php @@ -13,15 +13,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:list:mine')] +#[AsCommand(name: 'ide:list:mine', 'List Cloud IDEs belonging to you')] class IdeListMineCommand extends IdeCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'List Cloud IDEs belonging to you'; - protected function configure(): void { } diff --git a/src/Command/Ide/IdeOpenCommand.php b/src/Command/Ide/IdeOpenCommand.php index 29f55e15c..56af07475 100644 --- a/src/Command/Ide/IdeOpenCommand.php +++ b/src/Command/Ide/IdeOpenCommand.php @@ -11,15 +11,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:open')] +#[AsCommand(name: 'ide:open', 'Open a Cloud IDE in your browser')] class IdeOpenCommand extends IdeCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Open a Cloud IDE in your browser'; - protected function configure(): void { $this ->setHidden(AcquiaDrupalEnvironmentDetector::isAhIdeEnv()); diff --git a/src/Command/Ide/IdePhpVersionCommand.php b/src/Command/Ide/IdePhpVersionCommand.php index 339864e7b..a2a62eb63 100644 --- a/src/Command/Ide/IdePhpVersionCommand.php +++ b/src/Command/Ide/IdePhpVersionCommand.php @@ -12,14 +12,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:php-version')] +#[AsCommand(name: 'ide:php-version', 'Change the PHP version in the current IDE')] class IdePhpVersionCommand extends IdeCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Change the PHP version in the current IDE'; private string $idePhpFilePathPrefix; /* diff --git a/src/Command/Ide/IdeServiceRestartCommand.php b/src/Command/Ide/IdeServiceRestartCommand.php index 4955b64de..8e8a0e782 100644 --- a/src/Command/Ide/IdeServiceRestartCommand.php +++ b/src/Command/Ide/IdeServiceRestartCommand.php @@ -14,15 +14,9 @@ use Symfony\Component\Validator\Exception\ValidatorException; use Symfony\Component\Validator\Validation; -#[AsCommand(name: 'ide:service-restart')] +#[AsCommand(name: 'ide:service-restart', 'Restart a service in the Cloud IDE')] class IdeServiceRestartCommand extends IdeCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Restart a service in the Cloud IDE'; - protected function commandRequiresAuthentication(): bool { return FALSE; } diff --git a/src/Command/Ide/IdeServiceStartCommand.php b/src/Command/Ide/IdeServiceStartCommand.php index 0bb4d6c99..3788eecc4 100644 --- a/src/Command/Ide/IdeServiceStartCommand.php +++ b/src/Command/Ide/IdeServiceStartCommand.php @@ -14,15 +14,9 @@ use Symfony\Component\Validator\Exception\ValidatorException; use Symfony\Component\Validator\Validation; -#[AsCommand(name: 'ide:service-start')] +#[AsCommand(name: 'ide:service-start', 'Start a service in the Cloud IDE')] class IdeServiceStartCommand extends IdeCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Start a service in the Cloud IDE'; - protected function commandRequiresAuthentication(): bool { return FALSE; } diff --git a/src/Command/Ide/IdeServiceStopCommand.php b/src/Command/Ide/IdeServiceStopCommand.php index a0766197d..5584f6fc0 100644 --- a/src/Command/Ide/IdeServiceStopCommand.php +++ b/src/Command/Ide/IdeServiceStopCommand.php @@ -14,15 +14,9 @@ use Symfony\Component\Validator\Exception\ValidatorException; use Symfony\Component\Validator\Validation; -#[AsCommand(name: 'ide:service-stop')] +#[AsCommand(name: 'ide:service-stop', 'Stop a service in the Cloud IDE')] class IdeServiceStopCommand extends IdeCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Stop a service in the Cloud IDE'; - protected function commandRequiresAuthentication(): bool { return FALSE; } diff --git a/src/Command/Ide/IdeShareCommand.php b/src/Command/Ide/IdeShareCommand.php index feb6c0395..289d935c4 100644 --- a/src/Command/Ide/IdeShareCommand.php +++ b/src/Command/Ide/IdeShareCommand.php @@ -14,14 +14,9 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:share')] +#[AsCommand(name: 'ide:share', 'Get the share URL for a Cloud IDE')] class IdeShareCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Get the share URL for a Cloud IDE'; /** * @var array */ diff --git a/src/Command/Ide/IdeXdebugToggleCommand.php b/src/Command/Ide/IdeXdebugToggleCommand.php index 5f5758162..ccd8ce500 100644 --- a/src/Command/Ide/IdeXdebugToggleCommand.php +++ b/src/Command/Ide/IdeXdebugToggleCommand.php @@ -11,14 +11,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:xdebug-toggle')] +#[AsCommand(name: 'ide:xdebug-toggle', 'Toggle Xdebug on or off in the current IDE', ['xdebug'])] class IdeXdebugToggleCommand extends IdeCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Toggle Xdebug on or off in the current IDE'; private ?bool $xDebugEnabled; protected function commandRequiresAuthentication(): bool { @@ -27,7 +22,6 @@ protected function commandRequiresAuthentication(): bool { protected function configure(): void { $this - ->setAliases(['xdebug']) ->setHidden(!AcquiaDrupalEnvironmentDetector::isAhIdeEnv()); } diff --git a/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php b/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php index 325ed417d..85426e8eb 100644 --- a/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php +++ b/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php @@ -12,18 +12,11 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:wizard:ssh-key:create-upload')] +#[AsCommand(name: 'ide:wizard:ssh-key:create-upload', 'Wizard to perform first time setup tasks within an IDE', ['ide:wizard'])] class IdeWizardCreateSshKeyCommand extends IdeWizardCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Wizard to perform first time setup tasks within an IDE'; - protected function configure(): void { $this - ->setAliases(['ide:wizard']) ->setHidden(!CommandBase::isAcquiaCloudIde()); } diff --git a/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php b/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php index b09c11902..23b069e73 100644 --- a/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php +++ b/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php @@ -12,14 +12,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:wizard:ssh-key:delete')] +#[AsCommand(name: 'ide:wizard:ssh-key:delete', 'Wizard to delete SSH key for IDE from Cloud')] class IdeWizardDeleteSshKeyCommand extends IdeWizardCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Wizard to delete SSH key for IDE from Cloud'; use SshCommandTrait; protected function configure(): void { diff --git a/src/Command/Pull/PullCodeCommand.php b/src/Command/Pull/PullCodeCommand.php index 21f227baf..4e43291cc 100644 --- a/src/Command/Pull/PullCodeCommand.php +++ b/src/Command/Pull/PullCodeCommand.php @@ -11,15 +11,9 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'pull:code')] +#[AsCommand(name: 'pull:code', 'Copy code from a Cloud Platform environment')] class PullCodeCommand extends PullCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Copy code from a Cloud Platform environment'; - protected function commandRequiresDatabase(): bool { return TRUE; } diff --git a/src/Command/Pull/PullCommand.php b/src/Command/Pull/PullCommand.php index 27349c476..901440f23 100644 --- a/src/Command/Pull/PullCommand.php +++ b/src/Command/Pull/PullCommand.php @@ -11,21 +11,15 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'pull:all')] +#[AsCommand(name: 'pull:all', 'Copy code, database, and files from a Cloud Platform environment', ['refresh', 'pull'])] class PullCommand extends PullCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Copy code, database, and files from a Cloud Platform environment'; - protected function commandRequiresDatabase(): bool { return TRUE; } protected function configure(): void { - $this->setAliases(['refresh', 'pull']) + $this ->acceptEnvironmentId() ->acceptSite() ->addOption('dir', NULL, InputArgument::OPTIONAL, 'The directory containing the Drupal project to be refreshed') diff --git a/src/Command/Pull/PullDatabaseCommand.php b/src/Command/Pull/PullDatabaseCommand.php index 02010e4e4..7c45ab6bf 100644 --- a/src/Command/Pull/PullDatabaseCommand.php +++ b/src/Command/Pull/PullDatabaseCommand.php @@ -10,22 +10,15 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'pull:database')] +#[AsCommand(name: 'pull:database', 'Import database backup from a Cloud Platform environment', ['pull:db'])] class PullDatabaseCommand extends PullCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Import database backup from a Cloud Platform environment'; - protected function commandRequiresDatabase(): bool { return TRUE; } protected function configure(): void { $this - ->setAliases(['pull:db']) ->setHelp('This uses the latest available database backup, which may be up to 24 hours old. If no backup exists, one will be created.') ->acceptEnvironmentId() ->acceptSite() diff --git a/src/Command/Pull/PullFilesCommand.php b/src/Command/Pull/PullFilesCommand.php index a8f06dfa3..24e381f46 100644 --- a/src/Command/Pull/PullFilesCommand.php +++ b/src/Command/Pull/PullFilesCommand.php @@ -9,15 +9,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'pull:files')] +#[AsCommand(name: 'pull:files', 'Copy Drupal public files from a Cloud Platform environment to your local environment')] class PullFilesCommand extends PullCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Copy Drupal public files from a Cloud Platform environment to your local environment'; - protected function configure(): void { $this ->acceptEnvironmentId() diff --git a/src/Command/Pull/PullScriptsCommand.php b/src/Command/Pull/PullScriptsCommand.php index 3f261837b..eb5a4d318 100644 --- a/src/Command/Pull/PullScriptsCommand.php +++ b/src/Command/Pull/PullScriptsCommand.php @@ -10,15 +10,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'pull:run-scripts')] +#[AsCommand(name: 'pull:run-scripts', 'Execute post pull scripts')] class PullScriptsCommand extends PullCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Execute post pull scripts'; - protected function configure(): void { $this ->acceptEnvironmentId() diff --git a/src/Command/Push/PushArtifactCommand.php b/src/Command/Push/PushArtifactCommand.php index 29cf08c0a..1cf7072eb 100644 --- a/src/Command/Push/PushArtifactCommand.php +++ b/src/Command/Push/PushArtifactCommand.php @@ -16,14 +16,9 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Filesystem\Path; -#[AsCommand(name: 'push:artifact')] +#[AsCommand(name: 'push:artifact', 'Build and push a code artifact to a Cloud Platform environment')] class PushArtifactCommand extends PullCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Build and push a code artifact to a Cloud Platform environment'; /** * Composer vendor directories. * diff --git a/src/Command/Push/PushCodeCommand.php b/src/Command/Push/PushCodeCommand.php index eb0e17d77..8ebde0e5e 100644 --- a/src/Command/Push/PushCodeCommand.php +++ b/src/Command/Push/PushCodeCommand.php @@ -11,15 +11,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'push:code')] +#[AsCommand(name: 'push:code', 'Push code from your IDE to a Cloud Platform environment')] class PushCodeCommand extends PullCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Push code from your IDE to a Cloud Platform environment'; - protected function configure(): void { $this ->setHidden(!AcquiaDrupalEnvironmentDetector::isAhIdeEnv() && !self::isLandoEnv()); diff --git a/src/Command/Push/PushDatabaseCommand.php b/src/Command/Push/PushDatabaseCommand.php index 0bf451ff0..3aece3df0 100644 --- a/src/Command/Push/PushDatabaseCommand.php +++ b/src/Command/Push/PushDatabaseCommand.php @@ -14,22 +14,15 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'push:database')] +#[AsCommand(name: 'push:database', 'Push a database from your local environment to a Cloud Platform environment', ['push:db'])] class PushDatabaseCommand extends PullCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Push a database from your local environment to a Cloud Platform environment'; - protected function commandRequiresDatabase(): bool { return TRUE; } protected function configure(): void { $this - ->setAliases(['push:db']) ->acceptEnvironmentId() ->acceptSite(); } diff --git a/src/Command/Push/PushFilesCommand.php b/src/Command/Push/PushFilesCommand.php index 31144abac..b1b9cc1f6 100644 --- a/src/Command/Push/PushFilesCommand.php +++ b/src/Command/Push/PushFilesCommand.php @@ -12,15 +12,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'push:files')] +#[AsCommand(name: 'push:files', 'Copy Drupal public files from your local environment to a Cloud Platform environment')] class PushFilesCommand extends PullCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Copy Drupal public files from your local environment to a Cloud Platform environment'; - protected function configure(): void { $this ->acceptEnvironmentId() diff --git a/src/Command/Remote/AliasListCommand.php b/src/Command/Remote/AliasListCommand.php index 446deb305..279fdb94e 100644 --- a/src/Command/Remote/AliasListCommand.php +++ b/src/Command/Remote/AliasListCommand.php @@ -13,18 +13,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'remote:aliases:list')] +#[AsCommand(name: 'remote:aliases:list', 'List all aliases for the Cloud Platform environments', ['aliases', 'sa'])] class AliasListCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'List all aliases for the Cloud Platform environments'; - protected function configure(): void { - $this - ->setAliases(['aliases', 'sa']); $this->acceptApplicationUuid(); } diff --git a/src/Command/Remote/AliasesDownloadCommand.php b/src/Command/Remote/AliasesDownloadCommand.php index 05b94e7ec..f338268a9 100644 --- a/src/Command/Remote/AliasesDownloadCommand.php +++ b/src/Command/Remote/AliasesDownloadCommand.php @@ -20,14 +20,9 @@ /** * A command to proxy Drush commands on an environment using SSH. */ -#[AsCommand(name: 'remote:aliases:download')] +#[AsCommand(name: 'remote:aliases:download', 'Download Drush aliases for the Cloud Platform')] class AliasesDownloadCommand extends SshCommand { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Download Drush aliases for the Cloud Platform'; private string $drushArchiveFilepath; protected function configure(): void { diff --git a/src/Command/Remote/DrushCommand.php b/src/Command/Remote/DrushCommand.php index 91314839a..8119210a6 100644 --- a/src/Command/Remote/DrushCommand.php +++ b/src/Command/Remote/DrushCommand.php @@ -12,17 +12,11 @@ /** * A command to proxy Drush commands on an environment using SSH. */ -#[AsCommand(name: 'remote:drush')] +#[AsCommand(name: 'remote:drush', 'Run a Drush command remotely on a application\'s environment', ['drush', 'dr'])] class DrushCommand extends SshBaseCommand { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Run a Drush command remotely on a application\'s environment'; - protected function configure(): void { - $this->setAliases(['drush', 'dr']) + $this ->setHelp('Pay close attention to the argument syntax! Note the usage of -- to separate the drush command arguments and options.') ->addArgument('alias', InputArgument::REQUIRED, 'Alias for application & environment in the format `app-name.env`') ->addArgument('drush_command', InputArgument::IS_ARRAY, 'Drush command') diff --git a/src/Command/Remote/SshCommand.php b/src/Command/Remote/SshCommand.php index 492f17535..ed847e99c 100644 --- a/src/Command/Remote/SshCommand.php +++ b/src/Command/Remote/SshCommand.php @@ -13,18 +13,11 @@ /** * A command to proxy Drush commands on an environment using SSH. */ -#[AsCommand(name: 'remote:ssh')] +#[AsCommand(name: 'remote:ssh', 'Use SSH to open a shell or run a command in a Cloud Platform environment', ['ssh'])] class SshCommand extends SshBaseCommand { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Use SSH to open a shell or run a command in a Cloud Platform environment'; - protected function configure(): void { $this - ->setAliases(['ssh']) ->addArgument('alias', InputArgument::REQUIRED, 'Alias for application & environment in the format `app-name.env`') ->addArgument('ssh_command', InputArgument::IS_ARRAY, 'Command to run via SSH (if not provided, opens a shell in the site directory)') ->addUsage("myapp.dev # open a shell in the myapp.dev environment") diff --git a/src/Command/Self/ClearCacheCommand.php b/src/Command/Self/ClearCacheCommand.php index ab54c5d1a..94fd676f0 100644 --- a/src/Command/Self/ClearCacheCommand.php +++ b/src/Command/Self/ClearCacheCommand.php @@ -12,18 +12,11 @@ use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Path; -#[AsCommand(name: 'self:clear-caches')] +#[AsCommand(name: 'self:clear-caches', 'Clears local Acquia CLI caches', ['cc', 'cr'])] class ClearCacheCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Clears local Acquia CLI caches'; - - protected function configure(): void { - $this - ->setAliases(['cc', 'cr']); + protected function configure(): void + { } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Command/Self/ListCommand.php b/src/Command/Self/ListCommand.php index d04b99358..00cdc046e 100644 --- a/src/Command/Self/ListCommand.php +++ b/src/Command/Self/ListCommand.php @@ -12,13 +12,11 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'list')] +#[AsCommand(name: 'list', null, ['self:list'])] class ListCommand extends \Symfony\Component\Console\Command\ListCommand { protected function configure(): void { parent::configure(); - $this - ->setAliases(['self:list']); } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Command/Self/MakeDocsCommand.php b/src/Command/Self/MakeDocsCommand.php index 9076a8c47..9a8b4c234 100644 --- a/src/Command/Self/MakeDocsCommand.php +++ b/src/Command/Self/MakeDocsCommand.php @@ -11,15 +11,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'self:make-docs')] +#[AsCommand(name: 'self:make-docs', 'Generate documentation for all ACLI commands')] class MakeDocsCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Generate documentation for all ACLI commands'; - protected function configure(): void { $this ->setHidden(); diff --git a/src/Command/Self/TelemetryCommand.php b/src/Command/Self/TelemetryCommand.php index 97ae0091e..62e2d73ff 100644 --- a/src/Command/Self/TelemetryCommand.php +++ b/src/Command/Self/TelemetryCommand.php @@ -11,22 +11,15 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'self:telemetry:toggle')] +#[AsCommand(name: 'self:telemetry:toggle', 'Toggle anonymous sharing of usage and performance data', ['telemetry'])] class TelemetryCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Toggle anonymous sharing of usage and performance data'; - protected function commandRequiresAuthentication(): bool { return FALSE; } - protected function configure(): void { - $this - ->setAliases(['telemetry']); + protected function configure(): void + { } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Command/Self/TelemetryDisableCommand.php b/src/Command/Self/TelemetryDisableCommand.php index f3041946e..adbf1dc66 100644 --- a/src/Command/Self/TelemetryDisableCommand.php +++ b/src/Command/Self/TelemetryDisableCommand.php @@ -11,22 +11,15 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'self:telemetry:disable')] +#[AsCommand(name: 'self:telemetry:disable', 'Disable anonymous sharing of usage and performance data', ['telemetry:disable'])] class TelemetryDisableCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Disable anonymous sharing of usage and performance data'; - protected function commandRequiresAuthentication(): bool { return FALSE; } - protected function configure(): void { - $this - ->setAliases(['telemetry:disable']); + protected function configure(): void + { } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Command/Self/TelemetryEnableCommand.php b/src/Command/Self/TelemetryEnableCommand.php index cca8cb725..8bc9e5cbd 100644 --- a/src/Command/Self/TelemetryEnableCommand.php +++ b/src/Command/Self/TelemetryEnableCommand.php @@ -11,22 +11,15 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'self:telemetry:enable')] +#[AsCommand(name: 'self:telemetry:enable', 'Enable anonymous sharing of usage and performance data', ['telemetry:enable'])] class TelemetryEnableCommand extends CommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Enable anonymous sharing of usage and performance data'; - protected function commandRequiresAuthentication(): bool { return FALSE; } - protected function configure(): void { - $this - ->setAliases(['telemetry:enable']); + protected function configure(): void + { } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Command/Ssh/SshKeyCreateCommand.php b/src/Command/Ssh/SshKeyCreateCommand.php index cf2d98816..8a916cc73 100644 --- a/src/Command/Ssh/SshKeyCreateCommand.php +++ b/src/Command/Ssh/SshKeyCreateCommand.php @@ -10,15 +10,9 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ssh-key:create')] +#[AsCommand(name: 'ssh-key:create', 'Create an SSH key on your local machine')] class SshKeyCreateCommand extends SshKeyCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Create an SSH key on your local machine'; - protected function configure(): void { $this ->addOption('filename', NULL, InputOption::VALUE_REQUIRED, 'The filename of the SSH key') diff --git a/src/Command/Ssh/SshKeyCreateUploadCommand.php b/src/Command/Ssh/SshKeyCreateUploadCommand.php index 2c2c1ae3e..f763f2138 100644 --- a/src/Command/Ssh/SshKeyCreateUploadCommand.php +++ b/src/Command/Ssh/SshKeyCreateUploadCommand.php @@ -10,15 +10,9 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ssh-key:create-upload')] +#[AsCommand(name: 'ssh-key:create-upload', 'Create an SSH key on your local machine and upload it to the Cloud Platform')] class SshKeyCreateUploadCommand extends SshKeyCreateCommand { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Create an SSH key on your local machine and upload it to the Cloud Platform'; - protected function configure(): void { $this ->addOption('filename', NULL, InputOption::VALUE_REQUIRED, 'The filename of the SSH key') diff --git a/src/Command/Ssh/SshKeyDeleteCommand.php b/src/Command/Ssh/SshKeyDeleteCommand.php index cf8b61a4e..bbe57cbbe 100644 --- a/src/Command/Ssh/SshKeyDeleteCommand.php +++ b/src/Command/Ssh/SshKeyDeleteCommand.php @@ -10,14 +10,9 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ssh-key:delete')] +#[AsCommand(name: 'ssh-key:delete', 'Delete an SSH key')] class SshKeyDeleteCommand extends SshKeyCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Delete an SSH key'; use SshCommandTrait; protected function configure(): void { diff --git a/src/Command/Ssh/SshKeyInfoCommand.php b/src/Command/Ssh/SshKeyInfoCommand.php index af8358c74..a1fb6dd2f 100644 --- a/src/Command/Ssh/SshKeyInfoCommand.php +++ b/src/Command/Ssh/SshKeyInfoCommand.php @@ -13,15 +13,9 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ssh-key:info')] +#[AsCommand(name: 'ssh-key:info', 'Print information about an SSH key')] class SshKeyInfoCommand extends SshKeyCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Print information about an SSH key'; - protected function configure(): void { $this ->addOption('fingerprint', NULL, InputOption::VALUE_REQUIRED, 'sha256 fingerprint') diff --git a/src/Command/Ssh/SshKeyListCommand.php b/src/Command/Ssh/SshKeyListCommand.php index d7f5cbc9c..a9142644c 100644 --- a/src/Command/Ssh/SshKeyListCommand.php +++ b/src/Command/Ssh/SshKeyListCommand.php @@ -11,15 +11,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ssh-key:list')] +#[AsCommand(name: 'ssh-key:list', 'List your local and remote SSH keys')] class SshKeyListCommand extends SshKeyCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'List your local and remote SSH keys'; - protected function configure(): void { } diff --git a/src/Command/Ssh/SshKeyUploadCommand.php b/src/Command/Ssh/SshKeyUploadCommand.php index a98da1aa7..3d6333754 100644 --- a/src/Command/Ssh/SshKeyUploadCommand.php +++ b/src/Command/Ssh/SshKeyUploadCommand.php @@ -10,15 +10,9 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ssh-key:upload')] +#[AsCommand(name: 'ssh-key:upload', 'Upload a local SSH key to the Cloud Platform')] class SshKeyUploadCommand extends SshKeyCommandBase { - /** - * @var string - */ - // phpcs:ignore - protected static $defaultDescription = 'Upload a local SSH key to the Cloud Platform'; - protected function configure(): void { $this ->addOption('filepath', NULL, InputOption::VALUE_REQUIRED, 'The filepath of the public SSH key to upload') From 7ea32b5e5295da4f427e92a520d914806c83b709 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 28 Nov 2023 07:53:17 -0800 Subject: [PATCH 06/12] cleanup --- src/Command/Acsf/AcsfListCommand.php | 5 ++--- src/Command/Api/ApiListCommand.php | 5 ++--- src/Command/App/AppOpenCommand.php | 2 +- src/Command/App/AppVcsInfo.php | 2 +- src/Command/App/LinkCommand.php | 2 +- src/Command/App/LogTailCommand.php | 2 +- src/Command/App/NewCommand.php | 2 +- src/Command/App/NewFromDrupal7Command.php | 2 +- src/Command/App/TaskWaitCommand.php | 2 +- src/Command/App/UnlinkCommand.php | 5 ++--- src/Command/Archive/ArchiveExportCommand.php | 2 +- src/Command/Auth/AuthAcsfLoginCommand.php | 2 +- src/Command/Auth/AuthAcsfLogoutCommand.php | 2 +- src/Command/Auth/AuthLoginCommand.php | 2 +- src/Command/Auth/AuthLogoutCommand.php | 5 ++--- src/Command/CodeStudio/CodeStudioPhpVersionCommand.php | 2 +- src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php | 2 +- src/Command/CodeStudio/CodeStudioWizardCommand.php | 2 +- src/Command/DocsCommand.php | 2 +- src/Command/Email/ConfigurePlatformEmailCommand.php | 2 +- src/Command/Email/EmailInfoForSubscriptionCommand.php | 2 +- src/Command/Env/EnvCertCreateCommand.php | 2 +- src/Command/Env/EnvCopyCronCommand.php | 2 +- src/Command/Env/EnvCreateCommand.php | 2 +- src/Command/Env/EnvDeleteCommand.php | 2 +- src/Command/Env/EnvMirrorCommand.php | 2 +- src/Command/HelloWorldCommand.php | 2 +- src/Command/Ide/IdeCreateCommand.php | 2 +- src/Command/Ide/IdeDeleteCommand.php | 2 +- src/Command/Ide/IdeInfoCommand.php | 2 +- src/Command/Ide/IdeListCommand.php | 2 +- src/Command/Ide/IdeListMineCommand.php | 2 +- src/Command/Ide/IdeOpenCommand.php | 2 +- src/Command/Ide/IdePhpVersionCommand.php | 2 +- src/Command/Ide/IdeServiceRestartCommand.php | 2 +- src/Command/Ide/IdeServiceStartCommand.php | 2 +- src/Command/Ide/IdeServiceStopCommand.php | 2 +- src/Command/Ide/IdeShareCommand.php | 2 +- src/Command/Ide/IdeXdebugToggleCommand.php | 2 +- src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php | 2 +- src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php | 2 +- src/Command/Pull/PullCodeCommand.php | 2 +- src/Command/Pull/PullCommand.php | 2 +- src/Command/Pull/PullDatabaseCommand.php | 2 +- src/Command/Pull/PullFilesCommand.php | 2 +- src/Command/Pull/PullScriptsCommand.php | 2 +- src/Command/Push/PushArtifactCommand.php | 2 +- src/Command/Push/PushCodeCommand.php | 2 +- src/Command/Push/PushDatabaseCommand.php | 2 +- src/Command/Push/PushFilesCommand.php | 2 +- src/Command/Remote/AliasListCommand.php | 2 +- src/Command/Remote/AliasesDownloadCommand.php | 2 +- src/Command/Remote/DrushCommand.php | 2 +- src/Command/Remote/SshCommand.php | 2 +- src/Command/Self/ClearCacheCommand.php | 5 ++--- src/Command/Self/ListCommand.php | 2 +- src/Command/Self/MakeDocsCommand.php | 2 +- src/Command/Self/TelemetryCommand.php | 5 ++--- src/Command/Self/TelemetryDisableCommand.php | 5 ++--- src/Command/Self/TelemetryEnableCommand.php | 5 ++--- src/Command/Ssh/SshKeyCreateCommand.php | 2 +- src/Command/Ssh/SshKeyCreateUploadCommand.php | 2 +- src/Command/Ssh/SshKeyDeleteCommand.php | 2 +- src/Command/Ssh/SshKeyInfoCommand.php | 2 +- src/Command/Ssh/SshKeyListCommand.php | 2 +- src/Command/Ssh/SshKeyUploadCommand.php | 2 +- 66 files changed, 74 insertions(+), 82 deletions(-) diff --git a/src/Command/Acsf/AcsfListCommand.php b/src/Command/Acsf/AcsfListCommand.php index cd0933179..4738d4172 100644 --- a/src/Command/Acsf/AcsfListCommand.php +++ b/src/Command/Acsf/AcsfListCommand.php @@ -6,13 +6,12 @@ use Symfony\Component\Console\Attribute\AsCommand; -#[AsCommand(name: 'acsf:list', 'List all Acquia Cloud Site Factory commands', ['acsf'])] +#[AsCommand(name: 'acsf:list', description: 'List all Acquia Cloud Site Factory commands', aliases: ['acsf'])] class AcsfListCommand extends AcsfListCommandBase { protected string $namespace = 'acsf'; - protected function configure(): void - { + protected function configure(): void { } } diff --git a/src/Command/Api/ApiListCommand.php b/src/Command/Api/ApiListCommand.php index 8f0a16b04..b8ea83b46 100644 --- a/src/Command/Api/ApiListCommand.php +++ b/src/Command/Api/ApiListCommand.php @@ -6,13 +6,12 @@ use Symfony\Component\Console\Attribute\AsCommand; -#[AsCommand(name: 'api:list', 'List all API commands', ['api'])] +#[AsCommand(name: 'api:list', description: 'List all API commands', aliases: ['api'])] class ApiListCommand extends ApiListCommandBase { protected string $namespace = 'api'; - protected function configure(): void - { + protected function configure(): void { } } diff --git a/src/Command/App/AppOpenCommand.php b/src/Command/App/AppOpenCommand.php index 8e27f1a56..16862b49d 100644 --- a/src/Command/App/AppOpenCommand.php +++ b/src/Command/App/AppOpenCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'app:open', 'Opens your browser to view a given Cloud application', ['open', 'o'])] +#[AsCommand(name: 'app:open', description: 'Opens your browser to view a given Cloud application', aliases: ['open', 'o'])] class AppOpenCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/App/AppVcsInfo.php b/src/Command/App/AppVcsInfo.php index 923636113..94d46cd88 100644 --- a/src/Command/App/AppVcsInfo.php +++ b/src/Command/App/AppVcsInfo.php @@ -14,7 +14,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'app:vcs:info', 'Get all branches and tags of the application with the deployment status')] +#[AsCommand(name: 'app:vcs:info', description: 'Get all branches and tags of the application with the deployment status')] class AppVcsInfo extends CommandBase { protected function configure(): void { diff --git a/src/Command/App/LinkCommand.php b/src/Command/App/LinkCommand.php index 539b1fe53..82f844f5b 100644 --- a/src/Command/App/LinkCommand.php +++ b/src/Command/App/LinkCommand.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'app:link', 'Associate your project with a Cloud Platform application', ['link'])] +#[AsCommand(name: 'app:link', description: 'Associate your project with a Cloud Platform application', aliases: ['link'])] class LinkCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/App/LogTailCommand.php b/src/Command/App/LogTailCommand.php index e2c8c8a46..69f6c5818 100644 --- a/src/Command/App/LogTailCommand.php +++ b/src/Command/App/LogTailCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'app:log:tail', 'Tail the logs from your environments', ['tail', 'log:tail'])] +#[AsCommand(name: 'app:log:tail', description: 'Tail the logs from your environments', aliases: ['tail', 'log:tail'])] class LogTailCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/App/NewCommand.php b/src/Command/App/NewCommand.php index 9b5d68362..6d1670613 100644 --- a/src/Command/App/NewCommand.php +++ b/src/Command/App/NewCommand.php @@ -14,7 +14,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Filesystem\Path; -#[AsCommand(name: 'app:new:local', 'Create a new Drupal or Next.js project', ['new'])] +#[AsCommand(name: 'app:new:local', description: 'Create a new Drupal or Next.js project', aliases: ['new'])] class NewCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/App/NewFromDrupal7Command.php b/src/Command/App/NewFromDrupal7Command.php index e61d97384..f26bd8727 100644 --- a/src/Command/App/NewFromDrupal7Command.php +++ b/src/Command/App/NewFromDrupal7Command.php @@ -22,7 +22,7 @@ use Symfony\Component\Filesystem\Path; use Symfony\Component\Validator\Exception\ValidatorException; -#[AsCommand(name: 'app:new:from:drupal7', 'Generate a new Drupal 9+ project from a Drupal 7 application using the default Acquia Migrate Accelerate recommendations.', [ +#[AsCommand(name: 'app:new:from:drupal7', description: 'Generate a new Drupal 9+ project from a Drupal 7 application using the default Acquia Migrate Accelerate recommendations.', aliases: [ // Currently only "from Drupal 7", more to potentially follow. 'from:d7', // A nod to its roots. diff --git a/src/Command/App/TaskWaitCommand.php b/src/Command/App/TaskWaitCommand.php index fc3fe67a6..6d596d6f6 100644 --- a/src/Command/App/TaskWaitCommand.php +++ b/src/Command/App/TaskWaitCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'app:task-wait', 'Wait for a task to complete')] +#[AsCommand(name: 'app:task-wait', description: 'Wait for a task to complete')] class TaskWaitCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/App/UnlinkCommand.php b/src/Command/App/UnlinkCommand.php index 1a021792a..dc2e351f4 100644 --- a/src/Command/App/UnlinkCommand.php +++ b/src/Command/App/UnlinkCommand.php @@ -11,11 +11,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'app:unlink', 'Remove local association between your project and a Cloud Platform application', ['unlink'])] +#[AsCommand(name: 'app:unlink', description: 'Remove local association between your project and a Cloud Platform application', aliases: ['unlink'])] class UnlinkCommand extends CommandBase { - protected function configure(): void - { + protected function configure(): void { } protected function commandRequiresAuthentication(): bool { diff --git a/src/Command/Archive/ArchiveExportCommand.php b/src/Command/Archive/ArchiveExportCommand.php index 560da77a4..0644f2ed5 100644 --- a/src/Command/Archive/ArchiveExportCommand.php +++ b/src/Command/Archive/ArchiveExportCommand.php @@ -18,7 +18,7 @@ use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Path; -#[AsCommand(name: 'archive:export', 'Export an archive of the Drupal application including code, files, and database')] +#[AsCommand(name: 'archive:export', description: 'Export an archive of the Drupal application including code, files, and database')] class ArchiveExportCommand extends CommandBase { protected Checklist $checklist; diff --git a/src/Command/Auth/AuthAcsfLoginCommand.php b/src/Command/Auth/AuthAcsfLoginCommand.php index 6af23ab5c..391e11305 100644 --- a/src/Command/Auth/AuthAcsfLoginCommand.php +++ b/src/Command/Auth/AuthAcsfLoginCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'auth:acsf-login', 'Register your Site Factory API key and secret to use API functionality')] +#[AsCommand(name: 'auth:acsf-login', description: 'Register your Site Factory API key and secret to use API functionality')] class AuthAcsfLoginCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/Auth/AuthAcsfLogoutCommand.php b/src/Command/Auth/AuthAcsfLogoutCommand.php index 1e8b75748..3823ae858 100644 --- a/src/Command/Auth/AuthAcsfLogoutCommand.php +++ b/src/Command/Auth/AuthAcsfLogoutCommand.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'auth:acsf-logout', 'Remove your Site Factory key and secret from your local machine.')] +#[AsCommand(name: 'auth:acsf-logout', description: 'Remove your Site Factory key and secret from your local machine.')] class AuthAcsfLogoutCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/Auth/AuthLoginCommand.php b/src/Command/Auth/AuthLoginCommand.php index 59e78be9f..b7dba708b 100644 --- a/src/Command/Auth/AuthLoginCommand.php +++ b/src/Command/Auth/AuthLoginCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'auth:login', 'Register your Cloud API key and secret to use API functionality', ['login'])] +#[AsCommand(name: 'auth:login', description: 'Register your Cloud API key and secret to use API functionality', aliases: ['login'])] class AuthLoginCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/Auth/AuthLogoutCommand.php b/src/Command/Auth/AuthLogoutCommand.php index a06324746..cfe9f7515 100644 --- a/src/Command/Auth/AuthLogoutCommand.php +++ b/src/Command/Auth/AuthLogoutCommand.php @@ -10,11 +10,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'auth:logout', 'Remove Cloud API key and secret from local machine.', ['logout'])] +#[AsCommand(name: 'auth:logout', description: 'Remove Cloud API key and secret from local machine.', aliases: ['logout'])] class AuthLogoutCommand extends CommandBase { - protected function configure(): void - { + protected function configure(): void { } protected function commandRequiresAuthentication(): bool { diff --git a/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php b/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php index 9f997159e..56b15e84d 100644 --- a/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php +++ b/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'codestudio:php-version', 'Change the PHP version in Code Studio')] +#[AsCommand(name: 'codestudio:php-version', description: 'Change the PHP version in Code Studio')] class CodeStudioPhpVersionCommand extends CommandBase { use CodeStudioCommandTrait; diff --git a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php index ce72d0e38..5d0df796a 100644 --- a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php +++ b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php @@ -16,7 +16,7 @@ use Symfony\Component\Filesystem\Path; use Symfony\Component\Yaml\Yaml; -#[AsCommand(name: 'codestudio:pipelines-migrate', 'Migrate .acquia-pipeline.yml file to .gitlab-ci.yml file for a given Acquia Cloud application', ['cs:pipelines-migrate'])] +#[AsCommand(name: 'codestudio:pipelines-migrate', description: 'Migrate .acquia-pipeline.yml file to .gitlab-ci.yml file for a given Acquia Cloud application', aliases: ['cs:pipelines-migrate'])] class CodeStudioPipelinesMigrateCommand extends CommandBase { use CodeStudioCommandTrait; diff --git a/src/Command/CodeStudio/CodeStudioWizardCommand.php b/src/Command/CodeStudio/CodeStudioWizardCommand.php index 3464a148c..45fc4e3f0 100644 --- a/src/Command/CodeStudio/CodeStudioWizardCommand.php +++ b/src/Command/CodeStudio/CodeStudioWizardCommand.php @@ -15,7 +15,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'codestudio:wizard', 'Create and/or configure a new Code Studio project for a given Acquia Cloud application', ['cs:wizard'])] +#[AsCommand(name: 'codestudio:wizard', description: 'Create and/or configure a new Code Studio project for a given Acquia Cloud application', aliases: ['cs:wizard'])] class CodeStudioWizardCommand extends WizardCommandBase { use CodeStudioCommandTrait; diff --git a/src/Command/DocsCommand.php b/src/Command/DocsCommand.php index 9ceb7eab0..e7c06be4f 100644 --- a/src/Command/DocsCommand.php +++ b/src/Command/DocsCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ChoiceQuestion; -#[AsCommand(name: 'docs', 'Open Acquia product documentation in a web browser')] +#[AsCommand(name: 'docs', description: 'Open Acquia product documentation in a web browser')] class DocsCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/Email/ConfigurePlatformEmailCommand.php b/src/Command/Email/ConfigurePlatformEmailCommand.php index 67e9b262e..fb8bc5d81 100644 --- a/src/Command/Email/ConfigurePlatformEmailCommand.php +++ b/src/Command/Email/ConfigurePlatformEmailCommand.php @@ -25,7 +25,7 @@ use Symfony\Component\Validator\Validation; use Symfony\Component\Yaml\Yaml; -#[AsCommand(name: 'email:configure', 'Configure Platform email for one or more applications', ['ec'])] +#[AsCommand(name: 'email:configure', description: 'Configure Platform email for one or more applications', aliases: ['ec'])] class ConfigurePlatformEmailCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/Email/EmailInfoForSubscriptionCommand.php b/src/Command/Email/EmailInfoForSubscriptionCommand.php index e497aff32..2ee22f65b 100644 --- a/src/Command/Email/EmailInfoForSubscriptionCommand.php +++ b/src/Command/Email/EmailInfoForSubscriptionCommand.php @@ -18,7 +18,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'email:info', 'Print information related to Platform Email set up in a subscription.')] +#[AsCommand(name: 'email:info', description: 'Print information related to Platform Email set up in a subscription.')] class EmailInfoForSubscriptionCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/Env/EnvCertCreateCommand.php b/src/Command/Env/EnvCertCreateCommand.php index 8dadec3b2..794545b84 100644 --- a/src/Command/Env/EnvCertCreateCommand.php +++ b/src/Command/Env/EnvCertCreateCommand.php @@ -13,7 +13,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'env:certificate-create', 'Install an SSL certificate.')] +#[AsCommand(name: 'env:certificate-create', description: 'Install an SSL certificate.')] class EnvCertCreateCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/Env/EnvCopyCronCommand.php b/src/Command/Env/EnvCopyCronCommand.php index 7e59233ec..4e2a25e64 100644 --- a/src/Command/Env/EnvCopyCronCommand.php +++ b/src/Command/Env/EnvCopyCronCommand.php @@ -13,7 +13,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'env:cron-copy', 'Copy all cron tasks from one Acquia Cloud Platform environment to another')] +#[AsCommand(name: 'env:cron-copy', description: 'Copy all cron tasks from one Acquia Cloud Platform environment to another')] class EnvCopyCronCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/Env/EnvCreateCommand.php b/src/Command/Env/EnvCreateCommand.php index ef3113c32..079e4bc0d 100644 --- a/src/Command/Env/EnvCreateCommand.php +++ b/src/Command/Env/EnvCreateCommand.php @@ -16,7 +16,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'env:create', 'Create a new Continuous Delivery Environment (CDE)')] +#[AsCommand(name: 'env:create', description: 'Create a new Continuous Delivery Environment (CDE)')] class EnvCreateCommand extends CommandBase { private Checklist $checklist; diff --git a/src/Command/Env/EnvDeleteCommand.php b/src/Command/Env/EnvDeleteCommand.php index 808bad7aa..d58c28573 100644 --- a/src/Command/Env/EnvDeleteCommand.php +++ b/src/Command/Env/EnvDeleteCommand.php @@ -13,7 +13,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'env:delete', 'Delete a Continuous Delivery Environment (CDE)')] +#[AsCommand(name: 'env:delete', description: 'Delete a Continuous Delivery Environment (CDE)')] class EnvDeleteCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/Env/EnvMirrorCommand.php b/src/Command/Env/EnvMirrorCommand.php index 049e075ad..00ecda511 100644 --- a/src/Command/Env/EnvMirrorCommand.php +++ b/src/Command/Env/EnvMirrorCommand.php @@ -17,7 +17,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'env:mirror', 'Makes one environment identical to another in terms of code, database, files, and configuration.')] +#[AsCommand(name: 'env:mirror', description: 'Makes one environment identical to another in terms of code, database, files, and configuration.')] class EnvMirrorCommand extends CommandBase { private Checklist $checklist; diff --git a/src/Command/HelloWorldCommand.php b/src/Command/HelloWorldCommand.php index 53f12ba51..c4def7854 100644 --- a/src/Command/HelloWorldCommand.php +++ b/src/Command/HelloWorldCommand.php @@ -9,7 +9,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'hello-world', 'Test command used for asserting core functionality')] +#[AsCommand(name: 'hello-world', description: 'Test command used for asserting core functionality')] class HelloWorldCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/Ide/IdeCreateCommand.php b/src/Command/Ide/IdeCreateCommand.php index ffead5e28..fd2a2a9a5 100644 --- a/src/Command/Ide/IdeCreateCommand.php +++ b/src/Command/Ide/IdeCreateCommand.php @@ -20,7 +20,7 @@ use Symfony\Component\Validator\Exception\ValidatorException; use Symfony\Component\Validator\Validation; -#[AsCommand(name: 'ide:create', 'Create a Cloud IDE')] +#[AsCommand(name: 'ide:create', description: 'Create a Cloud IDE')] class IdeCreateCommand extends IdeCommandBase { private IdeResponse $ide; diff --git a/src/Command/Ide/IdeDeleteCommand.php b/src/Command/Ide/IdeDeleteCommand.php index 99d30ce38..b18f061eb 100644 --- a/src/Command/Ide/IdeDeleteCommand.php +++ b/src/Command/Ide/IdeDeleteCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:delete', 'Delete a Cloud IDE')] +#[AsCommand(name: 'ide:delete', description: 'Delete a Cloud IDE')] class IdeDeleteCommand extends IdeCommandBase { use SshCommandTrait; diff --git a/src/Command/Ide/IdeInfoCommand.php b/src/Command/Ide/IdeInfoCommand.php index 9221558fe..56b76c4e4 100644 --- a/src/Command/Ide/IdeInfoCommand.php +++ b/src/Command/Ide/IdeInfoCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:info', 'Print information about a Cloud IDE')] +#[AsCommand(name: 'ide:info', description: 'Print information about a Cloud IDE')] class IdeInfoCommand extends IdeCommandBase { protected function configure(): void { diff --git a/src/Command/Ide/IdeListCommand.php b/src/Command/Ide/IdeListCommand.php index 09f6dc49b..9739f8403 100644 --- a/src/Command/Ide/IdeListCommand.php +++ b/src/Command/Ide/IdeListCommand.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:list:app', 'List available Cloud IDEs belonging to a given application', ['ide:list'])] +#[AsCommand(name: 'ide:list:app', description: 'List available Cloud IDEs belonging to a given application', aliases: ['ide:list'])] class IdeListCommand extends IdeCommandBase { protected function configure(): void { diff --git a/src/Command/Ide/IdeListMineCommand.php b/src/Command/Ide/IdeListMineCommand.php index 35228b065..1ffb88048 100644 --- a/src/Command/Ide/IdeListMineCommand.php +++ b/src/Command/Ide/IdeListMineCommand.php @@ -13,7 +13,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:list:mine', 'List Cloud IDEs belonging to you')] +#[AsCommand(name: 'ide:list:mine', description: 'List Cloud IDEs belonging to you')] class IdeListMineCommand extends IdeCommandBase { protected function configure(): void { diff --git a/src/Command/Ide/IdeOpenCommand.php b/src/Command/Ide/IdeOpenCommand.php index 56af07475..c40f24a96 100644 --- a/src/Command/Ide/IdeOpenCommand.php +++ b/src/Command/Ide/IdeOpenCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:open', 'Open a Cloud IDE in your browser')] +#[AsCommand(name: 'ide:open', description: 'Open a Cloud IDE in your browser')] class IdeOpenCommand extends IdeCommandBase { protected function configure(): void { diff --git a/src/Command/Ide/IdePhpVersionCommand.php b/src/Command/Ide/IdePhpVersionCommand.php index a2a62eb63..b68e99877 100644 --- a/src/Command/Ide/IdePhpVersionCommand.php +++ b/src/Command/Ide/IdePhpVersionCommand.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:php-version', 'Change the PHP version in the current IDE')] +#[AsCommand(name: 'ide:php-version', description: 'Change the PHP version in the current IDE')] class IdePhpVersionCommand extends IdeCommandBase { private string $idePhpFilePathPrefix; diff --git a/src/Command/Ide/IdeServiceRestartCommand.php b/src/Command/Ide/IdeServiceRestartCommand.php index 8e8a0e782..0e41a74ea 100644 --- a/src/Command/Ide/IdeServiceRestartCommand.php +++ b/src/Command/Ide/IdeServiceRestartCommand.php @@ -14,7 +14,7 @@ use Symfony\Component\Validator\Exception\ValidatorException; use Symfony\Component\Validator\Validation; -#[AsCommand(name: 'ide:service-restart', 'Restart a service in the Cloud IDE')] +#[AsCommand(name: 'ide:service-restart', description: 'Restart a service in the Cloud IDE')] class IdeServiceRestartCommand extends IdeCommandBase { protected function commandRequiresAuthentication(): bool { diff --git a/src/Command/Ide/IdeServiceStartCommand.php b/src/Command/Ide/IdeServiceStartCommand.php index 3788eecc4..e93eb0308 100644 --- a/src/Command/Ide/IdeServiceStartCommand.php +++ b/src/Command/Ide/IdeServiceStartCommand.php @@ -14,7 +14,7 @@ use Symfony\Component\Validator\Exception\ValidatorException; use Symfony\Component\Validator\Validation; -#[AsCommand(name: 'ide:service-start', 'Start a service in the Cloud IDE')] +#[AsCommand(name: 'ide:service-start', description: 'Start a service in the Cloud IDE')] class IdeServiceStartCommand extends IdeCommandBase { protected function commandRequiresAuthentication(): bool { diff --git a/src/Command/Ide/IdeServiceStopCommand.php b/src/Command/Ide/IdeServiceStopCommand.php index 5584f6fc0..6e671764a 100644 --- a/src/Command/Ide/IdeServiceStopCommand.php +++ b/src/Command/Ide/IdeServiceStopCommand.php @@ -14,7 +14,7 @@ use Symfony\Component\Validator\Exception\ValidatorException; use Symfony\Component\Validator\Validation; -#[AsCommand(name: 'ide:service-stop', 'Stop a service in the Cloud IDE')] +#[AsCommand(name: 'ide:service-stop', description: 'Stop a service in the Cloud IDE')] class IdeServiceStopCommand extends IdeCommandBase { protected function commandRequiresAuthentication(): bool { diff --git a/src/Command/Ide/IdeShareCommand.php b/src/Command/Ide/IdeShareCommand.php index 289d935c4..f200cb7fd 100644 --- a/src/Command/Ide/IdeShareCommand.php +++ b/src/Command/Ide/IdeShareCommand.php @@ -14,7 +14,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:share', 'Get the share URL for a Cloud IDE')] +#[AsCommand(name: 'ide:share', description: 'Get the share URL for a Cloud IDE')] class IdeShareCommand extends CommandBase { /** diff --git a/src/Command/Ide/IdeXdebugToggleCommand.php b/src/Command/Ide/IdeXdebugToggleCommand.php index ccd8ce500..48f8f8eca 100644 --- a/src/Command/Ide/IdeXdebugToggleCommand.php +++ b/src/Command/Ide/IdeXdebugToggleCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:xdebug-toggle', 'Toggle Xdebug on or off in the current IDE', ['xdebug'])] +#[AsCommand(name: 'ide:xdebug-toggle', description: 'Toggle Xdebug on or off in the current IDE', aliases: ['xdebug'])] class IdeXdebugToggleCommand extends IdeCommandBase { private ?bool $xDebugEnabled; diff --git a/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php b/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php index 85426e8eb..c44d0f09a 100644 --- a/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php +++ b/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:wizard:ssh-key:create-upload', 'Wizard to perform first time setup tasks within an IDE', ['ide:wizard'])] +#[AsCommand(name: 'ide:wizard:ssh-key:create-upload', description: 'Wizard to perform first time setup tasks within an IDE', aliases: ['ide:wizard'])] class IdeWizardCreateSshKeyCommand extends IdeWizardCommandBase { protected function configure(): void { diff --git a/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php b/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php index 23b069e73..b189e85d5 100644 --- a/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php +++ b/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ide:wizard:ssh-key:delete', 'Wizard to delete SSH key for IDE from Cloud')] +#[AsCommand(name: 'ide:wizard:ssh-key:delete', description: 'Wizard to delete SSH key for IDE from Cloud')] class IdeWizardDeleteSshKeyCommand extends IdeWizardCommandBase { use SshCommandTrait; diff --git a/src/Command/Pull/PullCodeCommand.php b/src/Command/Pull/PullCodeCommand.php index 4e43291cc..190fcc57b 100644 --- a/src/Command/Pull/PullCodeCommand.php +++ b/src/Command/Pull/PullCodeCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'pull:code', 'Copy code from a Cloud Platform environment')] +#[AsCommand(name: 'pull:code', description: 'Copy code from a Cloud Platform environment')] class PullCodeCommand extends PullCommandBase { protected function commandRequiresDatabase(): bool { diff --git a/src/Command/Pull/PullCommand.php b/src/Command/Pull/PullCommand.php index 901440f23..9b75566b8 100644 --- a/src/Command/Pull/PullCommand.php +++ b/src/Command/Pull/PullCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'pull:all', 'Copy code, database, and files from a Cloud Platform environment', ['refresh', 'pull'])] +#[AsCommand(name: 'pull:all', description: 'Copy code, database, and files from a Cloud Platform environment', aliases: ['refresh', 'pull'])] class PullCommand extends PullCommandBase { protected function commandRequiresDatabase(): bool { diff --git a/src/Command/Pull/PullDatabaseCommand.php b/src/Command/Pull/PullDatabaseCommand.php index 7c45ab6bf..664668b29 100644 --- a/src/Command/Pull/PullDatabaseCommand.php +++ b/src/Command/Pull/PullDatabaseCommand.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'pull:database', 'Import database backup from a Cloud Platform environment', ['pull:db'])] +#[AsCommand(name: 'pull:database', description: 'Import database backup from a Cloud Platform environment', aliases: ['pull:db'])] class PullDatabaseCommand extends PullCommandBase { protected function commandRequiresDatabase(): bool { diff --git a/src/Command/Pull/PullFilesCommand.php b/src/Command/Pull/PullFilesCommand.php index 24e381f46..2405e2d9f 100644 --- a/src/Command/Pull/PullFilesCommand.php +++ b/src/Command/Pull/PullFilesCommand.php @@ -9,7 +9,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'pull:files', 'Copy Drupal public files from a Cloud Platform environment to your local environment')] +#[AsCommand(name: 'pull:files', description: 'Copy Drupal public files from a Cloud Platform environment to your local environment')] class PullFilesCommand extends PullCommandBase { protected function configure(): void { diff --git a/src/Command/Pull/PullScriptsCommand.php b/src/Command/Pull/PullScriptsCommand.php index eb5a4d318..5080ef9f6 100644 --- a/src/Command/Pull/PullScriptsCommand.php +++ b/src/Command/Pull/PullScriptsCommand.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'pull:run-scripts', 'Execute post pull scripts')] +#[AsCommand(name: 'pull:run-scripts', description: 'Execute post pull scripts')] class PullScriptsCommand extends PullCommandBase { protected function configure(): void { diff --git a/src/Command/Push/PushArtifactCommand.php b/src/Command/Push/PushArtifactCommand.php index 1cf7072eb..ed6f589db 100644 --- a/src/Command/Push/PushArtifactCommand.php +++ b/src/Command/Push/PushArtifactCommand.php @@ -16,7 +16,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Filesystem\Path; -#[AsCommand(name: 'push:artifact', 'Build and push a code artifact to a Cloud Platform environment')] +#[AsCommand(name: 'push:artifact', description: 'Build and push a code artifact to a Cloud Platform environment')] class PushArtifactCommand extends PullCommandBase { /** diff --git a/src/Command/Push/PushCodeCommand.php b/src/Command/Push/PushCodeCommand.php index 8ebde0e5e..b348cb316 100644 --- a/src/Command/Push/PushCodeCommand.php +++ b/src/Command/Push/PushCodeCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'push:code', 'Push code from your IDE to a Cloud Platform environment')] +#[AsCommand(name: 'push:code', description: 'Push code from your IDE to a Cloud Platform environment')] class PushCodeCommand extends PullCommandBase { protected function configure(): void { diff --git a/src/Command/Push/PushDatabaseCommand.php b/src/Command/Push/PushDatabaseCommand.php index 3aece3df0..603529404 100644 --- a/src/Command/Push/PushDatabaseCommand.php +++ b/src/Command/Push/PushDatabaseCommand.php @@ -14,7 +14,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'push:database', 'Push a database from your local environment to a Cloud Platform environment', ['push:db'])] +#[AsCommand(name: 'push:database', description: 'Push a database from your local environment to a Cloud Platform environment', aliases: ['push:db'])] class PushDatabaseCommand extends PullCommandBase { protected function commandRequiresDatabase(): bool { diff --git a/src/Command/Push/PushFilesCommand.php b/src/Command/Push/PushFilesCommand.php index b1b9cc1f6..7a575df85 100644 --- a/src/Command/Push/PushFilesCommand.php +++ b/src/Command/Push/PushFilesCommand.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'push:files', 'Copy Drupal public files from your local environment to a Cloud Platform environment')] +#[AsCommand(name: 'push:files', description: 'Copy Drupal public files from your local environment to a Cloud Platform environment')] class PushFilesCommand extends PullCommandBase { protected function configure(): void { diff --git a/src/Command/Remote/AliasListCommand.php b/src/Command/Remote/AliasListCommand.php index 279fdb94e..f541318c9 100644 --- a/src/Command/Remote/AliasListCommand.php +++ b/src/Command/Remote/AliasListCommand.php @@ -13,7 +13,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'remote:aliases:list', 'List all aliases for the Cloud Platform environments', ['aliases', 'sa'])] +#[AsCommand(name: 'remote:aliases:list', description: 'List all aliases for the Cloud Platform environments', aliases: ['aliases', 'sa'])] class AliasListCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/Remote/AliasesDownloadCommand.php b/src/Command/Remote/AliasesDownloadCommand.php index f338268a9..6c12453f8 100644 --- a/src/Command/Remote/AliasesDownloadCommand.php +++ b/src/Command/Remote/AliasesDownloadCommand.php @@ -20,7 +20,7 @@ /** * A command to proxy Drush commands on an environment using SSH. */ -#[AsCommand(name: 'remote:aliases:download', 'Download Drush aliases for the Cloud Platform')] +#[AsCommand(name: 'remote:aliases:download', description: 'Download Drush aliases for the Cloud Platform')] class AliasesDownloadCommand extends SshCommand { private string $drushArchiveFilepath; diff --git a/src/Command/Remote/DrushCommand.php b/src/Command/Remote/DrushCommand.php index 8119210a6..ab5768ad9 100644 --- a/src/Command/Remote/DrushCommand.php +++ b/src/Command/Remote/DrushCommand.php @@ -12,7 +12,7 @@ /** * A command to proxy Drush commands on an environment using SSH. */ -#[AsCommand(name: 'remote:drush', 'Run a Drush command remotely on a application\'s environment', ['drush', 'dr'])] +#[AsCommand(name: 'remote:drush', description: 'Run a Drush command remotely on a application\'s environment', aliases: ['drush', 'dr'])] class DrushCommand extends SshBaseCommand { protected function configure(): void { diff --git a/src/Command/Remote/SshCommand.php b/src/Command/Remote/SshCommand.php index ed847e99c..0c1022078 100644 --- a/src/Command/Remote/SshCommand.php +++ b/src/Command/Remote/SshCommand.php @@ -13,7 +13,7 @@ /** * A command to proxy Drush commands on an environment using SSH. */ -#[AsCommand(name: 'remote:ssh', 'Use SSH to open a shell or run a command in a Cloud Platform environment', ['ssh'])] +#[AsCommand(name: 'remote:ssh', description: 'Use SSH to open a shell or run a command in a Cloud Platform environment', aliases: ['ssh'])] class SshCommand extends SshBaseCommand { protected function configure(): void { diff --git a/src/Command/Self/ClearCacheCommand.php b/src/Command/Self/ClearCacheCommand.php index 94fd676f0..42b20886a 100644 --- a/src/Command/Self/ClearCacheCommand.php +++ b/src/Command/Self/ClearCacheCommand.php @@ -12,11 +12,10 @@ use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Path; -#[AsCommand(name: 'self:clear-caches', 'Clears local Acquia CLI caches', ['cc', 'cr'])] +#[AsCommand(name: 'self:clear-caches', description: 'Clears local Acquia CLI caches', aliases: ['cc', 'cr'])] class ClearCacheCommand extends CommandBase { - protected function configure(): void - { + protected function configure(): void { } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Command/Self/ListCommand.php b/src/Command/Self/ListCommand.php index 00cdc046e..de156fd91 100644 --- a/src/Command/Self/ListCommand.php +++ b/src/Command/Self/ListCommand.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'list', null, ['self:list'])] +#[AsCommand(name: 'list', description: NULL, aliases: ['self:list'])] class ListCommand extends \Symfony\Component\Console\Command\ListCommand { protected function configure(): void { diff --git a/src/Command/Self/MakeDocsCommand.php b/src/Command/Self/MakeDocsCommand.php index 9a8b4c234..dbe3482ce 100644 --- a/src/Command/Self/MakeDocsCommand.php +++ b/src/Command/Self/MakeDocsCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'self:make-docs', 'Generate documentation for all ACLI commands')] +#[AsCommand(name: 'self:make-docs', description: 'Generate documentation for all ACLI commands')] class MakeDocsCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/Self/TelemetryCommand.php b/src/Command/Self/TelemetryCommand.php index 62e2d73ff..9c6e73a1a 100644 --- a/src/Command/Self/TelemetryCommand.php +++ b/src/Command/Self/TelemetryCommand.php @@ -11,15 +11,14 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'self:telemetry:toggle', 'Toggle anonymous sharing of usage and performance data', ['telemetry'])] +#[AsCommand(name: 'self:telemetry:toggle', description: 'Toggle anonymous sharing of usage and performance data', aliases: ['telemetry'])] class TelemetryCommand extends CommandBase { protected function commandRequiresAuthentication(): bool { return FALSE; } - protected function configure(): void - { + protected function configure(): void { } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Command/Self/TelemetryDisableCommand.php b/src/Command/Self/TelemetryDisableCommand.php index adbf1dc66..569857544 100644 --- a/src/Command/Self/TelemetryDisableCommand.php +++ b/src/Command/Self/TelemetryDisableCommand.php @@ -11,15 +11,14 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'self:telemetry:disable', 'Disable anonymous sharing of usage and performance data', ['telemetry:disable'])] +#[AsCommand(name: 'self:telemetry:disable', description: 'Disable anonymous sharing of usage and performance data', aliases: ['telemetry:disable'])] class TelemetryDisableCommand extends CommandBase { protected function commandRequiresAuthentication(): bool { return FALSE; } - protected function configure(): void - { + protected function configure(): void { } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Command/Self/TelemetryEnableCommand.php b/src/Command/Self/TelemetryEnableCommand.php index 8bc9e5cbd..e409a8786 100644 --- a/src/Command/Self/TelemetryEnableCommand.php +++ b/src/Command/Self/TelemetryEnableCommand.php @@ -11,15 +11,14 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'self:telemetry:enable', 'Enable anonymous sharing of usage and performance data', ['telemetry:enable'])] +#[AsCommand(name: 'self:telemetry:enable', description: 'Enable anonymous sharing of usage and performance data', aliases: ['telemetry:enable'])] class TelemetryEnableCommand extends CommandBase { protected function commandRequiresAuthentication(): bool { return FALSE; } - protected function configure(): void - { + protected function configure(): void { } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Command/Ssh/SshKeyCreateCommand.php b/src/Command/Ssh/SshKeyCreateCommand.php index 8a916cc73..3812bcf20 100644 --- a/src/Command/Ssh/SshKeyCreateCommand.php +++ b/src/Command/Ssh/SshKeyCreateCommand.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ssh-key:create', 'Create an SSH key on your local machine')] +#[AsCommand(name: 'ssh-key:create', description: 'Create an SSH key on your local machine')] class SshKeyCreateCommand extends SshKeyCommandBase { protected function configure(): void { diff --git a/src/Command/Ssh/SshKeyCreateUploadCommand.php b/src/Command/Ssh/SshKeyCreateUploadCommand.php index f763f2138..3d4eefba0 100644 --- a/src/Command/Ssh/SshKeyCreateUploadCommand.php +++ b/src/Command/Ssh/SshKeyCreateUploadCommand.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ssh-key:create-upload', 'Create an SSH key on your local machine and upload it to the Cloud Platform')] +#[AsCommand(name: 'ssh-key:create-upload', description: 'Create an SSH key on your local machine and upload it to the Cloud Platform')] class SshKeyCreateUploadCommand extends SshKeyCreateCommand { protected function configure(): void { diff --git a/src/Command/Ssh/SshKeyDeleteCommand.php b/src/Command/Ssh/SshKeyDeleteCommand.php index bbe57cbbe..7beb057b9 100644 --- a/src/Command/Ssh/SshKeyDeleteCommand.php +++ b/src/Command/Ssh/SshKeyDeleteCommand.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ssh-key:delete', 'Delete an SSH key')] +#[AsCommand(name: 'ssh-key:delete', description: 'Delete an SSH key')] class SshKeyDeleteCommand extends SshKeyCommandBase { use SshCommandTrait; diff --git a/src/Command/Ssh/SshKeyInfoCommand.php b/src/Command/Ssh/SshKeyInfoCommand.php index a1fb6dd2f..0316ca655 100644 --- a/src/Command/Ssh/SshKeyInfoCommand.php +++ b/src/Command/Ssh/SshKeyInfoCommand.php @@ -13,7 +13,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ssh-key:info', 'Print information about an SSH key')] +#[AsCommand(name: 'ssh-key:info', description: 'Print information about an SSH key')] class SshKeyInfoCommand extends SshKeyCommandBase { protected function configure(): void { diff --git a/src/Command/Ssh/SshKeyListCommand.php b/src/Command/Ssh/SshKeyListCommand.php index a9142644c..b7ece93eb 100644 --- a/src/Command/Ssh/SshKeyListCommand.php +++ b/src/Command/Ssh/SshKeyListCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ssh-key:list', 'List your local and remote SSH keys')] +#[AsCommand(name: 'ssh-key:list', description: 'List your local and remote SSH keys')] class SshKeyListCommand extends SshKeyCommandBase { protected function configure(): void { diff --git a/src/Command/Ssh/SshKeyUploadCommand.php b/src/Command/Ssh/SshKeyUploadCommand.php index 3d6333754..3e47a732a 100644 --- a/src/Command/Ssh/SshKeyUploadCommand.php +++ b/src/Command/Ssh/SshKeyUploadCommand.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'ssh-key:upload', 'Upload a local SSH key to the Cloud Platform')] +#[AsCommand(name: 'ssh-key:upload', description: 'Upload a local SSH key to the Cloud Platform')] class SshKeyUploadCommand extends SshKeyCommandBase { protected function configure(): void { From 9b20369ecf4bd96fd285cb5cd1bb236b0854f871 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 28 Nov 2023 07:55:18 -0800 Subject: [PATCH 07/12] cleanup --- src/Command/Acsf/AcsfListCommand.php | 3 --- src/Command/Api/ApiListCommand.php | 3 --- src/Command/App/UnlinkCommand.php | 3 --- src/Command/Auth/AuthAcsfLogoutCommand.php | 3 --- src/Command/Auth/AuthLogoutCommand.php | 3 --- src/Command/Ide/IdeListMineCommand.php | 3 --- src/Command/Self/ClearCacheCommand.php | 3 --- src/Command/Self/TelemetryCommand.php | 3 --- src/Command/Self/TelemetryDisableCommand.php | 3 --- src/Command/Self/TelemetryEnableCommand.php | 3 --- src/Command/Ssh/SshKeyListCommand.php | 3 --- 11 files changed, 33 deletions(-) diff --git a/src/Command/Acsf/AcsfListCommand.php b/src/Command/Acsf/AcsfListCommand.php index 4738d4172..ee673952c 100644 --- a/src/Command/Acsf/AcsfListCommand.php +++ b/src/Command/Acsf/AcsfListCommand.php @@ -11,7 +11,4 @@ class AcsfListCommand extends AcsfListCommandBase { protected string $namespace = 'acsf'; - protected function configure(): void { - } - } diff --git a/src/Command/Api/ApiListCommand.php b/src/Command/Api/ApiListCommand.php index b8ea83b46..ca76c5c7a 100644 --- a/src/Command/Api/ApiListCommand.php +++ b/src/Command/Api/ApiListCommand.php @@ -11,7 +11,4 @@ class ApiListCommand extends ApiListCommandBase { protected string $namespace = 'api'; - protected function configure(): void { - } - } diff --git a/src/Command/App/UnlinkCommand.php b/src/Command/App/UnlinkCommand.php index dc2e351f4..eaaff2a75 100644 --- a/src/Command/App/UnlinkCommand.php +++ b/src/Command/App/UnlinkCommand.php @@ -14,9 +14,6 @@ #[AsCommand(name: 'app:unlink', description: 'Remove local association between your project and a Cloud Platform application', aliases: ['unlink'])] class UnlinkCommand extends CommandBase { - protected function configure(): void { - } - protected function commandRequiresAuthentication(): bool { return FALSE; } diff --git a/src/Command/Auth/AuthAcsfLogoutCommand.php b/src/Command/Auth/AuthAcsfLogoutCommand.php index 3823ae858..1d865742d 100644 --- a/src/Command/Auth/AuthAcsfLogoutCommand.php +++ b/src/Command/Auth/AuthAcsfLogoutCommand.php @@ -13,9 +13,6 @@ #[AsCommand(name: 'auth:acsf-logout', description: 'Remove your Site Factory key and secret from your local machine.')] class AuthAcsfLogoutCommand extends CommandBase { - protected function configure(): void { - } - protected function commandRequiresAuthentication(): bool { return FALSE; } diff --git a/src/Command/Auth/AuthLogoutCommand.php b/src/Command/Auth/AuthLogoutCommand.php index cfe9f7515..68f59a922 100644 --- a/src/Command/Auth/AuthLogoutCommand.php +++ b/src/Command/Auth/AuthLogoutCommand.php @@ -13,9 +13,6 @@ #[AsCommand(name: 'auth:logout', description: 'Remove Cloud API key and secret from local machine.', aliases: ['logout'])] class AuthLogoutCommand extends CommandBase { - protected function configure(): void { - } - protected function commandRequiresAuthentication(): bool { return FALSE; } diff --git a/src/Command/Ide/IdeListMineCommand.php b/src/Command/Ide/IdeListMineCommand.php index 1ffb88048..30c4972c9 100644 --- a/src/Command/Ide/IdeListMineCommand.php +++ b/src/Command/Ide/IdeListMineCommand.php @@ -16,9 +16,6 @@ #[AsCommand(name: 'ide:list:mine', description: 'List Cloud IDEs belonging to you')] class IdeListMineCommand extends IdeCommandBase { - protected function configure(): void { - } - protected function execute(InputInterface $input, OutputInterface $output): int { $acquiaCloudClient = $this->cloudApiClientService->getClient(); $ides = new Ides($acquiaCloudClient); diff --git a/src/Command/Self/ClearCacheCommand.php b/src/Command/Self/ClearCacheCommand.php index 42b20886a..9c48672c7 100644 --- a/src/Command/Self/ClearCacheCommand.php +++ b/src/Command/Self/ClearCacheCommand.php @@ -15,9 +15,6 @@ #[AsCommand(name: 'self:clear-caches', description: 'Clears local Acquia CLI caches', aliases: ['cc', 'cr'])] class ClearCacheCommand extends CommandBase { - protected function configure(): void { - } - protected function execute(InputInterface $input, OutputInterface $output): int { self::clearCaches(); $output->writeln('Acquia CLI caches were cleared.'); diff --git a/src/Command/Self/TelemetryCommand.php b/src/Command/Self/TelemetryCommand.php index 9c6e73a1a..25b778b95 100644 --- a/src/Command/Self/TelemetryCommand.php +++ b/src/Command/Self/TelemetryCommand.php @@ -18,9 +18,6 @@ protected function commandRequiresAuthentication(): bool { return FALSE; } - protected function configure(): void { - } - protected function execute(InputInterface $input, OutputInterface $output): int { $datastore = $this->datastoreCloud; if ($datastore->get(DataStoreContract::SEND_TELEMETRY)) { diff --git a/src/Command/Self/TelemetryDisableCommand.php b/src/Command/Self/TelemetryDisableCommand.php index 569857544..32f3baf36 100644 --- a/src/Command/Self/TelemetryDisableCommand.php +++ b/src/Command/Self/TelemetryDisableCommand.php @@ -18,9 +18,6 @@ protected function commandRequiresAuthentication(): bool { return FALSE; } - protected function configure(): void { - } - protected function execute(InputInterface $input, OutputInterface $output): int { $datastore = $this->datastoreCloud; $datastore->set(DataStoreContract::SEND_TELEMETRY, FALSE); diff --git a/src/Command/Self/TelemetryEnableCommand.php b/src/Command/Self/TelemetryEnableCommand.php index e409a8786..11b221cb7 100644 --- a/src/Command/Self/TelemetryEnableCommand.php +++ b/src/Command/Self/TelemetryEnableCommand.php @@ -18,9 +18,6 @@ protected function commandRequiresAuthentication(): bool { return FALSE; } - protected function configure(): void { - } - protected function execute(InputInterface $input, OutputInterface $output): int { $datastore = $this->datastoreCloud; $datastore->set(DataStoreContract::SEND_TELEMETRY, TRUE); diff --git a/src/Command/Ssh/SshKeyListCommand.php b/src/Command/Ssh/SshKeyListCommand.php index b7ece93eb..984980304 100644 --- a/src/Command/Ssh/SshKeyListCommand.php +++ b/src/Command/Ssh/SshKeyListCommand.php @@ -14,9 +14,6 @@ #[AsCommand(name: 'ssh-key:list', description: 'List your local and remote SSH keys')] class SshKeyListCommand extends SshKeyCommandBase { - protected function configure(): void { - } - protected function execute(InputInterface $input, OutputInterface $output): int { $acquiaCloudClient = $this->cloudApiClientService->getClient(); $sshKeys = new SshKeys($acquiaCloudClient); From c31353b3cc6d590ece381dc16d6bd3e415ff7ef1 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 28 Nov 2023 09:11:14 -0800 Subject: [PATCH 08/12] convert requires auth --- src/Attribute/RequireAuth.php | 13 +++++++++++++ src/Command/Acsf/AcsfApiBaseCommand.php | 4 +++- src/Command/Acsf/AcsfListCommand.php | 2 ++ src/Command/Acsf/AcsfListCommandBase.php | 8 -------- src/Command/Api/ApiBaseCommand.php | 2 ++ src/Command/Api/ApiListCommand.php | 2 ++ src/Command/App/AppOpenCommand.php | 2 ++ src/Command/App/AppVcsInfo.php | 2 ++ src/Command/App/LinkCommand.php | 2 ++ src/Command/App/LogTailCommand.php | 2 ++ src/Command/App/NewCommand.php | 4 ---- src/Command/App/NewFromDrupal7Command.php | 4 ---- src/Command/App/TaskWaitCommand.php | 2 ++ src/Command/App/UnlinkCommand.php | 4 ---- src/Command/Archive/ArchiveExportCommand.php | 2 ++ src/Command/Auth/AuthAcsfLoginCommand.php | 4 ---- src/Command/Auth/AuthAcsfLogoutCommand.php | 4 ---- src/Command/Auth/AuthLoginCommand.php | 4 ---- src/Command/Auth/AuthLogoutCommand.php | 4 ---- .../CodeStudio/CodeStudioPhpVersionCommand.php | 2 ++ .../CodeStudioPipelinesMigrateCommand.php | 4 ---- .../CodeStudio/CodeStudioWizardCommand.php | 4 ---- src/Command/CommandBase.php | 15 +++++---------- src/Command/DocsCommand.php | 4 ---- .../Email/ConfigurePlatformEmailCommand.php | 2 ++ .../Email/EmailInfoForSubscriptionCommand.php | 2 ++ src/Command/Env/EnvCertCreateCommand.php | 2 ++ src/Command/Env/EnvCopyCronCommand.php | 2 ++ src/Command/Env/EnvCreateCommand.php | 2 ++ src/Command/Env/EnvDeleteCommand.php | 2 ++ src/Command/Env/EnvMirrorCommand.php | 2 ++ src/Command/Ide/IdeCreateCommand.php | 2 ++ src/Command/Ide/IdeDeleteCommand.php | 2 ++ src/Command/Ide/IdeInfoCommand.php | 2 ++ src/Command/Ide/IdeListCommand.php | 2 ++ src/Command/Ide/IdeListMineCommand.php | 2 ++ src/Command/Ide/IdeOpenCommand.php | 2 ++ src/Command/Ide/IdePhpVersionCommand.php | 9 --------- src/Command/Ide/IdeServiceRestartCommand.php | 4 ---- src/Command/Ide/IdeServiceStartCommand.php | 4 ---- src/Command/Ide/IdeServiceStopCommand.php | 4 ---- src/Command/Ide/IdeShareCommand.php | 4 ---- src/Command/Ide/IdeXdebugToggleCommand.php | 4 ---- .../Ide/Wizard/IdeWizardCreateSshKeyCommand.php | 2 ++ .../Ide/Wizard/IdeWizardDeleteSshKeyCommand.php | 2 ++ src/Command/Pull/PullCodeCommand.php | 2 ++ src/Command/Pull/PullCommand.php | 2 ++ src/Command/Pull/PullDatabaseCommand.php | 2 ++ src/Command/Pull/PullFilesCommand.php | 2 ++ src/Command/Pull/PullScriptsCommand.php | 4 ---- src/Command/Push/PushArtifactCommand.php | 4 ---- src/Command/Push/PushCodeCommand.php | 2 ++ src/Command/Push/PushDatabaseCommand.php | 2 ++ src/Command/Push/PushFilesCommand.php | 2 ++ src/Command/Remote/AliasListCommand.php | 2 ++ src/Command/Remote/AliasesDownloadCommand.php | 2 ++ src/Command/Remote/DrushCommand.php | 2 ++ src/Command/Remote/SshCommand.php | 2 ++ src/Command/Self/ClearCacheCommand.php | 2 ++ src/Command/Self/ListCommand.php | 4 ---- src/Command/Self/MakeDocsCommand.php | 2 ++ src/Command/Self/TelemetryCommand.php | 4 ---- src/Command/Self/TelemetryDisableCommand.php | 4 ---- src/Command/Self/TelemetryEnableCommand.php | 4 ---- src/Command/Ssh/SshKeyCreateCommand.php | 2 ++ src/Command/Ssh/SshKeyCreateUploadCommand.php | 2 ++ src/Command/Ssh/SshKeyDeleteCommand.php | 2 ++ src/Command/Ssh/SshKeyInfoCommand.php | 2 ++ src/Command/Ssh/SshKeyListCommand.php | 2 ++ src/Command/Ssh/SshKeyUploadCommand.php | 2 ++ src/Command/WizardCommandBase.php | 4 +++- 71 files changed, 112 insertions(+), 113 deletions(-) create mode 100644 src/Attribute/RequireAuth.php diff --git a/src/Attribute/RequireAuth.php b/src/Attribute/RequireAuth.php new file mode 100644 index 000000000..af6ca0c80 --- /dev/null +++ b/src/Attribute/RequireAuth.php @@ -0,0 +1,13 @@ +commandRequiresAuthentication() && !$this->cloudApiClientService->isMachineAuthenticated()) { + $reflectionClass = new \ReflectionClass($this); + if ($reflectionClass->getAttributes(RequireAuth::class) && !$this->cloudApiClientService->isMachineAuthenticated()) { throw new AcquiaCliException('This machine is not yet authenticated with the Acquia Cloud Site Factory. Run `acli auth:acsf-login`'); } } diff --git a/src/Command/Acsf/AcsfListCommand.php b/src/Command/Acsf/AcsfListCommand.php index ee673952c..fad519fe0 100644 --- a/src/Command/Acsf/AcsfListCommand.php +++ b/src/Command/Acsf/AcsfListCommand.php @@ -4,8 +4,10 @@ namespace Acquia\Cli\Command\Acsf; +use Acquia\Cli\Attribute\RequireAuth; use Symfony\Component\Console\Attribute\AsCommand; +#[RequireAuth] #[AsCommand(name: 'acsf:list', description: 'List all Acquia Cloud Site Factory commands', aliases: ['acsf'])] class AcsfListCommand extends AcsfListCommandBase { diff --git a/src/Command/Acsf/AcsfListCommandBase.php b/src/Command/Acsf/AcsfListCommandBase.php index 25cdd9743..6da2bdbab 100644 --- a/src/Command/Acsf/AcsfListCommandBase.php +++ b/src/Command/Acsf/AcsfListCommandBase.php @@ -17,14 +17,6 @@ public function setNamespace(string $namespace): void { $this->namespace = $namespace; } - /** - * Indicates whether the command requires the machine to be authenticated with the Cloud Platform. - */ - protected function commandRequiresAuthentication(): bool { - // Assume commands require authentication unless they opt out by overriding this method. - return FALSE; - } - protected function execute(InputInterface $input, OutputInterface $output): int { $commands = $this->getApplication()->all(); foreach ($commands as $command) { diff --git a/src/Command/Api/ApiBaseCommand.php b/src/Command/Api/ApiBaseCommand.php index 39f0f4da8..f9b121153 100644 --- a/src/Command/Api/ApiBaseCommand.php +++ b/src/Command/Api/ApiBaseCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Api; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use AcquiaCloudApi\Connector\Client; use AcquiaCloudApi\Exception\ApiErrorException; @@ -21,6 +22,7 @@ use Symfony\Component\Validator\Exception\ValidatorException; use Symfony\Component\Validator\Validation; +#[RequireAuth] #[AsCommand(name: 'api:base')] class ApiBaseCommand extends CommandBase { diff --git a/src/Command/Api/ApiListCommand.php b/src/Command/Api/ApiListCommand.php index ca76c5c7a..44bb80f6e 100644 --- a/src/Command/Api/ApiListCommand.php +++ b/src/Command/Api/ApiListCommand.php @@ -4,8 +4,10 @@ namespace Acquia\Cli\Command\Api; +use Acquia\Cli\Attribute\RequireAuth; use Symfony\Component\Console\Attribute\AsCommand; +#[RequireAuth] #[AsCommand(name: 'api:list', description: 'List all API commands', aliases: ['api'])] class ApiListCommand extends ApiListCommandBase { diff --git a/src/Command/App/AppOpenCommand.php b/src/Command/App/AppOpenCommand.php index 16862b49d..84ed752ec 100644 --- a/src/Command/App/AppOpenCommand.php +++ b/src/Command/App/AppOpenCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\App; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use Acquia\Cli\Exception\AcquiaCliException; use Symfony\Component\Console\Attribute\AsCommand; @@ -11,6 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'app:open', description: 'Opens your browser to view a given Cloud application', aliases: ['open', 'o'])] class AppOpenCommand extends CommandBase { diff --git a/src/Command/App/AppVcsInfo.php b/src/Command/App/AppVcsInfo.php index 94d46cd88..768f72522 100644 --- a/src/Command/App/AppVcsInfo.php +++ b/src/Command/App/AppVcsInfo.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\App; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use Acquia\Cli\Exception\AcquiaCliException; use AcquiaCloudApi\Endpoints\Code; @@ -14,6 +15,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'app:vcs:info', description: 'Get all branches and tags of the application with the deployment status')] class AppVcsInfo extends CommandBase { diff --git a/src/Command/App/LinkCommand.php b/src/Command/App/LinkCommand.php index 82f844f5b..0c8f854b1 100644 --- a/src/Command/App/LinkCommand.php +++ b/src/Command/App/LinkCommand.php @@ -4,12 +4,14 @@ namespace Acquia\Cli\Command\App; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'app:link', description: 'Associate your project with a Cloud Platform application', aliases: ['link'])] class LinkCommand extends CommandBase { diff --git a/src/Command/App/LogTailCommand.php b/src/Command/App/LogTailCommand.php index 69f6c5818..602cbaf40 100644 --- a/src/Command/App/LogTailCommand.php +++ b/src/Command/App/LogTailCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\App; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use AcquiaCloudApi\Endpoints\Logs; use Symfony\Component\Console\Attribute\AsCommand; @@ -11,6 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'app:log:tail', description: 'Tail the logs from your environments', aliases: ['tail', 'log:tail'])] class LogTailCommand extends CommandBase { diff --git a/src/Command/App/NewCommand.php b/src/Command/App/NewCommand.php index 6d1670613..3f6db4ac6 100644 --- a/src/Command/App/NewCommand.php +++ b/src/Command/App/NewCommand.php @@ -64,10 +64,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int return Command::SUCCESS; } - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - private function createNextJsProject(string $dir): void { $process = $this->localMachineHelper->execute([ 'npx', diff --git a/src/Command/App/NewFromDrupal7Command.php b/src/Command/App/NewFromDrupal7Command.php index f26bd8727..b81a7bde6 100644 --- a/src/Command/App/NewFromDrupal7Command.php +++ b/src/Command/App/NewFromDrupal7Command.php @@ -214,10 +214,6 @@ function (mixed $path): string { return Command::SUCCESS; } - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - private function initializeGitRepository(string $dir): void { if ($this->localMachineHelper->getFilesystem()->exists(Path::join($dir, '.git'))) { $this->logger->debug('.git directory detected, skipping Git repo initialization'); diff --git a/src/Command/App/TaskWaitCommand.php b/src/Command/App/TaskWaitCommand.php index 6d596d6f6..c6f10a988 100644 --- a/src/Command/App/TaskWaitCommand.php +++ b/src/Command/App/TaskWaitCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\App; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; @@ -11,6 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'app:task-wait', description: 'Wait for a task to complete')] class TaskWaitCommand extends CommandBase { diff --git a/src/Command/App/UnlinkCommand.php b/src/Command/App/UnlinkCommand.php index eaaff2a75..b4b1146b9 100644 --- a/src/Command/App/UnlinkCommand.php +++ b/src/Command/App/UnlinkCommand.php @@ -14,10 +14,6 @@ #[AsCommand(name: 'app:unlink', description: 'Remove local association between your project and a Cloud Platform application', aliases: ['unlink'])] class UnlinkCommand extends CommandBase { - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function execute(InputInterface $input, OutputInterface $output): int { $this->validateCwdIsValidDrupalProject(); diff --git a/src/Command/Archive/ArchiveExportCommand.php b/src/Command/Archive/ArchiveExportCommand.php index 0644f2ed5..c8239636d 100644 --- a/src/Command/Archive/ArchiveExportCommand.php +++ b/src/Command/Archive/ArchiveExportCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Archive; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use Acquia\Cli\Exception\AcquiaCliException; use Acquia\Cli\Output\Checklist; @@ -18,6 +19,7 @@ use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Path; +#[RequireAuth] #[AsCommand(name: 'archive:export', description: 'Export an archive of the Drupal application including code, files, and database')] class ArchiveExportCommand extends CommandBase { diff --git a/src/Command/Auth/AuthAcsfLoginCommand.php b/src/Command/Auth/AuthAcsfLoginCommand.php index 391e11305..e1b40d078 100644 --- a/src/Command/Auth/AuthAcsfLoginCommand.php +++ b/src/Command/Auth/AuthAcsfLoginCommand.php @@ -21,10 +21,6 @@ protected function configure(): void { ->addOption('factory-url', 'f', InputOption::VALUE_REQUIRED, "Your Site Factory URL"); } - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function execute(InputInterface $input, OutputInterface $output): int { if ($input->getOption('factory-url')) { $factoryUrl = $input->getOption('factory-url'); diff --git a/src/Command/Auth/AuthAcsfLogoutCommand.php b/src/Command/Auth/AuthAcsfLogoutCommand.php index 1d865742d..809438013 100644 --- a/src/Command/Auth/AuthAcsfLogoutCommand.php +++ b/src/Command/Auth/AuthAcsfLogoutCommand.php @@ -13,10 +13,6 @@ #[AsCommand(name: 'auth:acsf-logout', description: 'Remove your Site Factory key and secret from your local machine.')] class AuthAcsfLogoutCommand extends CommandBase { - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function execute(InputInterface $input, OutputInterface $output): int { $factories = $this->datastoreCloud->get('acsf_factories'); if (empty($factories)) { diff --git a/src/Command/Auth/AuthLoginCommand.php b/src/Command/Auth/AuthLoginCommand.php index b7dba708b..78f9c676f 100644 --- a/src/Command/Auth/AuthLoginCommand.php +++ b/src/Command/Auth/AuthLoginCommand.php @@ -20,10 +20,6 @@ protected function configure(): void { ->addOption('secret', 's', InputOption::VALUE_REQUIRED, 'Your Cloud API secret'); } - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function execute(InputInterface $input, OutputInterface $output): int { if ($this->cloudApiClientService->isMachineAuthenticated()) { $answer = $this->io->confirm('Your machine has already been authenticated with the Cloud Platform API, would you like to re-authenticate?'); diff --git a/src/Command/Auth/AuthLogoutCommand.php b/src/Command/Auth/AuthLogoutCommand.php index 68f59a922..c5ac2faa2 100644 --- a/src/Command/Auth/AuthLogoutCommand.php +++ b/src/Command/Auth/AuthLogoutCommand.php @@ -13,10 +13,6 @@ #[AsCommand(name: 'auth:logout', description: 'Remove Cloud API key and secret from local machine.', aliases: ['logout'])] class AuthLogoutCommand extends CommandBase { - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function execute(InputInterface $input, OutputInterface $output): int { if ($this->cloudApiClientService->isMachineAuthenticated()) { $answer = $this->io->confirm('Are you sure you\'d like to unset the Acquia Cloud API key for Acquia CLI?'); diff --git a/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php b/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php index 56b15e84d..9db4c75d2 100644 --- a/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php +++ b/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\CodeStudio; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use Gitlab\Exception\RuntimeException; use Symfony\Component\Console\Attribute\AsCommand; @@ -11,6 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'codestudio:php-version', description: 'Change the PHP version in Code Studio')] class CodeStudioPhpVersionCommand extends CommandBase { diff --git a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php index 5d0df796a..16e085a46 100644 --- a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php +++ b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php @@ -74,10 +74,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int return Command::SUCCESS; } - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - /** * Check whether wizard command is executed by checking the env variable of codestudio project. * diff --git a/src/Command/CodeStudio/CodeStudioWizardCommand.php b/src/Command/CodeStudio/CodeStudioWizardCommand.php index 45fc4e3f0..7ada08dca 100644 --- a/src/Command/CodeStudio/CodeStudioWizardCommand.php +++ b/src/Command/CodeStudio/CodeStudioWizardCommand.php @@ -115,10 +115,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int return Command::SUCCESS; } - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - /** * @param array $project * @return array|null diff --git a/src/Command/CommandBase.php b/src/Command/CommandBase.php index bff811383..098164095 100644 --- a/src/Command/CommandBase.php +++ b/src/Command/CommandBase.php @@ -5,6 +5,7 @@ namespace Acquia\Cli\Command; use Acquia\Cli\ApiCredentialsInterface; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\CloudApi\ClientService; use Acquia\Cli\Command\Ssh\SshKeyCommandBase; use Acquia\Cli\DataStore\AcquiaCliDatastore; @@ -112,7 +113,8 @@ public function __construct( $this->setLocalDbName(); $this->setLocalDbHost(); parent::__construct(); - if ($this->commandRequiresAuthentication()) { + $reflectionClass = new \ReflectionClass($this); + if ($reflectionClass->getAttributes(RequireAuth::class)) { $this->appendHelp('This command requires authentication via the Cloud Platform API.'); } if ($this->commandRequiresDatabase()) { @@ -301,14 +303,6 @@ protected function acceptSite(): self { return $this; } - /** - * Indicates whether the command requires the machine to be authenticated with the Cloud Platform. - */ - protected function commandRequiresAuthentication(): bool { - // Assume commands require authentication unless they opt out by overriding this method. - return TRUE; - } - protected function commandRequiresDatabase(): bool { return FALSE; } @@ -1477,7 +1471,8 @@ protected function validateEnvironmentUuid(mixed $envUuidArgument, mixed $argume } protected function checkAuthentication(): void { - if ($this->commandRequiresAuthentication() && !$this->cloudApiClientService->isMachineAuthenticated()) { + $reflectionClass = new \ReflectionClass($this); + if ($reflectionClass->getAttributes(RequireAuth::class) && !$this->cloudApiClientService->isMachineAuthenticated()) { throw new AcquiaCliException('This machine is not yet authenticated with the Cloud Platform. Run `acli auth:login`'); } } diff --git a/src/Command/DocsCommand.php b/src/Command/DocsCommand.php index e7c06be4f..a1a2e0f33 100644 --- a/src/Command/DocsCommand.php +++ b/src/Command/DocsCommand.php @@ -20,10 +20,6 @@ protected function configure(): void { ->addUsage('acli'); } - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function execute(InputInterface $input, OutputInterface $output): int { $acquiaProducts = [ 'Acquia CLI' => [ diff --git a/src/Command/Email/ConfigurePlatformEmailCommand.php b/src/Command/Email/ConfigurePlatformEmailCommand.php index fb8bc5d81..9d35a78a5 100644 --- a/src/Command/Email/ConfigurePlatformEmailCommand.php +++ b/src/Command/Email/ConfigurePlatformEmailCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Email; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use Acquia\Cli\Exception\AcquiaCliException; use Acquia\Cli\Output\Checklist; @@ -25,6 +26,7 @@ use Symfony\Component\Validator\Validation; use Symfony\Component\Yaml\Yaml; +#[RequireAuth] #[AsCommand(name: 'email:configure', description: 'Configure Platform email for one or more applications', aliases: ['ec'])] class ConfigurePlatformEmailCommand extends CommandBase { diff --git a/src/Command/Email/EmailInfoForSubscriptionCommand.php b/src/Command/Email/EmailInfoForSubscriptionCommand.php index 2ee22f65b..f938083bc 100644 --- a/src/Command/Email/EmailInfoForSubscriptionCommand.php +++ b/src/Command/Email/EmailInfoForSubscriptionCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Email; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use AcquiaCloudApi\Connector\Client; use AcquiaCloudApi\Response\SubscriptionResponse; @@ -18,6 +19,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'email:info', description: 'Print information related to Platform Email set up in a subscription.')] class EmailInfoForSubscriptionCommand extends CommandBase { diff --git a/src/Command/Env/EnvCertCreateCommand.php b/src/Command/Env/EnvCertCreateCommand.php index 794545b84..ab1a271a1 100644 --- a/src/Command/Env/EnvCertCreateCommand.php +++ b/src/Command/Env/EnvCertCreateCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Env; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use AcquiaCloudApi\Endpoints\SslCertificates; use Symfony\Component\Console\Attribute\AsCommand; @@ -13,6 +14,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'env:certificate-create', description: 'Install an SSL certificate.')] class EnvCertCreateCommand extends CommandBase { diff --git a/src/Command/Env/EnvCopyCronCommand.php b/src/Command/Env/EnvCopyCronCommand.php index 4e2a25e64..34069020b 100644 --- a/src/Command/Env/EnvCopyCronCommand.php +++ b/src/Command/Env/EnvCopyCronCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Env; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use AcquiaCloudApi\Endpoints\Crons; use Exception; @@ -13,6 +14,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'env:cron-copy', description: 'Copy all cron tasks from one Acquia Cloud Platform environment to another')] class EnvCopyCronCommand extends CommandBase { diff --git a/src/Command/Env/EnvCreateCommand.php b/src/Command/Env/EnvCreateCommand.php index 079e4bc0d..cbfa803b6 100644 --- a/src/Command/Env/EnvCreateCommand.php +++ b/src/Command/Env/EnvCreateCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Env; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use Acquia\Cli\Exception\AcquiaCliException; use Acquia\Cli\Output\Checklist; @@ -16,6 +17,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'env:create', description: 'Create a new Continuous Delivery Environment (CDE)')] class EnvCreateCommand extends CommandBase { diff --git a/src/Command/Env/EnvDeleteCommand.php b/src/Command/Env/EnvDeleteCommand.php index d58c28573..fb49ca72d 100644 --- a/src/Command/Env/EnvDeleteCommand.php +++ b/src/Command/Env/EnvDeleteCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Env; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use Acquia\Cli\Exception\AcquiaCliException; use AcquiaCloudApi\Endpoints\Environments; @@ -13,6 +14,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'env:delete', description: 'Delete a Continuous Delivery Environment (CDE)')] class EnvDeleteCommand extends CommandBase { diff --git a/src/Command/Env/EnvMirrorCommand.php b/src/Command/Env/EnvMirrorCommand.php index 00ecda511..7f2f1969f 100644 --- a/src/Command/Env/EnvMirrorCommand.php +++ b/src/Command/Env/EnvMirrorCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Env; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use Acquia\Cli\Output\Checklist; use AcquiaCloudApi\Connector\Client; @@ -17,6 +18,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'env:mirror', description: 'Makes one environment identical to another in terms of code, database, files, and configuration.')] class EnvMirrorCommand extends CommandBase { diff --git a/src/Command/Ide/IdeCreateCommand.php b/src/Command/Ide/IdeCreateCommand.php index fd2a2a9a5..503314a54 100644 --- a/src/Command/Ide/IdeCreateCommand.php +++ b/src/Command/Ide/IdeCreateCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Ide; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Helpers\LoopHelper; use Acquia\Cli\Output\Checklist; use AcquiaCloudApi\Endpoints\Account; @@ -20,6 +21,7 @@ use Symfony\Component\Validator\Exception\ValidatorException; use Symfony\Component\Validator\Validation; +#[RequireAuth] #[AsCommand(name: 'ide:create', description: 'Create a Cloud IDE')] class IdeCreateCommand extends IdeCommandBase { diff --git a/src/Command/Ide/IdeDeleteCommand.php b/src/Command/Ide/IdeDeleteCommand.php index b18f061eb..87723d9c9 100644 --- a/src/Command/Ide/IdeDeleteCommand.php +++ b/src/Command/Ide/IdeDeleteCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Ide; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Helpers\SshCommandTrait; use AcquiaCloudApi\Endpoints\Ides; use Symfony\Component\Console\Attribute\AsCommand; @@ -11,6 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'ide:delete', description: 'Delete a Cloud IDE')] class IdeDeleteCommand extends IdeCommandBase { diff --git a/src/Command/Ide/IdeInfoCommand.php b/src/Command/Ide/IdeInfoCommand.php index 56b76c4e4..543782243 100644 --- a/src/Command/Ide/IdeInfoCommand.php +++ b/src/Command/Ide/IdeInfoCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Ide; +use Acquia\Cli\Attribute\RequireAuth; use AcquiaCloudApi\Endpoints\Ides; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; @@ -11,6 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'ide:info', description: 'Print information about a Cloud IDE')] class IdeInfoCommand extends IdeCommandBase { diff --git a/src/Command/Ide/IdeListCommand.php b/src/Command/Ide/IdeListCommand.php index 9739f8403..532a1e88e 100644 --- a/src/Command/Ide/IdeListCommand.php +++ b/src/Command/Ide/IdeListCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Ide; +use Acquia\Cli\Attribute\RequireAuth; use AcquiaCloudApi\Endpoints\Ides; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; @@ -12,6 +13,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'ide:list:app', description: 'List available Cloud IDEs belonging to a given application', aliases: ['ide:list'])] class IdeListCommand extends IdeCommandBase { diff --git a/src/Command/Ide/IdeListMineCommand.php b/src/Command/Ide/IdeListMineCommand.php index 30c4972c9..39adf9243 100644 --- a/src/Command/Ide/IdeListMineCommand.php +++ b/src/Command/Ide/IdeListMineCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Ide; +use Acquia\Cli\Attribute\RequireAuth; use AcquiaCloudApi\Endpoints\Applications; use AcquiaCloudApi\Endpoints\Ides; use Symfony\Component\Console\Attribute\AsCommand; @@ -13,6 +14,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'ide:list:mine', description: 'List Cloud IDEs belonging to you')] class IdeListMineCommand extends IdeCommandBase { diff --git a/src/Command/Ide/IdeOpenCommand.php b/src/Command/Ide/IdeOpenCommand.php index c40f24a96..29d266afd 100644 --- a/src/Command/Ide/IdeOpenCommand.php +++ b/src/Command/Ide/IdeOpenCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Ide; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\DrupalEnvironmentDetector\AcquiaDrupalEnvironmentDetector; use AcquiaCloudApi\Endpoints\Ides; use Symfony\Component\Console\Attribute\AsCommand; @@ -11,6 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'ide:open', description: 'Open a Cloud IDE in your browser')] class IdeOpenCommand extends IdeCommandBase { diff --git a/src/Command/Ide/IdePhpVersionCommand.php b/src/Command/Ide/IdePhpVersionCommand.php index b68e99877..9ef3866c8 100644 --- a/src/Command/Ide/IdePhpVersionCommand.php +++ b/src/Command/Ide/IdePhpVersionCommand.php @@ -17,15 +17,6 @@ class IdePhpVersionCommand extends IdeCommandBase { private string $idePhpFilePathPrefix; - /* - * @param \Symfony\Component\Console\Input\InputInterface $input - * - * @return bool - */ - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function configure(): void { $this ->addArgument('version', InputArgument::REQUIRED, 'The PHP version') diff --git a/src/Command/Ide/IdeServiceRestartCommand.php b/src/Command/Ide/IdeServiceRestartCommand.php index 0e41a74ea..168837feb 100644 --- a/src/Command/Ide/IdeServiceRestartCommand.php +++ b/src/Command/Ide/IdeServiceRestartCommand.php @@ -17,10 +17,6 @@ #[AsCommand(name: 'ide:service-restart', description: 'Restart a service in the Cloud IDE')] class IdeServiceRestartCommand extends IdeCommandBase { - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function configure(): void { $this ->addArgument('service', InputArgument::REQUIRED, 'The name of the service to restart') diff --git a/src/Command/Ide/IdeServiceStartCommand.php b/src/Command/Ide/IdeServiceStartCommand.php index e93eb0308..4b6ce178b 100644 --- a/src/Command/Ide/IdeServiceStartCommand.php +++ b/src/Command/Ide/IdeServiceStartCommand.php @@ -17,10 +17,6 @@ #[AsCommand(name: 'ide:service-start', description: 'Start a service in the Cloud IDE')] class IdeServiceStartCommand extends IdeCommandBase { - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function configure(): void { $this ->addArgument('service', InputArgument::REQUIRED, 'The name of the service to start') diff --git a/src/Command/Ide/IdeServiceStopCommand.php b/src/Command/Ide/IdeServiceStopCommand.php index 6e671764a..f2e56944b 100644 --- a/src/Command/Ide/IdeServiceStopCommand.php +++ b/src/Command/Ide/IdeServiceStopCommand.php @@ -17,10 +17,6 @@ #[AsCommand(name: 'ide:service-stop', description: 'Stop a service in the Cloud IDE')] class IdeServiceStopCommand extends IdeCommandBase { - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function configure(): void { $this ->addArgument('service', InputArgument::REQUIRED, 'The name of the service to stop') diff --git a/src/Command/Ide/IdeShareCommand.php b/src/Command/Ide/IdeShareCommand.php index f200cb7fd..e95393485 100644 --- a/src/Command/Ide/IdeShareCommand.php +++ b/src/Command/Ide/IdeShareCommand.php @@ -22,10 +22,6 @@ class IdeShareCommand extends CommandBase { */ private array $shareCodeFilepaths; - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function configure(): void { $this ->addOption('regenerate', '', InputOption::VALUE_NONE, 'regenerate the share code') diff --git a/src/Command/Ide/IdeXdebugToggleCommand.php b/src/Command/Ide/IdeXdebugToggleCommand.php index 48f8f8eca..ef1b0c391 100644 --- a/src/Command/Ide/IdeXdebugToggleCommand.php +++ b/src/Command/Ide/IdeXdebugToggleCommand.php @@ -16,10 +16,6 @@ class IdeXdebugToggleCommand extends IdeCommandBase { private ?bool $xDebugEnabled; - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function configure(): void { $this ->setHidden(!AcquiaDrupalEnvironmentDetector::isAhIdeEnv()); diff --git a/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php b/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php index c44d0f09a..e1564c0ba 100644 --- a/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php +++ b/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Ide\Wizard; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use Acquia\Cli\Output\Checklist; use AcquiaCloudApi\Endpoints\Account; @@ -12,6 +13,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'ide:wizard:ssh-key:create-upload', description: 'Wizard to perform first time setup tasks within an IDE', aliases: ['ide:wizard'])] class IdeWizardCreateSshKeyCommand extends IdeWizardCommandBase { diff --git a/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php b/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php index b189e85d5..4ee5fac07 100644 --- a/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php +++ b/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Ide\Wizard; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use Acquia\Cli\Exception\AcquiaCliException; use Acquia\Cli\Helpers\SshCommandTrait; @@ -12,6 +13,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'ide:wizard:ssh-key:delete', description: 'Wizard to delete SSH key for IDE from Cloud')] class IdeWizardDeleteSshKeyCommand extends IdeWizardCommandBase { diff --git a/src/Command/Pull/PullCodeCommand.php b/src/Command/Pull/PullCodeCommand.php index 190fcc57b..6ebfd322c 100644 --- a/src/Command/Pull/PullCodeCommand.php +++ b/src/Command/Pull/PullCodeCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Pull; +use Acquia\Cli\Attribute\RequireAuth; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; @@ -11,6 +12,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'pull:code', description: 'Copy code from a Cloud Platform environment')] class PullCodeCommand extends PullCommandBase { diff --git a/src/Command/Pull/PullCommand.php b/src/Command/Pull/PullCommand.php index 9b75566b8..8ee900e61 100644 --- a/src/Command/Pull/PullCommand.php +++ b/src/Command/Pull/PullCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Pull; +use Acquia\Cli\Attribute\RequireAuth; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; @@ -11,6 +12,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'pull:all', description: 'Copy code, database, and files from a Cloud Platform environment', aliases: ['refresh', 'pull'])] class PullCommand extends PullCommandBase { diff --git a/src/Command/Pull/PullDatabaseCommand.php b/src/Command/Pull/PullDatabaseCommand.php index 664668b29..4387b08ff 100644 --- a/src/Command/Pull/PullDatabaseCommand.php +++ b/src/Command/Pull/PullDatabaseCommand.php @@ -4,12 +4,14 @@ namespace Acquia\Cli\Command\Pull; +use Acquia\Cli\Attribute\RequireAuth; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'pull:database', description: 'Import database backup from a Cloud Platform environment', aliases: ['pull:db'])] class PullDatabaseCommand extends PullCommandBase { diff --git a/src/Command/Pull/PullFilesCommand.php b/src/Command/Pull/PullFilesCommand.php index 2405e2d9f..bdc9c0c6a 100644 --- a/src/Command/Pull/PullFilesCommand.php +++ b/src/Command/Pull/PullFilesCommand.php @@ -4,11 +4,13 @@ namespace Acquia\Cli\Command\Pull; +use Acquia\Cli\Attribute\RequireAuth; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'pull:files', description: 'Copy Drupal public files from a Cloud Platform environment to your local environment')] class PullFilesCommand extends PullCommandBase { diff --git a/src/Command/Pull/PullScriptsCommand.php b/src/Command/Pull/PullScriptsCommand.php index 5080ef9f6..1821e505a 100644 --- a/src/Command/Pull/PullScriptsCommand.php +++ b/src/Command/Pull/PullScriptsCommand.php @@ -19,10 +19,6 @@ protected function configure(): void { ->addOption('dir', NULL, InputArgument::OPTIONAL, 'The directory containing the Drupal project to be refreshed'); } - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function execute(InputInterface $input, OutputInterface $output): int { $this->executeAllScripts($input, $this->getOutputCallback($output, $this->checklist)); diff --git a/src/Command/Push/PushArtifactCommand.php b/src/Command/Push/PushArtifactCommand.php index ed6f589db..da10b69d6 100644 --- a/src/Command/Push/PushArtifactCommand.php +++ b/src/Command/Push/PushArtifactCommand.php @@ -60,10 +60,6 @@ protected function configure(): void { ->addUsage('--destination-git-urls=example@svn-1.prod.hosting.acquia.com:example.git --destination-git-branch=main-build'); } - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function execute(InputInterface $input, OutputInterface $output): int { $this->setDirAndRequireProjectCwd($input); if ($input->getOption('no-clone')) { diff --git a/src/Command/Push/PushCodeCommand.php b/src/Command/Push/PushCodeCommand.php index b348cb316..c53ffcdc1 100644 --- a/src/Command/Push/PushCodeCommand.php +++ b/src/Command/Push/PushCodeCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Push; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\Pull\PullCommandBase; use Acquia\DrupalEnvironmentDetector\AcquiaDrupalEnvironmentDetector; use Symfony\Component\Console\Attribute\AsCommand; @@ -11,6 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'push:code', description: 'Push code from your IDE to a Cloud Platform environment')] class PushCodeCommand extends PullCommandBase { diff --git a/src/Command/Push/PushDatabaseCommand.php b/src/Command/Push/PushDatabaseCommand.php index 603529404..f4e98cc78 100644 --- a/src/Command/Push/PushDatabaseCommand.php +++ b/src/Command/Push/PushDatabaseCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Push; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\Pull\PullCommandBase; use Acquia\Cli\Exception\AcquiaCliException; use Acquia\Cli\Output\Checklist; @@ -14,6 +15,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'push:database', description: 'Push a database from your local environment to a Cloud Platform environment', aliases: ['push:db'])] class PushDatabaseCommand extends PullCommandBase { diff --git a/src/Command/Push/PushFilesCommand.php b/src/Command/Push/PushFilesCommand.php index 7a575df85..d001803bd 100644 --- a/src/Command/Push/PushFilesCommand.php +++ b/src/Command/Push/PushFilesCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Push; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\Pull\PullCommandBase; use Acquia\Cli\Output\Checklist; use AcquiaCloudApi\Response\EnvironmentResponse; @@ -12,6 +13,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'push:files', description: 'Copy Drupal public files from your local environment to a Cloud Platform environment')] class PushFilesCommand extends PullCommandBase { diff --git a/src/Command/Remote/AliasListCommand.php b/src/Command/Remote/AliasListCommand.php index f541318c9..2a2aac601 100644 --- a/src/Command/Remote/AliasListCommand.php +++ b/src/Command/Remote/AliasListCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Remote; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use AcquiaCloudApi\Endpoints\Applications; use AcquiaCloudApi\Endpoints\Environments; @@ -13,6 +14,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'remote:aliases:list', description: 'List all aliases for the Cloud Platform environments', aliases: ['aliases', 'sa'])] class AliasListCommand extends CommandBase { diff --git a/src/Command/Remote/AliasesDownloadCommand.php b/src/Command/Remote/AliasesDownloadCommand.php index 6c12453f8..be471aefa 100644 --- a/src/Command/Remote/AliasesDownloadCommand.php +++ b/src/Command/Remote/AliasesDownloadCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Remote; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Exception\AcquiaCliException; use AcquiaCloudApi\Connector\Client; use AcquiaCloudApi\Endpoints\Account; @@ -20,6 +21,7 @@ /** * A command to proxy Drush commands on an environment using SSH. */ +#[RequireAuth] #[AsCommand(name: 'remote:aliases:download', description: 'Download Drush aliases for the Cloud Platform')] class AliasesDownloadCommand extends SshCommand { diff --git a/src/Command/Remote/DrushCommand.php b/src/Command/Remote/DrushCommand.php index ab5768ad9..f9b02393f 100644 --- a/src/Command/Remote/DrushCommand.php +++ b/src/Command/Remote/DrushCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Remote; +use Acquia\Cli\Attribute\RequireAuth; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -12,6 +13,7 @@ /** * A command to proxy Drush commands on an environment using SSH. */ +#[RequireAuth] #[AsCommand(name: 'remote:drush', description: 'Run a Drush command remotely on a application\'s environment', aliases: ['drush', 'dr'])] class DrushCommand extends SshBaseCommand { diff --git a/src/Command/Remote/SshCommand.php b/src/Command/Remote/SshCommand.php index 0c1022078..6ab2030d4 100644 --- a/src/Command/Remote/SshCommand.php +++ b/src/Command/Remote/SshCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Remote; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Exception\AcquiaCliException; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; @@ -13,6 +14,7 @@ /** * A command to proxy Drush commands on an environment using SSH. */ +#[RequireAuth] #[AsCommand(name: 'remote:ssh', description: 'Use SSH to open a shell or run a command in a Cloud Platform environment', aliases: ['ssh'])] class SshCommand extends SshBaseCommand { diff --git a/src/Command/Self/ClearCacheCommand.php b/src/Command/Self/ClearCacheCommand.php index 9c48672c7..657dfa665 100644 --- a/src/Command/Self/ClearCacheCommand.php +++ b/src/Command/Self/ClearCacheCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Self; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; @@ -12,6 +13,7 @@ use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Path; +#[RequireAuth] #[AsCommand(name: 'self:clear-caches', description: 'Clears local Acquia CLI caches', aliases: ['cc', 'cr'])] class ClearCacheCommand extends CommandBase { diff --git a/src/Command/Self/ListCommand.php b/src/Command/Self/ListCommand.php index de156fd91..ac6576702 100644 --- a/src/Command/Self/ListCommand.php +++ b/src/Command/Self/ListCommand.php @@ -15,10 +15,6 @@ #[AsCommand(name: 'list', description: NULL, aliases: ['self:list'])] class ListCommand extends \Symfony\Component\Console\Command\ListCommand { - protected function configure(): void { - parent::configure(); - } - protected function execute(InputInterface $input, OutputInterface $output): int { foreach (['api', 'acsf'] as $prefix) { if ($input->getArgument('namespace') !== $prefix) { diff --git a/src/Command/Self/MakeDocsCommand.php b/src/Command/Self/MakeDocsCommand.php index dbe3482ce..7a8373cda 100644 --- a/src/Command/Self/MakeDocsCommand.php +++ b/src/Command/Self/MakeDocsCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Self; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; @@ -11,6 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'self:make-docs', description: 'Generate documentation for all ACLI commands')] class MakeDocsCommand extends CommandBase { diff --git a/src/Command/Self/TelemetryCommand.php b/src/Command/Self/TelemetryCommand.php index 25b778b95..f18895ef4 100644 --- a/src/Command/Self/TelemetryCommand.php +++ b/src/Command/Self/TelemetryCommand.php @@ -14,10 +14,6 @@ #[AsCommand(name: 'self:telemetry:toggle', description: 'Toggle anonymous sharing of usage and performance data', aliases: ['telemetry'])] class TelemetryCommand extends CommandBase { - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function execute(InputInterface $input, OutputInterface $output): int { $datastore = $this->datastoreCloud; if ($datastore->get(DataStoreContract::SEND_TELEMETRY)) { diff --git a/src/Command/Self/TelemetryDisableCommand.php b/src/Command/Self/TelemetryDisableCommand.php index 32f3baf36..96c5d7a24 100644 --- a/src/Command/Self/TelemetryDisableCommand.php +++ b/src/Command/Self/TelemetryDisableCommand.php @@ -14,10 +14,6 @@ #[AsCommand(name: 'self:telemetry:disable', description: 'Disable anonymous sharing of usage and performance data', aliases: ['telemetry:disable'])] class TelemetryDisableCommand extends CommandBase { - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function execute(InputInterface $input, OutputInterface $output): int { $datastore = $this->datastoreCloud; $datastore->set(DataStoreContract::SEND_TELEMETRY, FALSE); diff --git a/src/Command/Self/TelemetryEnableCommand.php b/src/Command/Self/TelemetryEnableCommand.php index 11b221cb7..29bd4a51b 100644 --- a/src/Command/Self/TelemetryEnableCommand.php +++ b/src/Command/Self/TelemetryEnableCommand.php @@ -14,10 +14,6 @@ #[AsCommand(name: 'self:telemetry:enable', description: 'Enable anonymous sharing of usage and performance data', aliases: ['telemetry:enable'])] class TelemetryEnableCommand extends CommandBase { - protected function commandRequiresAuthentication(): bool { - return FALSE; - } - protected function execute(InputInterface $input, OutputInterface $output): int { $datastore = $this->datastoreCloud; $datastore->set(DataStoreContract::SEND_TELEMETRY, TRUE); diff --git a/src/Command/Ssh/SshKeyCreateCommand.php b/src/Command/Ssh/SshKeyCreateCommand.php index 3812bcf20..4e6ede3be 100644 --- a/src/Command/Ssh/SshKeyCreateCommand.php +++ b/src/Command/Ssh/SshKeyCreateCommand.php @@ -4,12 +4,14 @@ namespace Acquia\Cli\Command\Ssh; +use Acquia\Cli\Attribute\RequireAuth; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'ssh-key:create', description: 'Create an SSH key on your local machine')] class SshKeyCreateCommand extends SshKeyCommandBase { diff --git a/src/Command/Ssh/SshKeyCreateUploadCommand.php b/src/Command/Ssh/SshKeyCreateUploadCommand.php index 3d4eefba0..69f20a484 100644 --- a/src/Command/Ssh/SshKeyCreateUploadCommand.php +++ b/src/Command/Ssh/SshKeyCreateUploadCommand.php @@ -4,12 +4,14 @@ namespace Acquia\Cli\Command\Ssh; +use Acquia\Cli\Attribute\RequireAuth; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'ssh-key:create-upload', description: 'Create an SSH key on your local machine and upload it to the Cloud Platform')] class SshKeyCreateUploadCommand extends SshKeyCreateCommand { diff --git a/src/Command/Ssh/SshKeyDeleteCommand.php b/src/Command/Ssh/SshKeyDeleteCommand.php index 7beb057b9..fbae87e15 100644 --- a/src/Command/Ssh/SshKeyDeleteCommand.php +++ b/src/Command/Ssh/SshKeyDeleteCommand.php @@ -4,12 +4,14 @@ namespace Acquia\Cli\Command\Ssh; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Helpers\SshCommandTrait; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'ssh-key:delete', description: 'Delete an SSH key')] class SshKeyDeleteCommand extends SshKeyCommandBase { diff --git a/src/Command/Ssh/SshKeyInfoCommand.php b/src/Command/Ssh/SshKeyInfoCommand.php index 0316ca655..913be1609 100644 --- a/src/Command/Ssh/SshKeyInfoCommand.php +++ b/src/Command/Ssh/SshKeyInfoCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Ssh; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Exception\AcquiaCliException; use AcquiaCloudApi\Endpoints\SshKeys; use Symfony\Component\Console\Attribute\AsCommand; @@ -13,6 +14,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'ssh-key:info', description: 'Print information about an SSH key')] class SshKeyInfoCommand extends SshKeyCommandBase { diff --git a/src/Command/Ssh/SshKeyListCommand.php b/src/Command/Ssh/SshKeyListCommand.php index 984980304..59e54a938 100644 --- a/src/Command/Ssh/SshKeyListCommand.php +++ b/src/Command/Ssh/SshKeyListCommand.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command\Ssh; +use Acquia\Cli\Attribute\RequireAuth; use AcquiaCloudApi\Endpoints\SshKeys; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; @@ -11,6 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'ssh-key:list', description: 'List your local and remote SSH keys')] class SshKeyListCommand extends SshKeyCommandBase { diff --git a/src/Command/Ssh/SshKeyUploadCommand.php b/src/Command/Ssh/SshKeyUploadCommand.php index 3e47a732a..21c82d724 100644 --- a/src/Command/Ssh/SshKeyUploadCommand.php +++ b/src/Command/Ssh/SshKeyUploadCommand.php @@ -4,12 +4,14 @@ namespace Acquia\Cli\Command\Ssh; +use Acquia\Cli\Attribute\RequireAuth; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +#[RequireAuth] #[AsCommand(name: 'ssh-key:upload', description: 'Upload a local SSH key to the Cloud Platform')] class SshKeyUploadCommand extends SshKeyCommandBase { diff --git a/src/Command/WizardCommandBase.php b/src/Command/WizardCommandBase.php index a582bbc4f..3c3e4a662 100644 --- a/src/Command/WizardCommandBase.php +++ b/src/Command/WizardCommandBase.php @@ -4,6 +4,7 @@ namespace Acquia\Cli\Command; +use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\Ssh\SshKeyCommandBase; use Acquia\Cli\Exception\AcquiaCliException; use AcquiaCloudApi\Endpoints\SshKeys; @@ -16,7 +17,8 @@ abstract class WizardCommandBase extends SshKeyCommandBase { abstract protected function validateEnvironment(): void; protected function initialize(InputInterface $input, OutputInterface $output): void { - if ($this->commandRequiresAuthentication() && !$this->cloudApiClientService->isMachineAuthenticated()) { + $reflectionClass = new \ReflectionClass($this); + if ($reflectionClass->getAttributes(RequireAuth::class) && !$this->cloudApiClientService->isMachineAuthenticated()) { $commandName = 'auth:login'; $command = $this->getApplication()->find($commandName); $arguments = ['command' => $commandName]; From fa4c1afc47eb3a25704217b5d750178faa84683a Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 28 Nov 2023 09:46:21 -0800 Subject: [PATCH 09/12] mark commands final --- src/Command/Acsf/AcsfListCommand.php | 2 +- src/Command/Api/ApiListCommand.php | 2 +- src/Command/App/AppOpenCommand.php | 2 +- src/Command/App/LinkCommand.php | 2 +- src/Command/App/LogTailCommand.php | 2 +- src/Command/App/NewCommand.php | 2 +- src/Command/App/NewFromDrupal7Command.php | 2 +- src/Command/App/TaskWaitCommand.php | 2 +- src/Command/App/UnlinkCommand.php | 2 +- src/Command/Archive/ArchiveExportCommand.php | 2 +- src/Command/Auth/AuthAcsfLoginCommand.php | 2 +- src/Command/Auth/AuthAcsfLogoutCommand.php | 2 +- src/Command/Auth/AuthLoginCommand.php | 2 +- src/Command/Auth/AuthLogoutCommand.php | 2 +- src/Command/CodeStudio/CodeStudioPhpVersionCommand.php | 2 +- src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php | 2 +- src/Command/CodeStudio/CodeStudioWizardCommand.php | 2 +- src/Command/DocsCommand.php | 2 +- src/Command/Email/ConfigurePlatformEmailCommand.php | 2 +- src/Command/Email/EmailInfoForSubscriptionCommand.php | 2 +- src/Command/Env/EnvCertCreateCommand.php | 2 +- src/Command/Env/EnvCopyCronCommand.php | 2 +- src/Command/Env/EnvCreateCommand.php | 2 +- src/Command/Env/EnvDeleteCommand.php | 2 +- src/Command/Env/EnvMirrorCommand.php | 2 +- src/Command/HelloWorldCommand.php | 2 +- src/Command/Ide/IdeCreateCommand.php | 2 +- src/Command/Ide/IdeDeleteCommand.php | 2 +- src/Command/Ide/IdeInfoCommand.php | 2 +- src/Command/Ide/IdeListCommand.php | 2 +- src/Command/Ide/IdeListMineCommand.php | 2 +- src/Command/Ide/IdeOpenCommand.php | 2 +- src/Command/Ide/IdePhpVersionCommand.php | 2 +- src/Command/Ide/IdeServiceRestartCommand.php | 2 +- src/Command/Ide/IdeServiceStartCommand.php | 2 +- src/Command/Ide/IdeServiceStopCommand.php | 2 +- src/Command/Ide/IdeShareCommand.php | 2 +- src/Command/Ide/IdeXdebugToggleCommand.php | 2 +- src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php | 2 +- src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php | 2 +- src/Command/Pull/PullCodeCommand.php | 2 +- src/Command/Pull/PullCommand.php | 2 +- src/Command/Pull/PullDatabaseCommand.php | 2 +- src/Command/Pull/PullFilesCommand.php | 2 +- src/Command/Pull/PullScriptsCommand.php | 2 +- src/Command/Push/PushArtifactCommand.php | 2 +- src/Command/Push/PushCodeCommand.php | 2 +- src/Command/Push/PushDatabaseCommand.php | 2 +- src/Command/Push/PushFilesCommand.php | 2 +- src/Command/Remote/AliasListCommand.php | 2 +- src/Command/Remote/AliasesDownloadCommand.php | 2 +- src/Command/Remote/DrushCommand.php | 2 +- src/Command/Remote/SshCommand.php | 2 +- src/Command/Self/ClearCacheCommand.php | 2 +- src/Command/Self/ListCommand.php | 2 +- src/Command/Self/MakeDocsCommand.php | 2 +- src/Command/Self/TelemetryCommand.php | 2 +- src/Command/Self/TelemetryDisableCommand.php | 2 +- src/Command/Self/TelemetryEnableCommand.php | 2 +- src/Command/Ssh/SshKeyCreateCommand.php | 2 +- src/Command/Ssh/SshKeyCreateUploadCommand.php | 2 +- src/Command/Ssh/SshKeyDeleteCommand.php | 2 +- src/Command/Ssh/SshKeyInfoCommand.php | 2 +- src/Command/Ssh/SshKeyListCommand.php | 2 +- src/Command/Ssh/SshKeyUploadCommand.php | 2 +- 65 files changed, 65 insertions(+), 65 deletions(-) diff --git a/src/Command/Acsf/AcsfListCommand.php b/src/Command/Acsf/AcsfListCommand.php index fad519fe0..7262d17f8 100644 --- a/src/Command/Acsf/AcsfListCommand.php +++ b/src/Command/Acsf/AcsfListCommand.php @@ -9,7 +9,7 @@ #[RequireAuth] #[AsCommand(name: 'acsf:list', description: 'List all Acquia Cloud Site Factory commands', aliases: ['acsf'])] -class AcsfListCommand extends AcsfListCommandBase { +final class AcsfListCommand extends AcsfListCommandBase { protected string $namespace = 'acsf'; diff --git a/src/Command/Api/ApiListCommand.php b/src/Command/Api/ApiListCommand.php index 44bb80f6e..3f71a8c19 100644 --- a/src/Command/Api/ApiListCommand.php +++ b/src/Command/Api/ApiListCommand.php @@ -9,7 +9,7 @@ #[RequireAuth] #[AsCommand(name: 'api:list', description: 'List all API commands', aliases: ['api'])] -class ApiListCommand extends ApiListCommandBase { +final class ApiListCommand extends ApiListCommandBase { protected string $namespace = 'api'; diff --git a/src/Command/App/AppOpenCommand.php b/src/Command/App/AppOpenCommand.php index 84ed752ec..7d78ec612 100644 --- a/src/Command/App/AppOpenCommand.php +++ b/src/Command/App/AppOpenCommand.php @@ -14,7 +14,7 @@ #[RequireAuth] #[AsCommand(name: 'app:open', description: 'Opens your browser to view a given Cloud application', aliases: ['open', 'o'])] -class AppOpenCommand extends CommandBase { +final class AppOpenCommand extends CommandBase { protected function configure(): void { $this diff --git a/src/Command/App/LinkCommand.php b/src/Command/App/LinkCommand.php index 0c8f854b1..d0c626a36 100644 --- a/src/Command/App/LinkCommand.php +++ b/src/Command/App/LinkCommand.php @@ -13,7 +13,7 @@ #[RequireAuth] #[AsCommand(name: 'app:link', description: 'Associate your project with a Cloud Platform application', aliases: ['link'])] -class LinkCommand extends CommandBase { +final class LinkCommand extends CommandBase { protected function configure(): void { $this->acceptApplicationUuid(); diff --git a/src/Command/App/LogTailCommand.php b/src/Command/App/LogTailCommand.php index 602cbaf40..d88c62bd2 100644 --- a/src/Command/App/LogTailCommand.php +++ b/src/Command/App/LogTailCommand.php @@ -14,7 +14,7 @@ #[RequireAuth] #[AsCommand(name: 'app:log:tail', description: 'Tail the logs from your environments', aliases: ['tail', 'log:tail'])] -class LogTailCommand extends CommandBase { +final class LogTailCommand extends CommandBase { protected function configure(): void { $this diff --git a/src/Command/App/NewCommand.php b/src/Command/App/NewCommand.php index 3f6db4ac6..99a576c15 100644 --- a/src/Command/App/NewCommand.php +++ b/src/Command/App/NewCommand.php @@ -15,7 +15,7 @@ use Symfony\Component\Filesystem\Path; #[AsCommand(name: 'app:new:local', description: 'Create a new Drupal or Next.js project', aliases: ['new'])] -class NewCommand extends CommandBase { +final class NewCommand extends CommandBase { protected function configure(): void { $this diff --git a/src/Command/App/NewFromDrupal7Command.php b/src/Command/App/NewFromDrupal7Command.php index b81a7bde6..75c67ded4 100644 --- a/src/Command/App/NewFromDrupal7Command.php +++ b/src/Command/App/NewFromDrupal7Command.php @@ -28,7 +28,7 @@ // A nod to its roots. 'ama', ])] -class NewFromDrupal7Command extends CommandBase { +final class NewFromDrupal7Command extends CommandBase { /** * Exit code raised when the URI flag does not correspond to configuration. diff --git a/src/Command/App/TaskWaitCommand.php b/src/Command/App/TaskWaitCommand.php index c6f10a988..501afb8c5 100644 --- a/src/Command/App/TaskWaitCommand.php +++ b/src/Command/App/TaskWaitCommand.php @@ -14,7 +14,7 @@ #[RequireAuth] #[AsCommand(name: 'app:task-wait', description: 'Wait for a task to complete')] -class TaskWaitCommand extends CommandBase { +final class TaskWaitCommand extends CommandBase { protected function configure(): void { $this diff --git a/src/Command/App/UnlinkCommand.php b/src/Command/App/UnlinkCommand.php index b4b1146b9..d7f922bb7 100644 --- a/src/Command/App/UnlinkCommand.php +++ b/src/Command/App/UnlinkCommand.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'app:unlink', description: 'Remove local association between your project and a Cloud Platform application', aliases: ['unlink'])] -class UnlinkCommand extends CommandBase { +final class UnlinkCommand extends CommandBase { protected function execute(InputInterface $input, OutputInterface $output): int { $this->validateCwdIsValidDrupalProject(); diff --git a/src/Command/Archive/ArchiveExportCommand.php b/src/Command/Archive/ArchiveExportCommand.php index c8239636d..bddf8a30c 100644 --- a/src/Command/Archive/ArchiveExportCommand.php +++ b/src/Command/Archive/ArchiveExportCommand.php @@ -21,7 +21,7 @@ #[RequireAuth] #[AsCommand(name: 'archive:export', description: 'Export an archive of the Drupal application including code, files, and database')] -class ArchiveExportCommand extends CommandBase { +final class ArchiveExportCommand extends CommandBase { protected Checklist $checklist; diff --git a/src/Command/Auth/AuthAcsfLoginCommand.php b/src/Command/Auth/AuthAcsfLoginCommand.php index e1b40d078..861a180fd 100644 --- a/src/Command/Auth/AuthAcsfLoginCommand.php +++ b/src/Command/Auth/AuthAcsfLoginCommand.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'auth:acsf-login', description: 'Register your Site Factory API key and secret to use API functionality')] -class AuthAcsfLoginCommand extends CommandBase { +final class AuthAcsfLoginCommand extends CommandBase { protected function configure(): void { $this diff --git a/src/Command/Auth/AuthAcsfLogoutCommand.php b/src/Command/Auth/AuthAcsfLogoutCommand.php index 809438013..171272e27 100644 --- a/src/Command/Auth/AuthAcsfLogoutCommand.php +++ b/src/Command/Auth/AuthAcsfLogoutCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'auth:acsf-logout', description: 'Remove your Site Factory key and secret from your local machine.')] -class AuthAcsfLogoutCommand extends CommandBase { +final class AuthAcsfLogoutCommand extends CommandBase { protected function execute(InputInterface $input, OutputInterface $output): int { $factories = $this->datastoreCloud->get('acsf_factories'); diff --git a/src/Command/Auth/AuthLoginCommand.php b/src/Command/Auth/AuthLoginCommand.php index 78f9c676f..321665e83 100644 --- a/src/Command/Auth/AuthLoginCommand.php +++ b/src/Command/Auth/AuthLoginCommand.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'auth:login', description: 'Register your Cloud API key and secret to use API functionality', aliases: ['login'])] -class AuthLoginCommand extends CommandBase { +final class AuthLoginCommand extends CommandBase { protected function configure(): void { $this diff --git a/src/Command/Auth/AuthLogoutCommand.php b/src/Command/Auth/AuthLogoutCommand.php index c5ac2faa2..9edda39f7 100644 --- a/src/Command/Auth/AuthLogoutCommand.php +++ b/src/Command/Auth/AuthLogoutCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'auth:logout', description: 'Remove Cloud API key and secret from local machine.', aliases: ['logout'])] -class AuthLogoutCommand extends CommandBase { +final class AuthLogoutCommand extends CommandBase { protected function execute(InputInterface $input, OutputInterface $output): int { if ($this->cloudApiClientService->isMachineAuthenticated()) { diff --git a/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php b/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php index 9db4c75d2..64a9cf69c 100644 --- a/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php +++ b/src/Command/CodeStudio/CodeStudioPhpVersionCommand.php @@ -14,7 +14,7 @@ #[RequireAuth] #[AsCommand(name: 'codestudio:php-version', description: 'Change the PHP version in Code Studio')] -class CodeStudioPhpVersionCommand extends CommandBase { +final class CodeStudioPhpVersionCommand extends CommandBase { use CodeStudioCommandTrait; diff --git a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php index 16e085a46..f8eb91cc7 100644 --- a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php +++ b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php @@ -17,7 +17,7 @@ use Symfony\Component\Yaml\Yaml; #[AsCommand(name: 'codestudio:pipelines-migrate', description: 'Migrate .acquia-pipeline.yml file to .gitlab-ci.yml file for a given Acquia Cloud application', aliases: ['cs:pipelines-migrate'])] -class CodeStudioPipelinesMigrateCommand extends CommandBase { +final class CodeStudioPipelinesMigrateCommand extends CommandBase { use CodeStudioCommandTrait; diff --git a/src/Command/CodeStudio/CodeStudioWizardCommand.php b/src/Command/CodeStudio/CodeStudioWizardCommand.php index 7ada08dca..52675b696 100644 --- a/src/Command/CodeStudio/CodeStudioWizardCommand.php +++ b/src/Command/CodeStudio/CodeStudioWizardCommand.php @@ -16,7 +16,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'codestudio:wizard', description: 'Create and/or configure a new Code Studio project for a given Acquia Cloud application', aliases: ['cs:wizard'])] -class CodeStudioWizardCommand extends WizardCommandBase { +final class CodeStudioWizardCommand extends WizardCommandBase { use CodeStudioCommandTrait; diff --git a/src/Command/DocsCommand.php b/src/Command/DocsCommand.php index a1a2e0f33..162e3e0d6 100644 --- a/src/Command/DocsCommand.php +++ b/src/Command/DocsCommand.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Question\ChoiceQuestion; #[AsCommand(name: 'docs', description: 'Open Acquia product documentation in a web browser')] -class DocsCommand extends CommandBase { +final class DocsCommand extends CommandBase { protected function configure(): void { $this diff --git a/src/Command/Email/ConfigurePlatformEmailCommand.php b/src/Command/Email/ConfigurePlatformEmailCommand.php index 9d35a78a5..4bb3f4742 100644 --- a/src/Command/Email/ConfigurePlatformEmailCommand.php +++ b/src/Command/Email/ConfigurePlatformEmailCommand.php @@ -28,7 +28,7 @@ #[RequireAuth] #[AsCommand(name: 'email:configure', description: 'Configure Platform email for one or more applications', aliases: ['ec'])] -class ConfigurePlatformEmailCommand extends CommandBase { +final class ConfigurePlatformEmailCommand extends CommandBase { protected function configure(): void { $this diff --git a/src/Command/Email/EmailInfoForSubscriptionCommand.php b/src/Command/Email/EmailInfoForSubscriptionCommand.php index f938083bc..ba0229570 100644 --- a/src/Command/Email/EmailInfoForSubscriptionCommand.php +++ b/src/Command/Email/EmailInfoForSubscriptionCommand.php @@ -21,7 +21,7 @@ #[RequireAuth] #[AsCommand(name: 'email:info', description: 'Print information related to Platform Email set up in a subscription.')] -class EmailInfoForSubscriptionCommand extends CommandBase { +final class EmailInfoForSubscriptionCommand extends CommandBase { protected function configure(): void { $this diff --git a/src/Command/Env/EnvCertCreateCommand.php b/src/Command/Env/EnvCertCreateCommand.php index ab1a271a1..bb3c1b8c4 100644 --- a/src/Command/Env/EnvCertCreateCommand.php +++ b/src/Command/Env/EnvCertCreateCommand.php @@ -16,7 +16,7 @@ #[RequireAuth] #[AsCommand(name: 'env:certificate-create', description: 'Install an SSL certificate.')] -class EnvCertCreateCommand extends CommandBase { +final class EnvCertCreateCommand extends CommandBase { protected function configure(): void { $this diff --git a/src/Command/Env/EnvCopyCronCommand.php b/src/Command/Env/EnvCopyCronCommand.php index 34069020b..d1a5a8df8 100644 --- a/src/Command/Env/EnvCopyCronCommand.php +++ b/src/Command/Env/EnvCopyCronCommand.php @@ -16,7 +16,7 @@ #[RequireAuth] #[AsCommand(name: 'env:cron-copy', description: 'Copy all cron tasks from one Acquia Cloud Platform environment to another')] -class EnvCopyCronCommand extends CommandBase { +final class EnvCopyCronCommand extends CommandBase { protected function configure(): void { $this diff --git a/src/Command/Env/EnvCreateCommand.php b/src/Command/Env/EnvCreateCommand.php index cbfa803b6..ac22d29fe 100644 --- a/src/Command/Env/EnvCreateCommand.php +++ b/src/Command/Env/EnvCreateCommand.php @@ -19,7 +19,7 @@ #[RequireAuth] #[AsCommand(name: 'env:create', description: 'Create a new Continuous Delivery Environment (CDE)')] -class EnvCreateCommand extends CommandBase { +final class EnvCreateCommand extends CommandBase { private Checklist $checklist; diff --git a/src/Command/Env/EnvDeleteCommand.php b/src/Command/Env/EnvDeleteCommand.php index fb49ca72d..0c527ecae 100644 --- a/src/Command/Env/EnvDeleteCommand.php +++ b/src/Command/Env/EnvDeleteCommand.php @@ -16,7 +16,7 @@ #[RequireAuth] #[AsCommand(name: 'env:delete', description: 'Delete a Continuous Delivery Environment (CDE)')] -class EnvDeleteCommand extends CommandBase { +final class EnvDeleteCommand extends CommandBase { protected function configure(): void { $this->acceptEnvironmentId(); diff --git a/src/Command/Env/EnvMirrorCommand.php b/src/Command/Env/EnvMirrorCommand.php index 7f2f1969f..7a2038717 100644 --- a/src/Command/Env/EnvMirrorCommand.php +++ b/src/Command/Env/EnvMirrorCommand.php @@ -20,7 +20,7 @@ #[RequireAuth] #[AsCommand(name: 'env:mirror', description: 'Makes one environment identical to another in terms of code, database, files, and configuration.')] -class EnvMirrorCommand extends CommandBase { +final class EnvMirrorCommand extends CommandBase { private Checklist $checklist; diff --git a/src/Command/HelloWorldCommand.php b/src/Command/HelloWorldCommand.php index c4def7854..81b93096b 100644 --- a/src/Command/HelloWorldCommand.php +++ b/src/Command/HelloWorldCommand.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'hello-world', description: 'Test command used for asserting core functionality')] -class HelloWorldCommand extends CommandBase { +final class HelloWorldCommand extends CommandBase { protected function configure(): void { $this diff --git a/src/Command/Ide/IdeCreateCommand.php b/src/Command/Ide/IdeCreateCommand.php index 503314a54..cc700248d 100644 --- a/src/Command/Ide/IdeCreateCommand.php +++ b/src/Command/Ide/IdeCreateCommand.php @@ -23,7 +23,7 @@ #[RequireAuth] #[AsCommand(name: 'ide:create', description: 'Create a Cloud IDE')] -class IdeCreateCommand extends IdeCommandBase { +final class IdeCreateCommand extends IdeCommandBase { private IdeResponse $ide; diff --git a/src/Command/Ide/IdeDeleteCommand.php b/src/Command/Ide/IdeDeleteCommand.php index 87723d9c9..aaae9d213 100644 --- a/src/Command/Ide/IdeDeleteCommand.php +++ b/src/Command/Ide/IdeDeleteCommand.php @@ -14,7 +14,7 @@ #[RequireAuth] #[AsCommand(name: 'ide:delete', description: 'Delete a Cloud IDE')] -class IdeDeleteCommand extends IdeCommandBase { +final class IdeDeleteCommand extends IdeCommandBase { use SshCommandTrait; diff --git a/src/Command/Ide/IdeInfoCommand.php b/src/Command/Ide/IdeInfoCommand.php index 543782243..026a4ddf7 100644 --- a/src/Command/Ide/IdeInfoCommand.php +++ b/src/Command/Ide/IdeInfoCommand.php @@ -14,7 +14,7 @@ #[RequireAuth] #[AsCommand(name: 'ide:info', description: 'Print information about a Cloud IDE')] -class IdeInfoCommand extends IdeCommandBase { +final class IdeInfoCommand extends IdeCommandBase { protected function configure(): void { $this->acceptApplicationUuid(); diff --git a/src/Command/Ide/IdeListCommand.php b/src/Command/Ide/IdeListCommand.php index 532a1e88e..ea83d2214 100644 --- a/src/Command/Ide/IdeListCommand.php +++ b/src/Command/Ide/IdeListCommand.php @@ -15,7 +15,7 @@ #[RequireAuth] #[AsCommand(name: 'ide:list:app', description: 'List available Cloud IDEs belonging to a given application', aliases: ['ide:list'])] -class IdeListCommand extends IdeCommandBase { +final class IdeListCommand extends IdeCommandBase { protected function configure(): void { $this->acceptApplicationUuid(); diff --git a/src/Command/Ide/IdeListMineCommand.php b/src/Command/Ide/IdeListMineCommand.php index 39adf9243..7e1409b0f 100644 --- a/src/Command/Ide/IdeListMineCommand.php +++ b/src/Command/Ide/IdeListMineCommand.php @@ -16,7 +16,7 @@ #[RequireAuth] #[AsCommand(name: 'ide:list:mine', description: 'List Cloud IDEs belonging to you')] -class IdeListMineCommand extends IdeCommandBase { +final class IdeListMineCommand extends IdeCommandBase { protected function execute(InputInterface $input, OutputInterface $output): int { $acquiaCloudClient = $this->cloudApiClientService->getClient(); diff --git a/src/Command/Ide/IdeOpenCommand.php b/src/Command/Ide/IdeOpenCommand.php index 29d266afd..0d56f7eca 100644 --- a/src/Command/Ide/IdeOpenCommand.php +++ b/src/Command/Ide/IdeOpenCommand.php @@ -14,7 +14,7 @@ #[RequireAuth] #[AsCommand(name: 'ide:open', description: 'Open a Cloud IDE in your browser')] -class IdeOpenCommand extends IdeCommandBase { +final class IdeOpenCommand extends IdeCommandBase { protected function configure(): void { $this diff --git a/src/Command/Ide/IdePhpVersionCommand.php b/src/Command/Ide/IdePhpVersionCommand.php index 9ef3866c8..c647eb000 100644 --- a/src/Command/Ide/IdePhpVersionCommand.php +++ b/src/Command/Ide/IdePhpVersionCommand.php @@ -13,7 +13,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'ide:php-version', description: 'Change the PHP version in the current IDE')] -class IdePhpVersionCommand extends IdeCommandBase { +final class IdePhpVersionCommand extends IdeCommandBase { private string $idePhpFilePathPrefix; diff --git a/src/Command/Ide/IdeServiceRestartCommand.php b/src/Command/Ide/IdeServiceRestartCommand.php index 168837feb..ca039d8d9 100644 --- a/src/Command/Ide/IdeServiceRestartCommand.php +++ b/src/Command/Ide/IdeServiceRestartCommand.php @@ -15,7 +15,7 @@ use Symfony\Component\Validator\Validation; #[AsCommand(name: 'ide:service-restart', description: 'Restart a service in the Cloud IDE')] -class IdeServiceRestartCommand extends IdeCommandBase { +final class IdeServiceRestartCommand extends IdeCommandBase { protected function configure(): void { $this diff --git a/src/Command/Ide/IdeServiceStartCommand.php b/src/Command/Ide/IdeServiceStartCommand.php index 4b6ce178b..5d3f0d607 100644 --- a/src/Command/Ide/IdeServiceStartCommand.php +++ b/src/Command/Ide/IdeServiceStartCommand.php @@ -15,7 +15,7 @@ use Symfony\Component\Validator\Validation; #[AsCommand(name: 'ide:service-start', description: 'Start a service in the Cloud IDE')] -class IdeServiceStartCommand extends IdeCommandBase { +final class IdeServiceStartCommand extends IdeCommandBase { protected function configure(): void { $this diff --git a/src/Command/Ide/IdeServiceStopCommand.php b/src/Command/Ide/IdeServiceStopCommand.php index f2e56944b..d0e9476d8 100644 --- a/src/Command/Ide/IdeServiceStopCommand.php +++ b/src/Command/Ide/IdeServiceStopCommand.php @@ -15,7 +15,7 @@ use Symfony\Component\Validator\Validation; #[AsCommand(name: 'ide:service-stop', description: 'Stop a service in the Cloud IDE')] -class IdeServiceStopCommand extends IdeCommandBase { +final class IdeServiceStopCommand extends IdeCommandBase { protected function configure(): void { $this diff --git a/src/Command/Ide/IdeShareCommand.php b/src/Command/Ide/IdeShareCommand.php index e95393485..5d671b601 100644 --- a/src/Command/Ide/IdeShareCommand.php +++ b/src/Command/Ide/IdeShareCommand.php @@ -15,7 +15,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'ide:share', description: 'Get the share URL for a Cloud IDE')] -class IdeShareCommand extends CommandBase { +final class IdeShareCommand extends CommandBase { /** * @var array diff --git a/src/Command/Ide/IdeXdebugToggleCommand.php b/src/Command/Ide/IdeXdebugToggleCommand.php index ef1b0c391..a003ca2ea 100644 --- a/src/Command/Ide/IdeXdebugToggleCommand.php +++ b/src/Command/Ide/IdeXdebugToggleCommand.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'ide:xdebug-toggle', description: 'Toggle Xdebug on or off in the current IDE', aliases: ['xdebug'])] -class IdeXdebugToggleCommand extends IdeCommandBase { +final class IdeXdebugToggleCommand extends IdeCommandBase { private ?bool $xDebugEnabled; diff --git a/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php b/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php index e1564c0ba..a77785a93 100644 --- a/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php +++ b/src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php @@ -15,7 +15,7 @@ #[RequireAuth] #[AsCommand(name: 'ide:wizard:ssh-key:create-upload', description: 'Wizard to perform first time setup tasks within an IDE', aliases: ['ide:wizard'])] -class IdeWizardCreateSshKeyCommand extends IdeWizardCommandBase { +final class IdeWizardCreateSshKeyCommand extends IdeWizardCommandBase { protected function configure(): void { $this diff --git a/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php b/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php index 4ee5fac07..97a4c87bf 100644 --- a/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php +++ b/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php @@ -15,7 +15,7 @@ #[RequireAuth] #[AsCommand(name: 'ide:wizard:ssh-key:delete', description: 'Wizard to delete SSH key for IDE from Cloud')] -class IdeWizardDeleteSshKeyCommand extends IdeWizardCommandBase { +final class IdeWizardDeleteSshKeyCommand extends IdeWizardCommandBase { use SshCommandTrait; diff --git a/src/Command/Pull/PullCodeCommand.php b/src/Command/Pull/PullCodeCommand.php index 6ebfd322c..089e325ad 100644 --- a/src/Command/Pull/PullCodeCommand.php +++ b/src/Command/Pull/PullCodeCommand.php @@ -14,7 +14,7 @@ #[RequireAuth] #[AsCommand(name: 'pull:code', description: 'Copy code from a Cloud Platform environment')] -class PullCodeCommand extends PullCommandBase { +final class PullCodeCommand extends PullCommandBase { protected function commandRequiresDatabase(): bool { return TRUE; diff --git a/src/Command/Pull/PullCommand.php b/src/Command/Pull/PullCommand.php index 8ee900e61..3f41f681e 100644 --- a/src/Command/Pull/PullCommand.php +++ b/src/Command/Pull/PullCommand.php @@ -14,7 +14,7 @@ #[RequireAuth] #[AsCommand(name: 'pull:all', description: 'Copy code, database, and files from a Cloud Platform environment', aliases: ['refresh', 'pull'])] -class PullCommand extends PullCommandBase { +final class PullCommand extends PullCommandBase { protected function commandRequiresDatabase(): bool { return TRUE; diff --git a/src/Command/Pull/PullDatabaseCommand.php b/src/Command/Pull/PullDatabaseCommand.php index 4387b08ff..a48becd36 100644 --- a/src/Command/Pull/PullDatabaseCommand.php +++ b/src/Command/Pull/PullDatabaseCommand.php @@ -13,7 +13,7 @@ #[RequireAuth] #[AsCommand(name: 'pull:database', description: 'Import database backup from a Cloud Platform environment', aliases: ['pull:db'])] -class PullDatabaseCommand extends PullCommandBase { +final class PullDatabaseCommand extends PullCommandBase { protected function commandRequiresDatabase(): bool { return TRUE; diff --git a/src/Command/Pull/PullFilesCommand.php b/src/Command/Pull/PullFilesCommand.php index bdc9c0c6a..c0f4e9d34 100644 --- a/src/Command/Pull/PullFilesCommand.php +++ b/src/Command/Pull/PullFilesCommand.php @@ -12,7 +12,7 @@ #[RequireAuth] #[AsCommand(name: 'pull:files', description: 'Copy Drupal public files from a Cloud Platform environment to your local environment')] -class PullFilesCommand extends PullCommandBase { +final class PullFilesCommand extends PullCommandBase { protected function configure(): void { $this diff --git a/src/Command/Pull/PullScriptsCommand.php b/src/Command/Pull/PullScriptsCommand.php index 1821e505a..98965a1c0 100644 --- a/src/Command/Pull/PullScriptsCommand.php +++ b/src/Command/Pull/PullScriptsCommand.php @@ -11,7 +11,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'pull:run-scripts', description: 'Execute post pull scripts')] -class PullScriptsCommand extends PullCommandBase { +final class PullScriptsCommand extends PullCommandBase { protected function configure(): void { $this diff --git a/src/Command/Push/PushArtifactCommand.php b/src/Command/Push/PushArtifactCommand.php index da10b69d6..7b2c8ca70 100644 --- a/src/Command/Push/PushArtifactCommand.php +++ b/src/Command/Push/PushArtifactCommand.php @@ -17,7 +17,7 @@ use Symfony\Component\Filesystem\Path; #[AsCommand(name: 'push:artifact', description: 'Build and push a code artifact to a Cloud Platform environment')] -class PushArtifactCommand extends PullCommandBase { +final class PushArtifactCommand extends PullCommandBase { /** * Composer vendor directories. diff --git a/src/Command/Push/PushCodeCommand.php b/src/Command/Push/PushCodeCommand.php index c53ffcdc1..49c9cbc69 100644 --- a/src/Command/Push/PushCodeCommand.php +++ b/src/Command/Push/PushCodeCommand.php @@ -14,7 +14,7 @@ #[RequireAuth] #[AsCommand(name: 'push:code', description: 'Push code from your IDE to a Cloud Platform environment')] -class PushCodeCommand extends PullCommandBase { +final class PushCodeCommand extends PullCommandBase { protected function configure(): void { $this diff --git a/src/Command/Push/PushDatabaseCommand.php b/src/Command/Push/PushDatabaseCommand.php index f4e98cc78..4e3733d54 100644 --- a/src/Command/Push/PushDatabaseCommand.php +++ b/src/Command/Push/PushDatabaseCommand.php @@ -17,7 +17,7 @@ #[RequireAuth] #[AsCommand(name: 'push:database', description: 'Push a database from your local environment to a Cloud Platform environment', aliases: ['push:db'])] -class PushDatabaseCommand extends PullCommandBase { +final class PushDatabaseCommand extends PullCommandBase { protected function commandRequiresDatabase(): bool { return TRUE; diff --git a/src/Command/Push/PushFilesCommand.php b/src/Command/Push/PushFilesCommand.php index d001803bd..e2ff087f9 100644 --- a/src/Command/Push/PushFilesCommand.php +++ b/src/Command/Push/PushFilesCommand.php @@ -15,7 +15,7 @@ #[RequireAuth] #[AsCommand(name: 'push:files', description: 'Copy Drupal public files from your local environment to a Cloud Platform environment')] -class PushFilesCommand extends PullCommandBase { +final class PushFilesCommand extends PullCommandBase { protected function configure(): void { $this diff --git a/src/Command/Remote/AliasListCommand.php b/src/Command/Remote/AliasListCommand.php index 2a2aac601..21c239f2a 100644 --- a/src/Command/Remote/AliasListCommand.php +++ b/src/Command/Remote/AliasListCommand.php @@ -16,7 +16,7 @@ #[RequireAuth] #[AsCommand(name: 'remote:aliases:list', description: 'List all aliases for the Cloud Platform environments', aliases: ['aliases', 'sa'])] -class AliasListCommand extends CommandBase { +final class AliasListCommand extends CommandBase { protected function configure(): void { $this->acceptApplicationUuid(); diff --git a/src/Command/Remote/AliasesDownloadCommand.php b/src/Command/Remote/AliasesDownloadCommand.php index be471aefa..4f9ff0cab 100644 --- a/src/Command/Remote/AliasesDownloadCommand.php +++ b/src/Command/Remote/AliasesDownloadCommand.php @@ -23,7 +23,7 @@ */ #[RequireAuth] #[AsCommand(name: 'remote:aliases:download', description: 'Download Drush aliases for the Cloud Platform')] -class AliasesDownloadCommand extends SshCommand { +final class AliasesDownloadCommand extends SshBaseCommand { private string $drushArchiveFilepath; diff --git a/src/Command/Remote/DrushCommand.php b/src/Command/Remote/DrushCommand.php index f9b02393f..6a3761fa2 100644 --- a/src/Command/Remote/DrushCommand.php +++ b/src/Command/Remote/DrushCommand.php @@ -15,7 +15,7 @@ */ #[RequireAuth] #[AsCommand(name: 'remote:drush', description: 'Run a Drush command remotely on a application\'s environment', aliases: ['drush', 'dr'])] -class DrushCommand extends SshBaseCommand { +final class DrushCommand extends SshBaseCommand { protected function configure(): void { $this diff --git a/src/Command/Remote/SshCommand.php b/src/Command/Remote/SshCommand.php index 6ab2030d4..f924406bc 100644 --- a/src/Command/Remote/SshCommand.php +++ b/src/Command/Remote/SshCommand.php @@ -16,7 +16,7 @@ */ #[RequireAuth] #[AsCommand(name: 'remote:ssh', description: 'Use SSH to open a shell or run a command in a Cloud Platform environment', aliases: ['ssh'])] -class SshCommand extends SshBaseCommand { +final class SshCommand extends SshBaseCommand { protected function configure(): void { $this diff --git a/src/Command/Self/ClearCacheCommand.php b/src/Command/Self/ClearCacheCommand.php index 657dfa665..1052e3a2e 100644 --- a/src/Command/Self/ClearCacheCommand.php +++ b/src/Command/Self/ClearCacheCommand.php @@ -15,7 +15,7 @@ #[RequireAuth] #[AsCommand(name: 'self:clear-caches', description: 'Clears local Acquia CLI caches', aliases: ['cc', 'cr'])] -class ClearCacheCommand extends CommandBase { +final class ClearCacheCommand extends CommandBase { protected function execute(InputInterface $input, OutputInterface $output): int { self::clearCaches(); diff --git a/src/Command/Self/ListCommand.php b/src/Command/Self/ListCommand.php index ac6576702..4b429c807 100644 --- a/src/Command/Self/ListCommand.php +++ b/src/Command/Self/ListCommand.php @@ -13,7 +13,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'list', description: NULL, aliases: ['self:list'])] -class ListCommand extends \Symfony\Component\Console\Command\ListCommand { +final class ListCommand extends \Symfony\Component\Console\Command\ListCommand { protected function execute(InputInterface $input, OutputInterface $output): int { foreach (['api', 'acsf'] as $prefix) { diff --git a/src/Command/Self/MakeDocsCommand.php b/src/Command/Self/MakeDocsCommand.php index 7a8373cda..b760a77a6 100644 --- a/src/Command/Self/MakeDocsCommand.php +++ b/src/Command/Self/MakeDocsCommand.php @@ -14,7 +14,7 @@ #[RequireAuth] #[AsCommand(name: 'self:make-docs', description: 'Generate documentation for all ACLI commands')] -class MakeDocsCommand extends CommandBase { +final class MakeDocsCommand extends CommandBase { protected function configure(): void { $this diff --git a/src/Command/Self/TelemetryCommand.php b/src/Command/Self/TelemetryCommand.php index f18895ef4..6ebc29aa2 100644 --- a/src/Command/Self/TelemetryCommand.php +++ b/src/Command/Self/TelemetryCommand.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'self:telemetry:toggle', description: 'Toggle anonymous sharing of usage and performance data', aliases: ['telemetry'])] -class TelemetryCommand extends CommandBase { +final class TelemetryCommand extends CommandBase { protected function execute(InputInterface $input, OutputInterface $output): int { $datastore = $this->datastoreCloud; diff --git a/src/Command/Self/TelemetryDisableCommand.php b/src/Command/Self/TelemetryDisableCommand.php index 96c5d7a24..2c757f031 100644 --- a/src/Command/Self/TelemetryDisableCommand.php +++ b/src/Command/Self/TelemetryDisableCommand.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'self:telemetry:disable', description: 'Disable anonymous sharing of usage and performance data', aliases: ['telemetry:disable'])] -class TelemetryDisableCommand extends CommandBase { +final class TelemetryDisableCommand extends CommandBase { protected function execute(InputInterface $input, OutputInterface $output): int { $datastore = $this->datastoreCloud; diff --git a/src/Command/Self/TelemetryEnableCommand.php b/src/Command/Self/TelemetryEnableCommand.php index 29bd4a51b..aec834d8e 100644 --- a/src/Command/Self/TelemetryEnableCommand.php +++ b/src/Command/Self/TelemetryEnableCommand.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'self:telemetry:enable', description: 'Enable anonymous sharing of usage and performance data', aliases: ['telemetry:enable'])] -class TelemetryEnableCommand extends CommandBase { +final class TelemetryEnableCommand extends CommandBase { protected function execute(InputInterface $input, OutputInterface $output): int { $datastore = $this->datastoreCloud; diff --git a/src/Command/Ssh/SshKeyCreateCommand.php b/src/Command/Ssh/SshKeyCreateCommand.php index 4e6ede3be..8b8892d91 100644 --- a/src/Command/Ssh/SshKeyCreateCommand.php +++ b/src/Command/Ssh/SshKeyCreateCommand.php @@ -13,7 +13,7 @@ #[RequireAuth] #[AsCommand(name: 'ssh-key:create', description: 'Create an SSH key on your local machine')] -class SshKeyCreateCommand extends SshKeyCommandBase { +final class SshKeyCreateCommand extends SshKeyCommandBase { protected function configure(): void { $this diff --git a/src/Command/Ssh/SshKeyCreateUploadCommand.php b/src/Command/Ssh/SshKeyCreateUploadCommand.php index 69f20a484..f49b2c4a5 100644 --- a/src/Command/Ssh/SshKeyCreateUploadCommand.php +++ b/src/Command/Ssh/SshKeyCreateUploadCommand.php @@ -13,7 +13,7 @@ #[RequireAuth] #[AsCommand(name: 'ssh-key:create-upload', description: 'Create an SSH key on your local machine and upload it to the Cloud Platform')] -class SshKeyCreateUploadCommand extends SshKeyCreateCommand { +final class SshKeyCreateUploadCommand extends SshKeyCommandBase { protected function configure(): void { $this diff --git a/src/Command/Ssh/SshKeyDeleteCommand.php b/src/Command/Ssh/SshKeyDeleteCommand.php index fbae87e15..556a7dc94 100644 --- a/src/Command/Ssh/SshKeyDeleteCommand.php +++ b/src/Command/Ssh/SshKeyDeleteCommand.php @@ -13,7 +13,7 @@ #[RequireAuth] #[AsCommand(name: 'ssh-key:delete', description: 'Delete an SSH key')] -class SshKeyDeleteCommand extends SshKeyCommandBase { +final class SshKeyDeleteCommand extends SshKeyCommandBase { use SshCommandTrait; diff --git a/src/Command/Ssh/SshKeyInfoCommand.php b/src/Command/Ssh/SshKeyInfoCommand.php index 913be1609..06bf953f4 100644 --- a/src/Command/Ssh/SshKeyInfoCommand.php +++ b/src/Command/Ssh/SshKeyInfoCommand.php @@ -16,7 +16,7 @@ #[RequireAuth] #[AsCommand(name: 'ssh-key:info', description: 'Print information about an SSH key')] -class SshKeyInfoCommand extends SshKeyCommandBase { +final class SshKeyInfoCommand extends SshKeyCommandBase { protected function configure(): void { $this diff --git a/src/Command/Ssh/SshKeyListCommand.php b/src/Command/Ssh/SshKeyListCommand.php index 59e54a938..cdb165aa6 100644 --- a/src/Command/Ssh/SshKeyListCommand.php +++ b/src/Command/Ssh/SshKeyListCommand.php @@ -14,7 +14,7 @@ #[RequireAuth] #[AsCommand(name: 'ssh-key:list', description: 'List your local and remote SSH keys')] -class SshKeyListCommand extends SshKeyCommandBase { +final class SshKeyListCommand extends SshKeyCommandBase { protected function execute(InputInterface $input, OutputInterface $output): int { $acquiaCloudClient = $this->cloudApiClientService->getClient(); diff --git a/src/Command/Ssh/SshKeyUploadCommand.php b/src/Command/Ssh/SshKeyUploadCommand.php index 21c82d724..cc55f90a7 100644 --- a/src/Command/Ssh/SshKeyUploadCommand.php +++ b/src/Command/Ssh/SshKeyUploadCommand.php @@ -13,7 +13,7 @@ #[RequireAuth] #[AsCommand(name: 'ssh-key:upload', description: 'Upload a local SSH key to the Cloud Platform')] -class SshKeyUploadCommand extends SshKeyCommandBase { +final class SshKeyUploadCommand extends SshKeyCommandBase { protected function configure(): void { $this From 74bd5d45903e6e0e28d8575a559a03543ffcf020 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 28 Nov 2023 09:50:07 -0800 Subject: [PATCH 10/12] Requiredb --- src/Attribute/RequireDb.php | 13 +++++++++++++ src/Command/Archive/ArchiveExportCommand.php | 6 ++---- src/Command/CommandBase.php | 7 ++----- src/Command/Pull/PullCodeCommand.php | 6 ++---- src/Command/Pull/PullCommand.php | 6 ++---- src/Command/Pull/PullDatabaseCommand.php | 6 ++---- src/Command/Push/PushDatabaseCommand.php | 6 ++---- 7 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 src/Attribute/RequireDb.php diff --git a/src/Attribute/RequireDb.php b/src/Attribute/RequireDb.php new file mode 100644 index 000000000..c4a381408 --- /dev/null +++ b/src/Attribute/RequireDb.php @@ -0,0 +1,13 @@ +addArgument('destination-dir', InputArgument::REQUIRED, 'The destination directory for the archive file') diff --git a/src/Command/CommandBase.php b/src/Command/CommandBase.php index 098164095..44b243289 100644 --- a/src/Command/CommandBase.php +++ b/src/Command/CommandBase.php @@ -6,6 +6,7 @@ use Acquia\Cli\ApiCredentialsInterface; use Acquia\Cli\Attribute\RequireAuth; +use Acquia\Cli\Attribute\RequireDb; use Acquia\Cli\CloudApi\ClientService; use Acquia\Cli\Command\Ssh\SshKeyCommandBase; use Acquia\Cli\DataStore\AcquiaCliDatastore; @@ -117,7 +118,7 @@ public function __construct( if ($reflectionClass->getAttributes(RequireAuth::class)) { $this->appendHelp('This command requires authentication via the Cloud Platform API.'); } - if ($this->commandRequiresDatabase()) { + if ($reflectionClass->getAttributes(RequireDb::class)) { $this->appendHelp('This command requires an active database connection. Set the following environment variables prior to running this command: ' . 'ACLI_DB_HOST, ACLI_DB_NAME, ACLI_DB_USER, ACLI_DB_PASSWORD'); } @@ -303,10 +304,6 @@ protected function acceptSite(): self { return $this; } - protected function commandRequiresDatabase(): bool { - return FALSE; - } - /** * Prompts the user to choose from a list of available Cloud Platform * applications. diff --git a/src/Command/Pull/PullCodeCommand.php b/src/Command/Pull/PullCodeCommand.php index 089e325ad..aa38ea27f 100644 --- a/src/Command/Pull/PullCodeCommand.php +++ b/src/Command/Pull/PullCodeCommand.php @@ -5,6 +5,7 @@ namespace Acquia\Cli\Command\Pull; use Acquia\Cli\Attribute\RequireAuth; +use Acquia\Cli\Attribute\RequireDb; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; @@ -13,13 +14,10 @@ use Symfony\Component\Console\Output\OutputInterface; #[RequireAuth] +#[RequireDb] #[AsCommand(name: 'pull:code', description: 'Copy code from a Cloud Platform environment')] final class PullCodeCommand extends PullCommandBase { - protected function commandRequiresDatabase(): bool { - return TRUE; - } - protected function configure(): void { $this ->acceptEnvironmentId() diff --git a/src/Command/Pull/PullCommand.php b/src/Command/Pull/PullCommand.php index 3f41f681e..da45900de 100644 --- a/src/Command/Pull/PullCommand.php +++ b/src/Command/Pull/PullCommand.php @@ -5,6 +5,7 @@ namespace Acquia\Cli\Command\Pull; use Acquia\Cli\Attribute\RequireAuth; +use Acquia\Cli\Attribute\RequireDb; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; @@ -13,13 +14,10 @@ use Symfony\Component\Console\Output\OutputInterface; #[RequireAuth] +#[RequireDb] #[AsCommand(name: 'pull:all', description: 'Copy code, database, and files from a Cloud Platform environment', aliases: ['refresh', 'pull'])] final class PullCommand extends PullCommandBase { - protected function commandRequiresDatabase(): bool { - return TRUE; - } - protected function configure(): void { $this ->acceptEnvironmentId() diff --git a/src/Command/Pull/PullDatabaseCommand.php b/src/Command/Pull/PullDatabaseCommand.php index a48becd36..516528de6 100644 --- a/src/Command/Pull/PullDatabaseCommand.php +++ b/src/Command/Pull/PullDatabaseCommand.php @@ -5,6 +5,7 @@ namespace Acquia\Cli\Command\Pull; use Acquia\Cli\Attribute\RequireAuth; +use Acquia\Cli\Attribute\RequireDb; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; @@ -12,13 +13,10 @@ use Symfony\Component\Console\Output\OutputInterface; #[RequireAuth] +#[RequireDb] #[AsCommand(name: 'pull:database', description: 'Import database backup from a Cloud Platform environment', aliases: ['pull:db'])] final class PullDatabaseCommand extends PullCommandBase { - protected function commandRequiresDatabase(): bool { - return TRUE; - } - protected function configure(): void { $this ->setHelp('This uses the latest available database backup, which may be up to 24 hours old. If no backup exists, one will be created.') diff --git a/src/Command/Push/PushDatabaseCommand.php b/src/Command/Push/PushDatabaseCommand.php index 4e3733d54..00298cac9 100644 --- a/src/Command/Push/PushDatabaseCommand.php +++ b/src/Command/Push/PushDatabaseCommand.php @@ -5,6 +5,7 @@ namespace Acquia\Cli\Command\Push; use Acquia\Cli\Attribute\RequireAuth; +use Acquia\Cli\Attribute\RequireDb; use Acquia\Cli\Command\Pull\PullCommandBase; use Acquia\Cli\Exception\AcquiaCliException; use Acquia\Cli\Output\Checklist; @@ -16,13 +17,10 @@ use Symfony\Component\Console\Output\OutputInterface; #[RequireAuth] +#[RequireDb] #[AsCommand(name: 'push:database', description: 'Push a database from your local environment to a Cloud Platform environment', aliases: ['push:db'])] final class PushDatabaseCommand extends PullCommandBase { - protected function commandRequiresDatabase(): bool { - return TRUE; - } - protected function configure(): void { $this ->acceptEnvironmentId() From 7b06e5b4d1d1d8f73c7afd100f13285c0cacaa57 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 28 Nov 2023 10:06:22 -0800 Subject: [PATCH 11/12] sethidden --- src/Command/Api/ApiBaseCommand.php | 7 +------ src/Command/HelloWorldCommand.php | 7 +------ src/Command/Self/MakeDocsCommand.php | 7 +------ 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/Command/Api/ApiBaseCommand.php b/src/Command/Api/ApiBaseCommand.php index f9b121153..b1c96921d 100644 --- a/src/Command/Api/ApiBaseCommand.php +++ b/src/Command/Api/ApiBaseCommand.php @@ -23,7 +23,7 @@ use Symfony\Component\Validator\Validation; #[RequireAuth] -#[AsCommand(name: 'api:base')] +#[AsCommand(name: 'api:base', hidden: TRUE)] class ApiBaseCommand extends CommandBase { protected string $method; @@ -55,11 +55,6 @@ class ApiBaseCommand extends CommandBase { */ private array $pathParams = []; - protected function configure(): void { - $this->setHidden(); - parent::configure(); - } - protected function interact(InputInterface $input, OutputInterface $output): void { $params = array_merge($this->queryParams, $this->postParams, $this->pathParams); foreach ($this->getDefinition()->getArguments() as $argument) { diff --git a/src/Command/HelloWorldCommand.php b/src/Command/HelloWorldCommand.php index 81b93096b..c3409f6cc 100644 --- a/src/Command/HelloWorldCommand.php +++ b/src/Command/HelloWorldCommand.php @@ -9,14 +9,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'hello-world', description: 'Test command used for asserting core functionality')] +#[AsCommand(name: 'hello-world', description: 'Test command used for asserting core functionality', hidden: TRUE)] final class HelloWorldCommand extends CommandBase { - protected function configure(): void { - $this - ->setHidden(); - } - protected function execute(InputInterface $input, OutputInterface $output): int { $this->io->success('Hello world!'); diff --git a/src/Command/Self/MakeDocsCommand.php b/src/Command/Self/MakeDocsCommand.php index b760a77a6..c37b562a5 100644 --- a/src/Command/Self/MakeDocsCommand.php +++ b/src/Command/Self/MakeDocsCommand.php @@ -13,14 +13,9 @@ use Symfony\Component\Console\Output\OutputInterface; #[RequireAuth] -#[AsCommand(name: 'self:make-docs', description: 'Generate documentation for all ACLI commands')] +#[AsCommand(name: 'self:make-docs', description: 'Generate documentation for all ACLI commands', hidden: TRUE)] final class MakeDocsCommand extends CommandBase { - protected function configure(): void { - $this - ->setHidden(); - } - protected function execute(InputInterface $input, OutputInterface $output): int { $helper = new DescriptorHelper(); From b7ac97044ea1a7a6b925d00f6362b1016131987f Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 28 Nov 2023 10:45:43 -0800 Subject: [PATCH 12/12] clean up --- src/Command/Acsf/AcsfApiBaseCommand.php | 3 +-- src/Command/CommandBase.php | 8 +++----- src/Command/WizardCommandBase.php | 3 +-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Command/Acsf/AcsfApiBaseCommand.php b/src/Command/Acsf/AcsfApiBaseCommand.php index 09c827e9e..8cecd30af 100644 --- a/src/Command/Acsf/AcsfApiBaseCommand.php +++ b/src/Command/Acsf/AcsfApiBaseCommand.php @@ -14,8 +14,7 @@ class AcsfApiBaseCommand extends ApiBaseCommand { protected function checkAuthentication(): void { - $reflectionClass = new \ReflectionClass($this); - if ($reflectionClass->getAttributes(RequireAuth::class) && !$this->cloudApiClientService->isMachineAuthenticated()) { + if ((new \ReflectionClass(static::class))->getAttributes(RequireAuth::class) && !$this->cloudApiClientService->isMachineAuthenticated()) { throw new AcquiaCliException('This machine is not yet authenticated with the Acquia Cloud Site Factory. Run `acli auth:acsf-login`'); } } diff --git a/src/Command/CommandBase.php b/src/Command/CommandBase.php index 44b243289..73be130d9 100644 --- a/src/Command/CommandBase.php +++ b/src/Command/CommandBase.php @@ -114,11 +114,10 @@ public function __construct( $this->setLocalDbName(); $this->setLocalDbHost(); parent::__construct(); - $reflectionClass = new \ReflectionClass($this); - if ($reflectionClass->getAttributes(RequireAuth::class)) { + if ((new \ReflectionClass(static::class))->getAttributes(RequireAuth::class)) { $this->appendHelp('This command requires authentication via the Cloud Platform API.'); } - if ($reflectionClass->getAttributes(RequireDb::class)) { + if ((new \ReflectionClass(static::class))->getAttributes(RequireDb::class)) { $this->appendHelp('This command requires an active database connection. Set the following environment variables prior to running this command: ' . 'ACLI_DB_HOST, ACLI_DB_NAME, ACLI_DB_USER, ACLI_DB_PASSWORD'); } @@ -1468,8 +1467,7 @@ protected function validateEnvironmentUuid(mixed $envUuidArgument, mixed $argume } protected function checkAuthentication(): void { - $reflectionClass = new \ReflectionClass($this); - if ($reflectionClass->getAttributes(RequireAuth::class) && !$this->cloudApiClientService->isMachineAuthenticated()) { + if ((new \ReflectionClass(static::class))->getAttributes(RequireAuth::class) && !$this->cloudApiClientService->isMachineAuthenticated()) { throw new AcquiaCliException('This machine is not yet authenticated with the Cloud Platform. Run `acli auth:login`'); } } diff --git a/src/Command/WizardCommandBase.php b/src/Command/WizardCommandBase.php index 3c3e4a662..25891b497 100644 --- a/src/Command/WizardCommandBase.php +++ b/src/Command/WizardCommandBase.php @@ -17,8 +17,7 @@ abstract class WizardCommandBase extends SshKeyCommandBase { abstract protected function validateEnvironment(): void; protected function initialize(InputInterface $input, OutputInterface $output): void { - $reflectionClass = new \ReflectionClass($this); - if ($reflectionClass->getAttributes(RequireAuth::class) && !$this->cloudApiClientService->isMachineAuthenticated()) { + if ((new \ReflectionClass(static::class))->getAttributes(RequireAuth::class) && !$this->cloudApiClientService->isMachineAuthenticated()) { $commandName = 'auth:login'; $command = $this->getApplication()->find($commandName); $arguments = ['command' => $commandName];