Skip to content

Commit

Permalink
refactor: rename acsf auth classes, finish symfony6 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Nov 13, 2023
1 parent 3d90a1a commit 7f044a2
Show file tree
Hide file tree
Showing 30 changed files with 63 additions and 172 deletions.
4 changes: 2 additions & 2 deletions config/prod/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ services:
Acquia\Cli\Command\Acsf\AcsfListCommandBase:
class: Acquia\Cli\Command\Acsf\AcsfListCommandBase
factory: [ '@Acquia\Cli\Command\Acsf\AcsfCommandFactory', 'createListCommand' ]
Acquia\Cli\Command\Acsf\AcsfApiAuthLoginCommand:
Acquia\Cli\Command\Auth\AuthAcsfLoginCommand:
arguments:
Acquia\Cli\ApiCredentialsInterface: '@acsf.credentials'
Acquia\Cli\Command\Acsf\AcsfApiAuthLogoutCommand:
Acquia\Cli\Command\Auth\AuthAcsfLogoutCommand:
arguments:
Acquia\Cli\ApiCredentialsInterface: '@acsf.credentials'

Expand Down
10 changes: 0 additions & 10 deletions src/Command/Acsf/AcsfCommandBase.php

This file was deleted.

8 changes: 2 additions & 6 deletions src/Command/App/NewFromDrupal7Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
use Acquia\Cli\Command\App\From\SourceSite\SiteInspectorInterface;
use Acquia\Cli\Command\CommandBase;
use Acquia\Cli\Exception\AcquiaCliException;
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;
use Symfony\Component\Filesystem\Path;
use Symfony\Component\Validator\Exception\ValidatorException;

#[AsCommand(name: 'app:new:from:drupal7')]
class NewFromDrupal7Command extends CommandBase {

/**
Expand All @@ -39,12 +41,6 @@ class NewFromDrupal7Command extends CommandBase {
*/
public const ERR_INDETERMINATE_SITE = 4;

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'app:new:from:drupal7';

protected function configure(): void {
$this->setDescription('Generate a new Drupal 9+ project from a Drupal 7 application using the default Acquia Migrate Accelerate recommendations.')
->addOption('drupal7-directory', 'source', InputOption::VALUE_OPTIONAL, 'The root of the Drupal 7 application.')
Expand Down
8 changes: 2 additions & 6 deletions src/Command/App/TaskWaitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@
namespace Acquia\Cli\Command\App;

use Acquia\Cli\Command\CommandBase;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'app:task-wait')]
class TaskWaitCommand extends CommandBase {

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'app:task-wait';

protected function configure(): void {
$this->setDescription('Wait for a task to complete')
->addArgument('notification-uuid', InputArgument::REQUIRED, 'The task notification UUID or Cloud Platform API response containing a linked notification')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@

declare(strict_types = 1);

namespace Acquia\Cli\Command\Acsf;
namespace Acquia\Cli\Command\Auth;

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\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class AcsfApiAuthLoginCommand extends AcsfCommandBase {

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'auth:acsf-login';
#[AsCommand(name: 'auth:acsf-login')]
class AuthAcsfLoginCommand extends CommandBase {

protected function configure(): void {
$this->setDescription('Register your Site Factory API key and secret to use API functionality')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@

declare(strict_types = 1);

namespace Acquia\Cli\Command\Acsf;
namespace Acquia\Cli\Command\Auth;

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;

class AcsfApiAuthLogoutCommand extends AcsfCommandBase {

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'auth:acsf-logout';
#[AsCommand(name: 'auth:acsf-logout')]
class AuthAcsfLogoutCommand extends CommandBase {

protected function configure(): void {
$this->setDescription('Remove your Site Factory key and secret from your local machine.');
Expand Down
8 changes: 2 additions & 6 deletions src/Command/CodeStudio/CodeStudioPhpVersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,16 @@

use Acquia\Cli\Command\CommandBase;
use Gitlab\Exception\RuntimeException;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'codestudio:php-version')]
class CodeStudioPhpVersionCommand extends CommandBase {

use CodeStudioCommandTrait;

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'codestudio:php-version';

protected function configure(): void {
$this->setDescription('Change the PHP version in Code Studio')
->addArgument('php-version', InputArgument::REQUIRED, 'The PHP version that needs to configured or updated')
Expand Down
8 changes: 2 additions & 6 deletions src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,19 @@
use Acquia\Cli\Exception\AcquiaCliException;
use Acquia\DrupalEnvironmentDetector\AcquiaDrupalEnvironmentDetector;
use AcquiaCloudApi\Endpoints\Account;
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;
use Symfony\Component\Filesystem\Path;
use Symfony\Component\Yaml\Yaml;

#[AsCommand(name: 'codestudio:pipelines-migrate')]
class CodeStudioPipelinesMigrateCommand extends CommandBase {

use CodeStudioCommandTrait;

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'codestudio:pipelines-migrate';

protected function configure(): void {
$this->setDescription('Migrate .acquia-pipeline.yml file to .gitlab-ci.yml file for a given Acquia Cloud application')
->addOption('key', NULL, InputOption::VALUE_REQUIRED, 'The Cloud Platform API token that Code Studio will use')
Expand Down
8 changes: 2 additions & 6 deletions src/Command/Env/EnvCertCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,16 @@

use Acquia\Cli\Command\CommandBase;
use AcquiaCloudApi\Endpoints\SslCertificates;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'env:certificate-create')]
class EnvCertCreateCommand extends CommandBase {

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'env:certificate-create';

protected function configure(): void {
$this->setDescription('Install an SSL certificate.')
->addArgument('certificate', InputArgument::REQUIRED, 'Filename of the SSL certificate being installed')
Expand Down
8 changes: 2 additions & 6 deletions src/Command/Env/EnvCopyCronCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@
use Acquia\Cli\Command\CommandBase;
use AcquiaCloudApi\Endpoints\Crons;
use Exception;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'env:cron-copy')]
class EnvCopyCronCommand extends CommandBase {

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'env:cron-copy';

protected function configure(): void {
$this->setDescription('Copy all cron tasks from one Acquia Cloud Platform environment to another')
->addArgument('source_env', InputArgument::REQUIRED, 'Alias of the source environment in the format `app-name.env` or the environment uuid')
Expand Down
8 changes: 2 additions & 6 deletions src/Command/HelloWorldCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@

namespace Acquia\Cli\Command;

use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'hello-world')]
class HelloWorldCommand extends CommandBase {

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'hello-world';

protected function configure(): void {
$this->setDescription('Test command used for asserting core functionality')
->setHidden();
Expand Down
8 changes: 2 additions & 6 deletions src/Command/Ide/IdePhpVersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@

use Acquia\Cli\Exception\AcquiaCliException;
use Acquia\DrupalEnvironmentDetector\AcquiaDrupalEnvironmentDetector;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'ide:php-version')]
class IdePhpVersionCommand extends IdeCommandBase {

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'ide:php-version';

private string $idePhpFilePathPrefix;

/*
Expand Down
8 changes: 2 additions & 6 deletions src/Command/Ide/IdeServiceRestartCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Acquia\Cli\Command\Ide;

use Acquia\DrupalEnvironmentDetector\AcquiaDrupalEnvironmentDetector;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -13,14 +14,9 @@
use Symfony\Component\Validator\Exception\ValidatorException;
use Symfony\Component\Validator\Validation;

#[AsCommand(name: 'ide:service-restart')]
class IdeServiceRestartCommand extends IdeCommandBase {

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'ide:service-restart';

protected function commandRequiresAuthentication(): bool {
return FALSE;
}
Expand Down
8 changes: 2 additions & 6 deletions src/Command/Ide/IdeServiceStartCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Acquia\Cli\Command\Ide;

use Acquia\DrupalEnvironmentDetector\AcquiaDrupalEnvironmentDetector;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -13,14 +14,9 @@
use Symfony\Component\Validator\Exception\ValidatorException;
use Symfony\Component\Validator\Validation;

#[AsCommand(name: 'ide:service-start')]
class IdeServiceStartCommand extends IdeCommandBase {

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'ide:service-start';

protected function commandRequiresAuthentication(): bool {
return FALSE;
}
Expand Down
8 changes: 2 additions & 6 deletions src/Command/Ide/IdeServiceStopCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Acquia\Cli\Command\Ide;

use Acquia\DrupalEnvironmentDetector\AcquiaDrupalEnvironmentDetector;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -13,14 +14,9 @@
use Symfony\Component\Validator\Exception\ValidatorException;
use Symfony\Component\Validator\Validation;

#[AsCommand(name: 'ide:service-stop')]
class IdeServiceStopCommand extends IdeCommandBase {

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'ide:service-stop';

protected function commandRequiresAuthentication(): bool {
return FALSE;
}
Expand Down
8 changes: 2 additions & 6 deletions src/Command/Ide/IdeXdebugToggleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@

use Acquia\Cli\Exception\AcquiaCliException;
use Acquia\DrupalEnvironmentDetector\AcquiaDrupalEnvironmentDetector;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'ide:xdebug-toggle')]
class IdeXdebugToggleCommand extends IdeCommandBase {

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'ide:xdebug-toggle';

private ?bool $xDebugEnabled;

protected function commandRequiresAuthentication(): bool {
Expand Down
8 changes: 2 additions & 6 deletions src/Command/Ide/Wizard/IdeWizardCreateSshKeyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@
use Acquia\Cli\Command\CommandBase;
use Acquia\Cli\Output\Checklist;
use AcquiaCloudApi\Endpoints\Account;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'ide:wizard:ssh-key:create-upload')]
class IdeWizardCreateSshKeyCommand extends IdeWizardCommandBase {

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'ide:wizard:ssh-key:create-upload';

protected function configure(): void {
$this->setDescription('Wizard to perform first time setup tasks within an IDE')
->setAliases(['ide:wizard'])
Expand Down
8 changes: 2 additions & 6 deletions src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,16 @@
use Acquia\Cli\Command\CommandBase;
use Acquia\Cli\Exception\AcquiaCliException;
use Acquia\Cli\Helpers\SshCommandTrait;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'ide:wizard:ssh-key:delete')]
class IdeWizardDeleteSshKeyCommand extends IdeWizardCommandBase {

use SshCommandTrait;

/**
* @var string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $defaultName = 'ide:wizard:ssh-key:delete';

protected function configure(): void {
$this->setDescription('Wizard to delete SSH key for IDE from Cloud')
->setHidden(!CommandBase::isAcquiaCloudIde());
Expand Down
Loading

0 comments on commit 7f044a2

Please sign in to comment.